package T1;

import O1.A;
import O1.C0234j;
import O1.G;
import O1.H;
import O6.p;
import Q1.t;
import com.google.android.gms.internal.measurement.C1;

/* JADX INFO: loaded from: classes.dex */
public final class j extends G6.i implements p {

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public final /* synthetic */ O6.l f6520A;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public G f6521u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public int f6522v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public /* synthetic */ Object f6523w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public final /* synthetic */ boolean f6524x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public final /* synthetic */ boolean f6525y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public final /* synthetic */ A f6526z;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public j(E6.d dVar, A a3, O6.l lVar, boolean z8, boolean z9) {
        super(2, dVar);
        this.f6524x = z8;
        this.f6525y = z9;
        this.f6526z = a3;
        this.f6520A = lVar;
    }

    @Override // O6.p
    public final Object k(Object obj, Object obj2) {
        return ((j) m((E6.d) obj2, (H) obj)).p(A6.n.f457a);
    }

    @Override // G6.a
    public final E6.d m(E6.d dVar, Object obj) {
        j jVar = new j(dVar, this.f6526z, this.f6520A, this.f6524x, this.f6525y);
        jVar.f6523w = obj;
        return jVar;
    }

    /* JADX WARN: Removed duplicated region for block: B:36:0x009e A[PHI: r1 r11
      0x009e: PHI (r1v11 O1.H) = (r1v8 O1.H), (r1v16 O1.H) binds: [B:34:0x009b, B:11:0x0027] A[DONT_GENERATE, DONT_INLINE]
      0x009e: PHI (r11v17 java.lang.Object) = (r11v15 java.lang.Object), (r11v0 java.lang.Object) binds: [B:34:0x009b, B:11:0x0027] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:37:0x00a0  */
    /* JADX WARN: Removed duplicated region for block: B:43:0x00b5  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x00bd A[RETURN] */
    @Override // G6.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object p(Object obj) throws Throwable {
        G g8;
        H h8;
        G g9;
        H h9;
        H h10;
        Object obj2;
        F6.a aVar = F6.a.f2580q;
        int i = this.f6522v;
        O6.l lVar = this.f6520A;
        A a3 = this.f6526z;
        boolean z8 = this.f6525y;
        if (i == 0) {
            C1.N(obj);
            H h11 = (H) this.f6523w;
            if (!this.f6524x) {
                P6.g.c(h11, "null cannot be cast to non-null type androidx.room.coroutines.RawConnectionAccessor");
                return lVar.b(((t) h11).c());
            }
            g8 = z8 ? G.f4943q : G.f4944r;
            if (!z8) {
                this.f6523w = h11;
                this.f6521u = g8;
                this.f6522v = 1;
                Object objB = h11.b(this);
                if (objB != aVar) {
                    h9 = h11;
                    obj = objB;
                }
                return aVar;
            }
            G g10 = g8;
            h8 = h11;
            g9 = g10;
            i iVar = new i(null, lVar);
            this.f6523w = h8;
            this.f6521u = null;
            this.f6522v = 3;
            obj = h8.d(g9, iVar, this);
            if (obj != aVar) {
            }
            return aVar;
        }
        if (i != 1) {
            if (i == 2) {
                g8 = this.f6521u;
                h10 = (H) this.f6523w;
                C1.N(obj);
                g9 = g8;
                h8 = h10;
                i iVar2 = new i(null, lVar);
                this.f6523w = h8;
                this.f6521u = null;
                this.f6522v = 3;
                obj = h8.d(g9, iVar2, this);
                if (obj != aVar) {
                    if (!z8) {
                    }
                }
                return aVar;
            }
            if (i != 3) {
                if (i != 4) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                obj2 = this.f6523w;
                C1.N(obj);
                if (!((Boolean) obj).booleanValue()) {
                    a3.d().a();
                }
                return obj2;
            }
            h8 = (H) this.f6523w;
            C1.N(obj);
            if (!z8) {
                return obj;
            }
            this.f6523w = obj;
            this.f6522v = 4;
            Object objB2 = h8.b(this);
            if (objB2 != aVar) {
                obj2 = obj;
                obj = objB2;
                if (!((Boolean) obj).booleanValue()) {
                }
                return obj2;
            }
            return aVar;
        }
        g8 = this.f6521u;
        h9 = (H) this.f6523w;
        C1.N(obj);
        if (((Boolean) obj).booleanValue()) {
            g9 = g8;
            h8 = h9;
            i iVar22 = new i(null, lVar);
            this.f6523w = h8;
            this.f6521u = null;
            this.f6522v = 3;
            obj = h8.d(g9, iVar22, this);
            if (obj != aVar) {
            }
            return aVar;
        }
        C0234j c0234jD = a3.d();
        this.f6523w = h9;
        this.f6521u = g8;
        this.f6522v = 2;
        if (c0234jD.b(this) != aVar) {
            h10 = h9;
            g9 = g8;
            h8 = h10;
            i iVar222 = new i(null, lVar);
            this.f6523w = h8;
            this.f6521u = null;
            this.f6522v = 3;
            obj = h8.d(g9, iVar222, this);
            if (obj != aVar) {
            }
        }
        return aVar;
    }
}
