package q5;

import a5.C0405d;
import android.content.SharedPreferences;
import com.google.android.gms.internal.measurement.C1;
import f5.C0939P;

/* JADX INFO: renamed from: q5.d, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1467d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final C0939P f16276a;

    public C1467d(C0939P c0939p) {
        P6.g.e(c0939p, "userRepository");
        this.f16276a = c0939p;
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object a(G6.c cVar) {
        C1466c c1466c;
        Object objJ;
        if (cVar instanceof C1466c) {
            c1466c = (C1466c) cVar;
            int i = c1466c.f16275v;
            if ((i & Integer.MIN_VALUE) != 0) {
                c1466c.f16275v = i - Integer.MIN_VALUE;
            } else {
                c1466c = new C1466c(this, cVar);
            }
        }
        Object bVar = c1466c.f16273t;
        Object obj = F6.a.f2580q;
        int i5 = c1466c.f16275v;
        if (i5 == 0) {
            C1.N(bVar);
            c1466c.f16275v = 1;
            C0939P c0939p = this.f16276a;
            c0939p.getClass();
            Object objValueOf = Boolean.TRUE;
            P6.d dVarA = P6.n.a(Boolean.class);
            boolean zEquals = dVarA.equals(P6.n.a(Float.TYPE));
            C0405d c0405d = c0939p.f12759b;
            SharedPreferences sharedPreferences = c0405d.f7619a;
            if (zEquals) {
                objValueOf = (Boolean) new Float(sharedPreferences.getFloat("FIRST_RUN", ((Float) objValueOf).floatValue()));
            } else if (dVarA.equals(P6.n.a(Integer.TYPE))) {
                objValueOf = (Boolean) new Integer(sharedPreferences.getInt("FIRST_RUN", ((Integer) objValueOf).intValue()));
            } else if (dVarA.equals(P6.n.a(Long.TYPE))) {
                objValueOf = (Boolean) new Long(sharedPreferences.getLong("FIRST_RUN", ((Long) objValueOf).longValue()));
            } else if (dVarA.equals(P6.n.a(String.class))) {
                Object string = sharedPreferences.getString("FIRST_RUN", (String) objValueOf);
                if (string == null) {
                    throw new NullPointerException("null cannot be cast to non-null type kotlin.Boolean");
                }
                objValueOf = (Boolean) string;
            } else if (dVarA.equals(P6.n.a(Boolean.TYPE))) {
                objValueOf = Boolean.valueOf(sharedPreferences.getBoolean("FIRST_RUN", true));
            } else {
                String string2 = sharedPreferences.getString("FIRST_RUN", "");
                if (string2 != null && string2.length() != 0) {
                    try {
                        objJ = c0405d.f7620b.a(Boolean.class).a(string2);
                    } catch (Throwable th) {
                        objJ = C1.j(th);
                    }
                    if (objJ instanceof A6.i) {
                        objJ = null;
                    }
                    if (objJ != null) {
                        objValueOf = objJ;
                    }
                }
            }
            SharedPreferences.Editor editorEdit = sharedPreferences.edit();
            editorEdit.putBoolean("FIRST_RUN", false);
            editorEdit.apply();
            bVar = new X4.b((Boolean) objValueOf);
            if (bVar == obj) {
                return obj;
            }
        } else {
            if (i5 != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            C1.N(bVar);
        }
        X4.c cVar2 = (X4.c) bVar;
        if (cVar2 instanceof X4.b) {
            return ((X4.b) cVar2).f7228a;
        }
        if (cVar2 instanceof X4.a) {
            return C1.j(((X4.a) cVar2).f7227a);
        }
        throw new A6.b();
    }
}
