package W;

import d4.C0550i;
import j4.AbstractC0806h;
import java.io.FileInputStream;

/* JADX INFO: loaded from: classes.dex */
public final class Q extends AbstractC0806h implements q4.l {

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public FileInputStream f3078k;

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

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final /* synthetic */ S f3080m;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public Q(S s5, h4.c cVar) {
        super(1, cVar);
        this.f3080m = s5;
    }

    @Override // j4.AbstractC0799a
    public final h4.c create(h4.c cVar) {
        return new Q(this.f3080m, cVar);
    }

    @Override // q4.l
    public final Object invoke(Object obj) {
        return ((Q) create((h4.c) obj)).invokeSuspend(C0550i.f6143a);
    }

    /* JADX WARN: Code restructure failed: missing block: B:21:0x003b, code lost:
    
        if (r10 == r0) goto L34;
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r1v0, types: [int] */
    /* JADX WARN: Type inference failed for: r1v3, types: [java.io.Closeable] */
    /* JADX WARN: Type inference failed for: r1v6, types: [java.io.Closeable] */
    /* JADX WARN: Type inference failed for: r1v8 */
    /* JADX WARN: Type inference failed for: r1v9 */
    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$UnknownArg
    	at jadx.core.dex.instructions.args.ArgType.getObject(ArgType.java:593)
    	at jadx.core.dex.attributes.nodes.ClassTypeVarsAttr.getTypeVarsMapFor(ClassTypeVarsAttr.java:35)
    	at jadx.core.dex.nodes.utils.TypeUtils.replaceClassGenerics(TypeUtils.java:177)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.insertExplicitUseCast(FixTypesVisitor.java:397)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryFieldTypeWithNewCasts(FixTypesVisitor.java:359)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.applyFieldType(FixTypesVisitor.java:309)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:94)
     */
    @Override // j4.AbstractC0799a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public final java.lang.Object invokeSuspend(java.lang.Object r10) throws java.lang.Exception {
        /*
            r9 = this;
            i4.a r0 = i4.EnumC0643a.f6670k
            int r1 = r9.f3079l
            a0.g r2 = a0.g.f3552a
            r3 = 1
            r4 = 2
            W.S r5 = r9.f3080m
            r6 = 0
            if (r1 == 0) goto L29
            if (r1 == r3) goto L21
            if (r1 != r4) goto L19
            java.io.FileInputStream r0 = r9.f3078k
            a.AbstractC0212a.H(r10)     // Catch: java.lang.Throwable -> L17
            goto L64
        L17:
            r10 = move-exception
            goto L70
        L19:
            java.lang.IllegalStateException r10 = new java.lang.IllegalStateException
            java.lang.String r0 = "call to 'resume' before 'invoke' with coroutine"
            r10.<init>(r0)
            throw r10
        L21:
            java.io.FileInputStream r1 = r9.f3078k
            a.AbstractC0212a.H(r10)     // Catch: java.lang.Throwable -> L27
            goto L3e
        L27:
            r10 = move-exception
            goto L42
        L29:
            a.AbstractC0212a.H(r10)
            java.io.FileInputStream r1 = new java.io.FileInputStream     // Catch: java.io.FileNotFoundException -> L48
            java.io.File r10 = r5.f3081a     // Catch: java.io.FileNotFoundException -> L48
            r1.<init>(r10)     // Catch: java.io.FileNotFoundException -> L48
            r9.f3078k = r1     // Catch: java.lang.Throwable -> L27
            r9.f3079l = r3     // Catch: java.lang.Throwable -> L27
            a0.a r10 = r2.a(r1)     // Catch: java.lang.Throwable -> L27
            if (r10 != r0) goto L3e
            goto L61
        L3e:
            com.google.android.gms.internal.measurement.A1.d(r1, r6)     // Catch: java.io.FileNotFoundException -> L48
            return r10
        L42:
            throw r10     // Catch: java.lang.Throwable -> L43
        L43:
            r7 = move-exception
            com.google.android.gms.internal.measurement.A1.d(r1, r10)     // Catch: java.io.FileNotFoundException -> L48
            throw r7     // Catch: java.io.FileNotFoundException -> L48
        L48:
            java.io.File r10 = r5.f3081a
            boolean r10 = r10.exists()
            if (r10 == 0) goto L87
            java.io.FileInputStream r10 = new java.io.FileInputStream     // Catch: java.lang.Exception -> L68
            java.io.File r1 = r5.f3081a     // Catch: java.lang.Exception -> L68
            r10.<init>(r1)     // Catch: java.lang.Exception -> L68
            r9.f3078k = r10     // Catch: java.lang.Throwable -> L6e
            r9.f3079l = r4     // Catch: java.lang.Throwable -> L6e
            a0.a r1 = r2.a(r10)     // Catch: java.lang.Throwable -> L6e
            if (r1 != r0) goto L62
        L61:
            return r0
        L62:
            r0 = r10
            r10 = r1
        L64:
            com.google.android.gms.internal.measurement.A1.d(r0, r6)     // Catch: java.lang.Exception -> L68
            goto L8c
        L68:
            r10 = move-exception
            goto L76
        L6a:
            r8 = r0
            r0 = r10
            r10 = r8
            goto L70
        L6e:
            r0 = move-exception
            goto L6a
        L70:
            throw r10     // Catch: java.lang.Throwable -> L71
        L71:
            r1 = move-exception
            com.google.android.gms.internal.measurement.A1.d(r0, r10)     // Catch: java.lang.Exception -> L68
            throw r1     // Catch: java.lang.Exception -> L68
        L76:
            boolean r0 = r10 instanceof java.io.FileNotFoundException
            if (r0 == 0) goto L86
            java.io.File r0 = r5.f3081a
            java.lang.String r0 = r0.getParent()
            java.io.FileNotFoundException r10 = (java.io.FileNotFoundException) r10
            java.lang.Exception r10 = com.google.android.gms.internal.measurement.C1.D(r0, r10)
        L86:
            throw r10
        L87:
            a0.a r10 = new a0.a
            r10.<init>(r3)
        L8c:
            return r10
        */
        throw new UnsupportedOperationException("Method not decompiled: W.Q.invokeSuspend(java.lang.Object):java.lang.Object");
    }
}
