.class public Lv/n;
.super Ljava/lang/Object;
.source ""


# static fields
.field public static c:I


# instance fields
.field public a:Lv/q;

.field public b:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Lv/q;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Lv/q;I)V
    .registers 3

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

    const/4 p2, 0x0

    iput-object p2, p0, Lv/n;->a:Lv/q;

    new-instance p2, Ljava/util/ArrayList;

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

    iput-object p2, p0, Lv/n;->b:Ljava/util/ArrayList;

    sget p2, Lv/n;->c:I

    add-int/lit8 p2, p2, 0x1

    sput p2, Lv/n;->c:I

    iput-object p1, p0, Lv/n;->a:Lv/q;

    return-void
.end method


# virtual methods
.method public final a(Lv/g;J)J
    .registers 12

    iget-object v0, p1, Lv/g;->d:Lv/q;

    instance-of v1, v0, Lv/l;

    if-eqz v1, :cond_7

    return-wide p2

    :cond_7
    iget-object v1, p1, Lv/g;->k:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    const/4 v2, 0x0

    move-wide v3, p2

    :goto_f
    if-ge v2, v1, :cond_33

    iget-object v5, p1, Lv/g;->k:Ljava/util/List;

    invoke-interface {v5, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lv/d;

    instance-of v6, v5, Lv/g;

    if-eqz v6, :cond_30

    check-cast v5, Lv/g;

    iget-object v6, v5, Lv/g;->d:Lv/q;

    if-ne v6, v0, :cond_24

    goto :goto_30

    :cond_24
    iget v6, v5, Lv/g;->f:I

    int-to-long v6, v6

    add-long/2addr v6, p2

    invoke-virtual {p0, v5, v6, v7}, Lv/n;->a(Lv/g;J)J

    move-result-wide v5

    invoke-static {v3, v4, v5, v6}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v3

    :cond_30
    :goto_30
    add-int/lit8 v2, v2, 0x1

    goto :goto_f

    :cond_33
    iget-object v1, v0, Lv/q;->i:Lv/g;

    if-ne p1, v1, :cond_50

    invoke-virtual {v0}, Lv/q;->j()J

    move-result-wide v1

    iget-object p1, v0, Lv/q;->h:Lv/g;

    sub-long/2addr p2, v1

    invoke-virtual {p0, p1, p2, p3}, Lv/n;->a(Lv/g;J)J

    move-result-wide v1

    invoke-static {v3, v4, v1, v2}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v1

    iget-object p1, v0, Lv/q;->h:Lv/g;

    iget p1, p1, Lv/g;->f:I

    int-to-long v3, p1

    sub-long/2addr p2, v3

    invoke-static {v1, v2, p2, p3}, Ljava/lang/Math;->min(JJ)J

    move-result-wide v3

    :cond_50
    return-wide v3
.end method

.method public final b(Lv/g;J)J
    .registers 12

    iget-object v0, p1, Lv/g;->d:Lv/q;

    instance-of v1, v0, Lv/l;

    if-eqz v1, :cond_7

    return-wide p2

    :cond_7
    iget-object v1, p1, Lv/g;->k:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    const/4 v2, 0x0

    move-wide v3, p2

    :goto_f
    if-ge v2, v1, :cond_33

    iget-object v5, p1, Lv/g;->k:Ljava/util/List;

    invoke-interface {v5, v2}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lv/d;

    instance-of v6, v5, Lv/g;

    if-eqz v6, :cond_30

    check-cast v5, Lv/g;

    iget-object v6, v5, Lv/g;->d:Lv/q;

    if-ne v6, v0, :cond_24

    goto :goto_30

    :cond_24
    iget v6, v5, Lv/g;->f:I

    int-to-long v6, v6

    add-long/2addr v6, p2

    invoke-virtual {p0, v5, v6, v7}, Lv/n;->b(Lv/g;J)J

    move-result-wide v5

    invoke-static {v3, v4, v5, v6}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v3

    :cond_30
    :goto_30
    add-int/lit8 v2, v2, 0x1

    goto :goto_f

    :cond_33
    iget-object v1, v0, Lv/q;->h:Lv/g;

    if-ne p1, v1, :cond_50

    invoke-virtual {v0}, Lv/q;->j()J

    move-result-wide v1

    iget-object p1, v0, Lv/q;->i:Lv/g;

    add-long/2addr p2, v1

    invoke-virtual {p0, p1, p2, p3}, Lv/n;->b(Lv/g;J)J

    move-result-wide v1

    invoke-static {v3, v4, v1, v2}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v1

    iget-object p1, v0, Lv/q;->i:Lv/g;

    iget p1, p1, Lv/g;->f:I

    int-to-long v3, p1

    sub-long/2addr p2, v3

    invoke-static {v1, v2, p2, p3}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v3

    :cond_50
    return-wide v3
.end method
