package j$.util.concurrent;

/* compiled from: r8-map-id-d03341a5c506013191640b89b63ea5cf7ac75763b497b0603d90d740714f0f53 */
/* loaded from: classes2.dex */
public class o {
    public k[] a;
    public k b = null;
    public n c;
    public n d;
    public int e;
    public int f;
    public int g;
    public final int h;

    public o(k[] kVarArr, int i, int i2, int i3) {
        this.a = kVarArr;
        this.h = i;
        this.e = i2;
        this.f = i2;
        this.g = i3;
    }

    /* JADX WARN: Removed duplicated region for block: B:57:0x0097 A[SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:60:0x005f A[SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final j$.util.concurrent.k a() {
        /*
            r6 = this;
            j$.util.concurrent.k r0 = r6.b
            if (r0 == 0) goto L6
            j$.util.concurrent.k r0 = r0.d
        L6:
            if (r0 == 0) goto Lb
            r6.b = r0
            return r0
        Lb:
            int r0 = r6.f
            int r1 = r6.g
            r2 = 0
            if (r0 >= r1) goto La8
            j$.util.concurrent.k[] r0 = r6.a
            if (r0 == 0) goto La8
            int r1 = r0.length
            int r3 = r6.e
            if (r1 <= r3) goto La8
            if (r3 >= 0) goto L1f
            goto La8
        L1f:
            j$.util.concurrent.k r4 = j$.util.concurrent.ConcurrentHashMap.k(r0, r3)
            if (r4 == 0) goto L5a
            int r5 = r4.a
            if (r5 >= 0) goto L5a
            boolean r5 = r4 instanceof j$.util.concurrent.g
            if (r5 == 0) goto L4f
            j$.util.concurrent.g r4 = (j$.util.concurrent.g) r4
            j$.util.concurrent.k[] r4 = r4.e
            r6.a = r4
            j$.util.concurrent.n r4 = r6.d
            if (r4 == 0) goto L3c
            j$.util.concurrent.n r5 = r4.d
            r6.d = r5
            goto L41
        L3c:
            j$.util.concurrent.n r4 = new j$.util.concurrent.n
            r4.<init>()
        L41:
            r4.c = r0
            r4.a = r1
            r4.b = r3
            j$.util.concurrent.n r0 = r6.c
            r4.d = r0
            r6.c = r4
            r0 = r2
            goto L6
        L4f:
            boolean r0 = r4 instanceof j$.util.concurrent.p
            if (r0 == 0) goto L58
            j$.util.concurrent.p r4 = (j$.util.concurrent.p) r4
            j$.util.concurrent.q r0 = r4.f
            goto L5b
        L58:
            r0 = r2
            goto L5b
        L5a:
            r0 = r4
        L5b:
            j$.util.concurrent.n r4 = r6.c
            if (r4 == 0) goto L97
        L5f:
            j$.util.concurrent.n r3 = r6.c
            if (r3 == 0) goto L82
            int r4 = r6.e
            int r5 = r3.a
            int r4 = r4 + r5
            r6.e = r4
            if (r4 < r1) goto L82
            int r1 = r3.b
            r6.e = r1
            j$.util.concurrent.k[] r1 = r3.c
            r6.a = r1
            r3.c = r2
            j$.util.concurrent.n r1 = r3.d
            j$.util.concurrent.n r4 = r6.d
            r3.d = r4
            r6.c = r1
            r6.d = r3
            r1 = r5
            goto L5f
        L82:
            if (r3 != 0) goto L6
            int r2 = r6.e
            int r3 = r6.h
            int r2 = r2 + r3
            r6.e = r2
            if (r2 < r1) goto L6
            int r1 = r6.f
            int r1 = r1 + 1
            r6.f = r1
            r6.e = r1
            goto L6
        L97:
            int r2 = r6.h
            int r3 = r3 + r2
            r6.e = r3
            if (r3 < r1) goto L6
            int r1 = r6.f
            int r1 = r1 + 1
            r6.f = r1
            r6.e = r1
            goto L6
        La8:
            r6.b = r2
            return r2
        */
        throw new UnsupportedOperationException("Method not decompiled: j$.util.concurrent.o.a():j$.util.concurrent.k");
    }
}
