.class public final Ls4/s;
.super Ld9/h;
.source ""

# interfaces
.implements Lh9/c;


# annotations
.annotation runtime Ld9/e;
    c = "com.floydwiz.gamingcenter.viewmodels.UpdateVM$saveFileToDiskInBackground$2"
    f = "UpdateVM.kt"
    l = {}
    m = "invokeSuspend"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ld9/h;",
        "Lh9/c<",
        "Lq9/w;",
        "Lb9/d<",
        "-",
        "Ly8/k;",
        ">;",
        "Ljava/lang/Object;",
        ">;"
    }
.end annotation


# instance fields
.field public final synthetic v:Lv9/h0;

.field public final synthetic w:Ljava/io/File;


# direct methods
.method public constructor <init>(Lv9/h0;Ljava/io/File;Lb9/d;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lv9/h0;",
            "Ljava/io/File;",
            "Lb9/d<",
            "-",
            "Ls4/s;",
            ">;)V"
        }
    .end annotation

    iput-object p1, p0, Ls4/s;->v:Lv9/h0;

    iput-object p2, p0, Ls4/s;->w:Ljava/io/File;

    const/4 p1, 0x2

    invoke-direct {p0, p1, p3}, Ld9/h;-><init>(ILb9/d;)V

    return-void
.end method


# virtual methods
.method public final b(Ljava/lang/Object;Lb9/d;)Lb9/d;
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Object;",
            "Lb9/d<",
            "*>;)",
            "Lb9/d<",
            "Ly8/k;",
            ">;"
        }
    .end annotation

    new-instance p1, Ls4/s;

    iget-object v0, p0, Ls4/s;->v:Lv9/h0;

    iget-object v1, p0, Ls4/s;->w:Ljava/io/File;

    invoke-direct {p1, v0, v1, p2}, Ls4/s;-><init>(Lv9/h0;Ljava/io/File;Lb9/d;)V

    return-object p1
.end method

.method public e(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    .registers 5

    check-cast p1, Lq9/w;

    check-cast p2, Lb9/d;

    .line 1
    new-instance p1, Ls4/s;

    iget-object v0, p0, Ls4/s;->v:Lv9/h0;

    iget-object v1, p0, Ls4/s;->w:Ljava/io/File;

    invoke-direct {p1, v0, v1, p2}, Ls4/s;-><init>(Lv9/h0;Ljava/io/File;Lb9/d;)V

    .line 2
    sget-object p2, Ly8/k;->a:Ly8/k;

    invoke-virtual {p1, p2}, Ls4/s;->o(Ljava/lang/Object;)Ljava/lang/Object;

    return-object p2
.end method

.method public final o(Ljava/lang/Object;)Ljava/lang/Object;
    .registers 10

    invoke-static {p1}, Le/h;->h(Ljava/lang/Object;)V

    const/4 p1, 0x0

    const/4 v0, 0x0

    :try_start_5
    iget-object v1, p0, Ls4/s;->v:Lv9/h0;

    .line 1
    invoke-virtual {v1}, Lv9/h0;->k()Lha/h;

    move-result-object v1

    invoke-interface {v1}, Lha/h;->X()Ljava/io/InputStream;

    move-result-object v1
    :try_end_f
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_f} :catch_5b
    .catchall {:try_start_5 .. :try_end_f} :catchall_56

    .line 2
    :try_start_f
    new-instance v2, Ljava/io/FileOutputStream;

    iget-object v3, p0, Ls4/s;->w:Ljava/io/File;

    invoke-direct {v2, v3}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
    :try_end_16
    .catch Ljava/io/IOException; {:try_start_f .. :try_end_16} :catch_51
    .catchall {:try_start_f .. :try_end_16} :catchall_4e

    const/16 p1, 0x1000

    :try_start_18
    new-array p1, p1, [B

    iget-object v3, p0, Ls4/s;->v:Lv9/h0;

    invoke-virtual {v3}, Lv9/h0;->e()J

    move-result-wide v3

    const-string v5, "debugupdate File size = "

    .line 3
    new-instance v6, Ljava/lang/Long;

    invoke-direct {v6, v3, v4}, Ljava/lang/Long;-><init>(J)V

    .line 4
    invoke-static {v5, v6}, Lx/e;->k(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    new-array v4, v0, [Ljava/lang/Object;

    invoke-static {v3, v4}, Lbb/a;->a(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_30
    invoke-virtual {v1, p1}, Ljava/io/InputStream;->read([B)I

    move-result v3

    const/4 v4, -0x1

    if-eq v3, v4, :cond_3b

    invoke-virtual {v2, p1, v0, v3}, Ljava/io/FileOutputStream;->write([BII)V

    goto :goto_30

    :cond_3b
    invoke-virtual {v2}, Ljava/io/FileOutputStream;->flush()V

    const-string p1, "debugupdate file saved successfully"

    new-array v3, v0, [Ljava/lang/Object;

    invoke-static {p1, v3}, Lbb/a;->a(Ljava/lang/String;[Ljava/lang/Object;)V
    :try_end_45
    .catch Ljava/io/IOException; {:try_start_18 .. :try_end_45} :catch_4c
    .catchall {:try_start_18 .. :try_end_45} :catchall_74

    invoke-virtual {v1}, Ljava/io/InputStream;->close()V

    :cond_48
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V

    goto :goto_71

    :catch_4c
    move-exception p1

    goto :goto_5f

    :catchall_4e
    move-exception v0

    move-object v2, p1

    goto :goto_59

    :catch_51
    move-exception v2

    move-object v7, v2

    move-object v2, p1

    move-object p1, v7

    goto :goto_5f

    :catchall_56
    move-exception v0

    move-object v1, p1

    move-object v2, v1

    :goto_59
    move-object p1, v0

    goto :goto_75

    :catch_5b
    move-exception v1

    move-object v2, p1

    move-object p1, v1

    move-object v1, v2

    :goto_5f
    :try_start_5f
    invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V

    const-string p1, "debugupdate Failed to save the file!"

    new-array v0, v0, [Ljava/lang/Object;

    invoke-static {p1, v0}, Lbb/a;->b(Ljava/lang/String;[Ljava/lang/Object;)V
    :try_end_69
    .catchall {:try_start_5f .. :try_end_69} :catchall_74

    if-nez v1, :cond_6c

    goto :goto_6f

    :cond_6c
    invoke-virtual {v1}, Ljava/io/InputStream;->close()V

    :goto_6f
    if-nez v2, :cond_48

    :goto_71
    sget-object p1, Ly8/k;->a:Ly8/k;

    return-object p1

    :catchall_74
    move-exception p1

    :goto_75
    if-nez v1, :cond_78

    goto :goto_7b

    :cond_78
    invoke-virtual {v1}, Ljava/io/InputStream;->close()V

    :goto_7b
    if-nez v2, :cond_7e

    goto :goto_81

    :cond_7e
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V

    :goto_81
    throw p1
.end method
