package o;

import java.io.File;
import java.util.concurrent.atomic.AtomicBoolean;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.gy, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1343gy implements InterfaceC1978ni {
    public final File a;
    public final R60 b;
    public final InterfaceC1754lI c;
    public final U4 d;
    public final AtomicBoolean e = new AtomicBoolean(false);
    public final C2427sR f = C1884mi0.d();

    public C1343gy(File file, R60 r60, InterfaceC1754lI interfaceC1754lI, U4 u4) {
        this.a = file;
        this.b = r60;
        this.c = interfaceC1754lI;
        this.d = u4;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:31:0x0071  */
    /* JADX WARN: Removed duplicated region for block: B:34:0x0079 A[Catch: all -> 0x007a, TRY_ENTER, TRY_LEAVE, TryCatch #2 {all -> 0x007a, blocks: (B:34:0x0079, B:43:0x0089, B:42:0x0086, B:39:0x0081), top: B:55:0x001e, inners: #0 }] */
    /* JADX WARN: Removed duplicated region for block: B:47:0x0091  */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /* JADX WARN: Type inference failed for: r0v12 */
    /* JADX WARN: Type inference failed for: r0v14, types: [o.gy] */
    /* JADX WARN: Type inference failed for: r0v17 */
    /* JADX WARN: Type inference failed for: r0v18 */
    /* JADX WARN: Type inference failed for: r0v2, types: [java.lang.Object, o.ey] */
    /* JADX WARN: Type inference failed for: r0v3 */
    /* JADX WARN: Type inference failed for: r0v4, types: [o.gy] */
    /* JADX WARN: Type inference failed for: r0v6 */
    /* JADX WARN: Type inference failed for: r0v8 */
    /* JADX WARN: Type inference failed for: r7v0, types: [o.op] */
    /* JADX WARN: Type inference failed for: r7v1 */
    /* JADX WARN: Type inference failed for: r7v11 */
    /* JADX WARN: Type inference failed for: r7v15, types: [boolean] */
    /* JADX WARN: Type inference failed for: r7v2 */
    /* JADX WARN: Type inference failed for: r7v6 */
    /* JADX WARN: Type inference failed for: r7v8 */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object a(o.C2087op r7, o.AbstractC0298Lm r8) throws java.lang.Throwable {
        /*
            r6 = this;
            boolean r0 = r8 instanceof o.C1151ey
            if (r0 == 0) goto L13
            r0 = r8
            o.ey r0 = (o.C1151ey) r0
            int r1 = r0.t
            r2 = -2147483648(0xffffffff80000000, float:-0.0)
            r3 = r1 & r2
            if (r3 == 0) goto L13
            int r1 = r1 - r2
            r0.t = r1
            goto L18
        L13:
            o.ey r0 = new o.ey
            r0.<init>(r6, r8)
        L18:
            java.lang.Object r8 = r0.r
            int r1 = r0.t
            r2 = 1
            r3 = 0
            if (r1 == 0) goto L36
            if (r1 != r2) goto L2e
            boolean r7 = r0.q
            o.cy r1 = r0.p
            o.gy r0 = r0.f518o
            o.IJ.H(r8)     // Catch: java.lang.Throwable -> L2c
            goto L69
        L2c:
            r8 = move-exception
            goto L81
        L2e:
            java.lang.IllegalStateException r7 = new java.lang.IllegalStateException
            java.lang.String r8 = "call to 'resume' before 'invoke' with coroutine"
            r7.<init>(r8)
            throw r7
        L36:
            o.IJ.H(r8)
            java.util.concurrent.atomic.AtomicBoolean r8 = r6.e
            boolean r8 = r8.get()
            if (r8 != 0) goto L97
            o.sR r8 = r6.f
            boolean r8 = r8.e()
            o.cy r1 = new o.cy     // Catch: java.lang.Throwable -> L8a
            java.io.File r4 = r6.a     // Catch: java.lang.Throwable -> L8a
            o.R60 r5 = r6.b     // Catch: java.lang.Throwable -> L8a
            r1.<init>(r4, r5)     // Catch: java.lang.Throwable -> L8a
            java.lang.Boolean r4 = java.lang.Boolean.valueOf(r8)     // Catch: java.lang.Throwable -> L7c
            r0.f518o = r6     // Catch: java.lang.Throwable -> L7c
            r0.p = r1     // Catch: java.lang.Throwable -> L7c
            r0.q = r8     // Catch: java.lang.Throwable -> L7c
            r0.t = r2     // Catch: java.lang.Throwable -> L7c
            java.lang.Object r7 = r7.d(r1, r4, r0)     // Catch: java.lang.Throwable -> L7c
            o.Dn r0 = o.EnumC0091Dn.l
            if (r7 != r0) goto L65
            return r0
        L65:
            r0 = r8
            r8 = r7
            r7 = r0
            r0 = r6
        L69:
            r1.close()     // Catch: java.lang.Throwable -> L6e
            r1 = r3
            goto L6f
        L6e:
            r1 = move-exception
        L6f:
            if (r1 != 0) goto L79
            if (r7 == 0) goto L78
            o.sR r7 = r0.f
            r7.f(r3)
        L78:
            return r8
        L79:
            throw r1     // Catch: java.lang.Throwable -> L7a
        L7a:
            r8 = move-exception
            goto L8f
        L7c:
            r7 = move-exception
            r0 = r8
            r8 = r7
            r7 = r0
            r0 = r6
        L81:
            r1.close()     // Catch: java.lang.Throwable -> L85
            goto L89
        L85:
            r1 = move-exception
            o.C80.i(r8, r1)     // Catch: java.lang.Throwable -> L7a
        L89:
            throw r8     // Catch: java.lang.Throwable -> L7a
        L8a:
            r7 = move-exception
            r0 = r8
            r8 = r7
            r7 = r0
            r0 = r6
        L8f:
            if (r7 == 0) goto L96
            o.sR r7 = r0.f
            r7.f(r3)
        L96:
            throw r8
        L97:
            java.lang.IllegalStateException r7 = new java.lang.IllegalStateException
            java.lang.String r8 = "StorageConnection has already been disposed."
            r7.<init>(r8)
            throw r7
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C1343gy.a(o.op, o.Lm):java.lang.Object");
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:43:0x00db A[Catch: all -> 0x0116, IOException -> 0x0119, TRY_ENTER, TryCatch #8 {IOException -> 0x0119, all -> 0x0116, blocks: (B:43:0x00db, B:45:0x00e1, B:47:0x00e9, B:51:0x00f5, B:52:0x0115, B:48:0x00ee, B:59:0x0124, B:66:0x0131, B:65:0x012e), top: B:78:0x0023 }] */
    /* JADX WARN: Removed duplicated region for block: B:59:0x0124 A[Catch: all -> 0x0116, IOException -> 0x0119, TRY_ENTER, TRY_LEAVE, TryCatch #8 {IOException -> 0x0119, all -> 0x0116, blocks: (B:43:0x00db, B:45:0x00e1, B:47:0x00e9, B:51:0x00f5, B:52:0x0115, B:48:0x00ee, B:59:0x0124, B:66:0x0131, B:65:0x012e), top: B:78:0x0023 }] */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0015  */
    /* JADX WARN: Type inference failed for: r10v28, types: [o.qR] */
    /* JADX WARN: Type inference failed for: r2v0, types: [int] */
    /* JADX WARN: Type inference failed for: r2v1, types: [java.io.File] */
    /* JADX WARN: Type inference failed for: r2v6, types: [java.io.File, java.lang.Object] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object b(o.C0015Ap r10, o.AbstractC0298Lm r11) {
        /*
            Method dump skipped, instructions count: 333
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C1343gy.b(o.Ap, o.Lm):java.lang.Object");
    }

    @Override // o.InterfaceC1978ni
    public final void close() {
        this.e.set(true);
        this.d.a();
    }
}
