package defpackage;

import java.nio.channels.FileChannel;

/* JADX INFO: renamed from: ᵿᵭᵩ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C5530 extends AbstractC2498 implements InterfaceC0778 {

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public final /* synthetic */ String f20870;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public final /* synthetic */ C2406 f20871;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public final /* synthetic */ C0424 f20872;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public final /* synthetic */ String f20873;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public InterfaceC2047 f20874;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public int f20875;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final /* synthetic */ C1157 f20876;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public final /* synthetic */ InterfaceC1153 f20877;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C5530(C1157 c1157, C2406 c2406, InterfaceC2643 interfaceC2643, C0424 c0424, InterfaceC1153 interfaceC1153, String str, String str2) {
        super(1, interfaceC2643);
        this.f20876 = c1157;
        this.f20871 = c2406;
        this.f20872 = c0424;
        this.f20877 = interfaceC1153;
        this.f20873 = str;
        this.f20870 = str2;
    }

    @Override // defpackage.InterfaceC0778
    /* JADX INFO: renamed from: ʽˈˋ */
    public final Object mo1706(Object obj) {
        String str = this.f20873;
        String str2 = this.f20870;
        return new C5530(this.f20876, this.f20871, (InterfaceC2643) obj, this.f20872, this.f20877, str, str2).mo1078(C5063.f19112);
    }

    /* JADX WARN: Code restructure failed: missing block: B:31:0x0053, code lost:
    
        if (r10 == r8) goto L38;
     */
    /* JADX WARN: Code restructure failed: missing block: B:37:0x0064, code lost:
    
        if (r10 == r8) goto L38;
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r1v0, types: [int] */
    /* JADX WARN: Type inference failed for: r1v12 */
    /* JADX WARN: Type inference failed for: r1v13 */
    /* JADX WARN: Type inference failed for: r1v14 */
    /* JADX WARN: Type inference failed for: r1v15 */
    /* JADX WARN: Type inference failed for: r1v16 */
    /* JADX WARN: Type inference failed for: r1v3, types: [java.lang.AutoCloseable] */
    /* JADX WARN: Type inference failed for: r1v8 */
    /* JADX WARN: Type inference failed for: r1v9, types: [java.lang.Object] */
    /* 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 // defpackage.AbstractC1090
    /* JADX INFO: renamed from: ˊᵙᵾᵲ */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object mo1078(Object obj) {
        FileChannel fileChannel;
        ?? r1;
        FileChannel fileChannel2;
        C0767 c0767 = this.f20876.f4942;
        ?? r12 = this.f20875;
        C2406 c2406 = this.f20871;
        C0424 c0424 = this.f20872;
        try {
            try {
                try {
                    try {
                        if (r12 == 0) {
                            ᵟˌᵫ.ˊˌˊ(obj);
                            if (c0767 != null) {
                                c0767.m2763();
                            }
                            c2406.f9391 = true;
                            if (c0424.f2363) {
                                throw new IllegalStateException("Recursive database initialization detected. Did you try to use the database instance during initialization? Maybe in one of the callbacks?");
                            }
                            InterfaceC2047 interfaceC2047Mo3637 = this.f20877.mo3637(this.f20873);
                            boolean z = c0424.f2366;
                            EnumC0111 enumC0111 = EnumC0111.f1384;
                            if (z) {
                                this.f20874 = interfaceC2047Mo3637;
                                this.f20875 = 2;
                                Object objM1815 = c0424.m1815(interfaceC2047Mo3637, this);
                                r1 = interfaceC2047Mo3637;
                            } else {
                                c0424.f2363 = true;
                                this.f20874 = interfaceC2047Mo3637;
                                this.f20875 = 1;
                                Object objM1809 = C0424.m1809(c0424, interfaceC2047Mo3637, this);
                                r12 = interfaceC2047Mo3637;
                            }
                            return enumC0111;
                        }
                        if (r12 == 1) {
                            InterfaceC2047 interfaceC2047 = this.f20874;
                            ᵟˌᵫ.ˊˌˊ(obj);
                            r12 = interfaceC2047;
                            c0424.f2363 = false;
                            r1 = r12;
                        } else {
                            if (r12 != 2) {
                                ᵕᵩʽᵲ.ᵪᵹᵥᵻ("call to 'resume' before 'invoke' with coroutine");
                                return null;
                            }
                            InterfaceC2047 interfaceC20472 = this.f20874;
                            ᵟˌᵫ.ˊˌˊ(obj);
                            r1 = interfaceC20472;
                        }
                        if (c0767 == null || (fileChannel2 = (FileChannel) c0767.f3432) == null) {
                            return r1;
                        }
                        try {
                            fileChannel2.close();
                            return r1;
                        } finally {
                        }
                    } catch (Throwable th) {
                        if (c0767 != null && (fileChannel = (FileChannel) c0767.f3432) != null) {
                            try {
                                fileChannel.close();
                                c0767.f3432 = null;
                            } finally {
                            }
                        }
                        throw th;
                    }
                } catch (Throwable th2) {
                    if (c2406.f9391) {
                        throw th2;
                    }
                    C4935.m10239(AbstractC3589.m8117("Unable to open database '", this.f20870, "'. Was a proper path / name used in Room's database builder?"), th2);
                    return null;
                }
            } catch (Throwable th3) {
                c0424.f2363 = false;
                throw th3;
            }
        } catch (Throwable th4) {
            r12.close();
            throw th4;
        }
    }
}
