.class public final synthetic Lc5/a;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Lf5/b$a;
.implements Le5/n$b;


# instance fields
.field public final synthetic r:I

.field public final synthetic s:Ljava/lang/Object;

.field public final synthetic t:Lz4/i;

.field public final synthetic u:Ljava/lang/Object;


# direct methods
.method public synthetic constructor <init>(Lc5/c;Lz4/i;Lz4/f;)V
    .registers 5

    const/4 v0, 0x0

    iput v0, p0, Lc5/a;->r:I

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lc5/a;->s:Ljava/lang/Object;

    iput-object p2, p0, Lc5/a;->t:Lz4/i;

    iput-object p3, p0, Lc5/a;->u:Ljava/lang/Object;

    return-void
.end method

.method public synthetic constructor <init>(Le5/n;Ljava/util/List;Lz4/i;)V
    .registers 5

    const/4 v0, 0x2

    iput v0, p0, Lc5/a;->r:I

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lc5/a;->s:Ljava/lang/Object;

    iput-object p2, p0, Lc5/a;->u:Ljava/lang/Object;

    iput-object p3, p0, Lc5/a;->t:Lz4/i;

    return-void
.end method

.method public synthetic constructor <init>(Le5/n;Lz4/i;Lz4/f;)V
    .registers 5

    const/4 v0, 0x1

    iput v0, p0, Lc5/a;->r:I

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lc5/a;->s:Ljava/lang/Object;

    iput-object p2, p0, Lc5/a;->t:Lz4/i;

    iput-object p3, p0, Lc5/a;->u:Ljava/lang/Object;

    return-void
.end method


# virtual methods
.method public a()Ljava/lang/Object;
    .registers 5

    iget-object v0, p0, Lc5/a;->s:Ljava/lang/Object;

    check-cast v0, Lc5/c;

    iget-object v1, p0, Lc5/a;->t:Lz4/i;

    iget-object v2, p0, Lc5/a;->u:Ljava/lang/Object;

    check-cast v2, Lz4/f;

    .line 1
    iget-object v3, v0, Lc5/c;->d:Le5/c;

    invoke-interface {v3, v1, v2}, Le5/c;->h(Lz4/i;Lz4/f;)Le5/h;

    iget-object v0, v0, Lc5/c;->a:Ld5/k;

    const/4 v2, 0x1

    invoke-interface {v0, v1, v2}, Ld5/k;->b(Lz4/i;I)V

    const/4 v0, 0x0

    return-object v0
.end method

.method public apply(Ljava/lang/Object;)Ljava/lang/Object;
    .registers 25

    move-object/from16 v1, p0

    iget v0, v1, Lc5/a;->r:I

    const/4 v2, 0x0

    .line 1
    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v3

    const/4 v4, 0x0

    const/4 v5, 0x1

    const-string v6, "bytes"

    packed-switch v0, :pswitch_data_2b2

    goto/16 :goto_198

    .line 2
    :pswitch_12
    iget-object v0, v1, Lc5/a;->s:Ljava/lang/Object;

    check-cast v0, Le5/n;

    iget-object v7, v1, Lc5/a;->t:Lz4/i;

    iget-object v8, v1, Lc5/a;->u:Ljava/lang/Object;

    check-cast v8, Lz4/f;

    move-object/from16 v9, p1

    check-cast v9, Landroid/database/sqlite/SQLiteDatabase;

    sget-object v10, Le5/n;->v:Lw4/b;

    .line 3
    invoke-virtual {v0}, Le5/n;->e()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v10

    const-string v11, "PRAGMA page_count"

    invoke-virtual {v10, v11}, Landroid/database/sqlite/SQLiteDatabase;->compileStatement(Ljava/lang/String;)Landroid/database/sqlite/SQLiteStatement;

    move-result-object v10

    invoke-virtual {v10}, Landroid/database/sqlite/SQLiteStatement;->simpleQueryForLong()J

    move-result-wide v10

    .line 4
    invoke-virtual {v0}, Le5/n;->e()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v12

    const-string v13, "PRAGMA page_size"

    invoke-virtual {v12, v13}, Landroid/database/sqlite/SQLiteDatabase;->compileStatement(Ljava/lang/String;)Landroid/database/sqlite/SQLiteStatement;

    move-result-object v12

    invoke-virtual {v12}, Landroid/database/sqlite/SQLiteStatement;->simpleQueryForLong()J

    move-result-wide v12

    mul-long/2addr v12, v10

    .line 5
    iget-object v10, v0, Le5/n;->u:Le5/d;

    invoke-virtual {v10}, Le5/d;->e()J

    move-result-wide v10

    cmp-long v10, v12, v10

    if-ltz v10, :cond_4b

    move v10, v5

    goto :goto_4c

    :cond_4b
    move v10, v2

    :goto_4c
    if-eqz v10, :cond_56

    const-wide/16 v2, -0x1

    .line 6
    :cond_50
    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    goto/16 :goto_197

    .line 7
    :cond_56
    invoke-virtual {v0, v9, v7}, Le5/n;->g(Landroid/database/sqlite/SQLiteDatabase;Lz4/i;)Ljava/lang/Long;

    move-result-object v10

    if-eqz v10, :cond_61

    invoke-virtual {v10}, Ljava/lang/Long;->longValue()J

    move-result-wide v10

    goto :goto_9e

    :cond_61
    new-instance v10, Landroid/content/ContentValues;

    invoke-direct {v10}, Landroid/content/ContentValues;-><init>()V

    invoke-virtual {v7}, Lz4/i;->b()Ljava/lang/String;

    move-result-object v11

    const-string v12, "backend_name"

    invoke-virtual {v10, v12, v11}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v7}, Lz4/i;->d()Lw4/d;

    move-result-object v11

    invoke-static {v11}, Lh5/a;->a(Lw4/d;)I

    move-result v11

    invoke-static {v11}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v11

    const-string v12, "priority"

    invoke-virtual {v10, v12, v11}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    const-string v11, "next_request_ms"

    invoke-virtual {v10, v11, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    invoke-virtual {v7}, Lz4/i;->c()[B

    move-result-object v11

    if-eqz v11, :cond_98

    invoke-virtual {v7}, Lz4/i;->c()[B

    move-result-object v7

    invoke-static {v7, v2}, Landroid/util/Base64;->encodeToString([BI)Ljava/lang/String;

    move-result-object v7

    const-string v11, "extras"

    invoke-virtual {v10, v11, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    :cond_98
    const-string v7, "transport_contexts"

    invoke-virtual {v9, v7, v4, v10}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    move-result-wide v10

    .line 8
    :goto_9e
    iget-object v0, v0, Le5/n;->u:Le5/d;

    invoke-virtual {v0}, Le5/d;->d()I

    move-result v0

    invoke-virtual {v8}, Lz4/f;->d()Lz4/e;

    move-result-object v7

    .line 9
    iget-object v7, v7, Lz4/e;->b:[B

    .line 10
    array-length v12, v7

    if-gt v12, v0, :cond_af

    move v12, v5

    goto :goto_b0

    :cond_af
    move v12, v2

    :goto_b0
    new-instance v13, Landroid/content/ContentValues;

    invoke-direct {v13}, Landroid/content/ContentValues;-><init>()V

    invoke-static {v10, v11}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v10

    const-string v11, "context_id"

    invoke-virtual {v13, v11, v10}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    invoke-virtual {v8}, Lz4/f;->g()Ljava/lang/String;

    move-result-object v10

    const-string v11, "transport_name"

    invoke-virtual {v13, v11, v10}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v8}, Lz4/f;->e()J

    move-result-wide v10

    invoke-static {v10, v11}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v10

    const-string v11, "timestamp_ms"

    invoke-virtual {v13, v11, v10}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    invoke-virtual {v8}, Lz4/f;->h()J

    move-result-wide v10

    invoke-static {v10, v11}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v10

    const-string v11, "uptime_ms"

    invoke-virtual {v13, v11, v10}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    invoke-virtual {v8}, Lz4/f;->d()Lz4/e;

    move-result-object v10

    .line 11
    iget-object v10, v10, Lz4/e;->a:Lw4/b;

    .line 12
    iget-object v10, v10, Lw4/b;->a:Ljava/lang/String;

    const-string v11, "payload_encoding"

    .line 13
    invoke-virtual {v13, v11, v10}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v8}, Lz4/f;->c()Ljava/lang/Integer;

    move-result-object v10

    const-string v11, "code"

    invoke-virtual {v13, v11, v10}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    const-string v10, "num_attempts"

    invoke-virtual {v13, v10, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    invoke-static {v12}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v3

    const-string v10, "inline"

    invoke-virtual {v13, v10, v3}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Boolean;)V

    if-eqz v12, :cond_109

    move-object v2, v7

    goto :goto_10b

    :cond_109
    new-array v2, v2, [B

    :goto_10b
    const-string v3, "payload"

    invoke-virtual {v13, v3, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;[B)V

    const-string v2, "events"

    invoke-virtual {v9, v2, v4, v13}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    move-result-wide v2

    const-string v10, "event_id"

    if-nez v12, :cond_153

    array-length v11, v7

    int-to-double v11, v11

    int-to-double v13, v0

    div-double/2addr v11, v13

    invoke-static {v11, v12}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v11

    double-to-int v11, v11

    :goto_123
    if-gt v5, v11, :cond_153

    add-int/lit8 v12, v5, -0x1

    mul-int/2addr v12, v0

    mul-int v13, v5, v0

    array-length v14, v7

    invoke-static {v13, v14}, Ljava/lang/Math;->min(II)I

    move-result v13

    invoke-static {v7, v12, v13}, Ljava/util/Arrays;->copyOfRange([BII)[B

    move-result-object v12

    new-instance v13, Landroid/content/ContentValues;

    invoke-direct {v13}, Landroid/content/ContentValues;-><init>()V

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v14

    invoke-virtual {v13, v10, v14}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v14

    const-string v15, "sequence_num"

    invoke-virtual {v13, v15, v14}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    invoke-virtual {v13, v6, v12}, Landroid/content/ContentValues;->put(Ljava/lang/String;[B)V

    const-string v12, "event_payloads"

    invoke-virtual {v9, v12, v4, v13}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    add-int/lit8 v5, v5, 0x1

    goto :goto_123

    .line 14
    :cond_153
    invoke-virtual {v8}, Lz4/f;->b()Ljava/util/Map;

    move-result-object v0

    invoke-static {v0}, Ljava/util/Collections;->unmodifiableMap(Ljava/util/Map;)Ljava/util/Map;

    move-result-object v0

    .line 15
    invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_163
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v5

    if-eqz v5, :cond_50

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/util/Map$Entry;

    new-instance v6, Landroid/content/ContentValues;

    invoke-direct {v6}, Landroid/content/ContentValues;-><init>()V

    invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v7

    invoke-virtual {v6, v10, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    invoke-interface {v5}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Ljava/lang/String;

    const-string v8, "name"

    invoke-virtual {v6, v8, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v5}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/lang/String;

    const-string v7, "value"

    invoke-virtual {v6, v7, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v5, "event_metadata"

    invoke-virtual {v9, v5, v4, v6}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    goto :goto_163

    :goto_197
    return-object v0

    .line 16
    :goto_198
    iget-object v0, v1, Lc5/a;->s:Ljava/lang/Object;

    check-cast v0, Le5/n;

    iget-object v3, v1, Lc5/a;->u:Ljava/lang/Object;

    check-cast v3, Ljava/util/List;

    iget-object v7, v1, Lc5/a;->t:Lz4/i;

    move-object/from16 v8, p1

    check-cast v8, Landroid/database/Cursor;

    sget-object v9, Le5/n;->v:Lw4/b;

    invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 17
    :goto_1ab
    invoke-interface {v8}, Landroid/database/Cursor;->moveToNext()Z

    move-result v9

    if-eqz v9, :cond_2b0

    invoke-interface {v8, v2}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v9

    const/4 v11, 0x7

    invoke-interface {v8, v11}, Landroid/database/Cursor;->getInt(I)I

    move-result v11

    if-eqz v11, :cond_1be

    move v11, v5

    goto :goto_1bf

    :cond_1be
    move v11, v2

    .line 18
    :goto_1bf
    new-instance v12, Lz4/a$b;

    invoke-direct {v12}, Lz4/a$b;-><init>()V

    new-instance v13, Ljava/util/HashMap;

    invoke-direct {v13}, Ljava/util/HashMap;-><init>()V

    .line 19
    iput-object v13, v12, Lz4/a$b;->f:Ljava/util/Map;

    .line 20
    invoke-interface {v8, v5}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v13

    invoke-virtual {v12, v13}, Lz4/a$b;->f(Ljava/lang/String;)Lz4/f$a;

    const/4 v13, 0x2

    invoke-interface {v8, v13}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v13

    invoke-virtual {v12, v13, v14}, Lz4/a$b;->e(J)Lz4/f$a;

    const/4 v13, 0x3

    invoke-interface {v8, v13}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v13

    invoke-virtual {v12, v13, v14}, Lz4/a$b;->g(J)Lz4/f$a;

    const/4 v13, 0x4

    if-eqz v11, :cond_208

    new-instance v11, Lz4/e;

    invoke-interface {v8, v13}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v13

    if-nez v13, :cond_1f0

    .line 21
    sget-object v13, Le5/n;->v:Lw4/b;

    goto :goto_1f6

    .line 22
    :cond_1f0
    new-instance v14, Lw4/b;

    invoke-direct {v14, v13}, Lw4/b;-><init>(Ljava/lang/String;)V

    move-object v13, v14

    :goto_1f6
    const/4 v14, 0x5

    .line 23
    invoke-interface {v8, v14}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v14

    invoke-direct {v11, v13, v14}, Lz4/e;-><init>(Lw4/b;[B)V

    invoke-virtual {v12, v11}, Lz4/a$b;->d(Lz4/e;)Lz4/f$a;

    move-object/from16 v19, v0

    move-object/from16 v20, v6

    move v6, v2

    goto/16 :goto_283

    :cond_208
    new-instance v11, Lz4/e;

    invoke-interface {v8, v13}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v13

    if-nez v13, :cond_213

    .line 24
    sget-object v13, Le5/n;->v:Lw4/b;

    goto :goto_219

    .line 25
    :cond_213
    new-instance v14, Lw4/b;

    invoke-direct {v14, v13}, Lw4/b;-><init>(Ljava/lang/String;)V

    move-object v13, v14

    .line 26
    :goto_219
    invoke-virtual {v0}, Le5/n;->e()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v14

    filled-new-array {v6}, [Ljava/lang/String;

    move-result-object v16

    new-array v15, v5, [Ljava/lang/String;

    invoke-static {v9, v10}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v17

    aput-object v17, v15, v2

    const/16 v19, 0x0

    const/16 v20, 0x0

    const-string v17, "event_payloads"

    const-string v18, "event_id = ?"

    const-string v21, "sequence_num"

    move-object/from16 v22, v15

    move-object/from16 v15, v17

    move-object/from16 v17, v18

    move-object/from16 v18, v22

    invoke-virtual/range {v14 .. v21}, Landroid/database/sqlite/SQLiteDatabase;->query(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v14

    .line 27
    :try_start_23f
    new-instance v15, Ljava/util/ArrayList;

    invoke-direct {v15}, Ljava/util/ArrayList;-><init>()V

    move v5, v2

    :goto_245
    invoke-interface {v14}, Landroid/database/Cursor;->moveToNext()Z

    move-result v17

    if-eqz v17, :cond_256

    invoke-interface {v14, v2}, Landroid/database/Cursor;->getBlob(I)[B

    move-result-object v4

    invoke-virtual {v15, v4}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    array-length v4, v4

    add-int/2addr v5, v4

    const/4 v4, 0x0

    goto :goto_245

    :cond_256
    new-array v4, v5, [B

    move-object/from16 v19, v0

    move v5, v2

    :goto_25b
    invoke-virtual {v15}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-ge v5, v0, :cond_277

    invoke-virtual {v15, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [B

    array-length v1, v0

    move-object/from16 v20, v6

    const/4 v6, 0x0

    invoke-static {v0, v6, v4, v2, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    array-length v0, v0
    :try_end_26f
    .catchall {:try_start_23f .. :try_end_26f} :catchall_2ab

    add-int/2addr v2, v0

    add-int/lit8 v5, v5, 0x1

    move-object/from16 v1, p0

    move-object/from16 v6, v20

    goto :goto_25b

    :cond_277
    move-object/from16 v20, v6

    const/4 v6, 0x0

    .line 28
    invoke-interface {v14}, Landroid/database/Cursor;->close()V

    .line 29
    invoke-direct {v11, v13, v4}, Lz4/e;-><init>(Lw4/b;[B)V

    invoke-virtual {v12, v11}, Lz4/a$b;->d(Lz4/e;)Lz4/f$a;

    :goto_283
    const/4 v0, 0x6

    invoke-interface {v8, v0}, Landroid/database/Cursor;->isNull(I)Z

    move-result v1

    if-nez v1, :cond_294

    invoke-interface {v8, v0}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    .line 30
    iput-object v0, v12, Lz4/a$b;->b:Ljava/lang/Integer;

    .line 31
    :cond_294
    invoke-virtual {v12}, Lz4/a$b;->b()Lz4/f;

    move-result-object v0

    .line 32
    new-instance v1, Le5/b;

    invoke-direct {v1, v9, v10, v7, v0}, Le5/b;-><init>(JLz4/i;Lz4/f;)V

    .line 33
    invoke-interface {v3, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    move-object/from16 v1, p0

    move v2, v6

    move-object/from16 v0, v19

    move-object/from16 v6, v20

    const/4 v4, 0x0

    const/4 v5, 0x1

    goto/16 :goto_1ab

    :catchall_2ab
    move-exception v0

    .line 34
    invoke-interface {v14}, Landroid/database/Cursor;->close()V

    throw v0

    :cond_2b0
    move-object v0, v4

    return-object v0

    :pswitch_data_2b2
    .packed-switch 0x1
        :pswitch_12
    .end packed-switch
.end method
