package o;

import android.os.Bundle;
import java.util.EnumMap;
import java.util.Iterator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.qs0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2284qs0 {
    public static final C2284qs0 c = new C2284qs0(100);
    public final EnumMap a;
    public final int b;

    public C2284qs0(int i) {
        EnumMap enumMap = new EnumMap(EnumC2094os0.class);
        this.a = enumMap;
        EnumC2094os0 enumC2094os0 = EnumC2094os0.m;
        EnumC1809ls0 enumC1809ls0 = EnumC1809ls0.m;
        enumMap.put((EnumMap) enumC2094os0, (EnumC2094os0) enumC1809ls0);
        enumMap.put((EnumMap) EnumC2094os0.n, (EnumC2094os0) enumC1809ls0);
        this.b = i;
    }

    public static String a(int i) {
        return i != -30 ? i != -20 ? i != -10 ? i != 0 ? i != 30 ? i != 90 ? i != 100 ? "OTHER" : "UNKNOWN" : "REMOTE_CONFIG" : "1P_INIT" : "1P_API" : "MANIFEST" : "API" : "TCF";
    }

    public static C2284qs0 b(int i, Bundle bundle) {
        if (bundle == null) {
            return new C2284qs0(i);
        }
        EnumMap enumMap = new EnumMap(EnumC2094os0.class);
        for (EnumC2094os0 enumC2094os0 : EnumC1999ns0.STORAGE.l) {
            enumMap.put((EnumMap) enumC2094os0, (EnumC2094os0) d(bundle.getString(enumC2094os0.l)));
        }
        return new C2284qs0(enumMap, i);
    }

    public static C2284qs0 c(int i, String str) {
        EnumMap enumMap = new EnumMap(EnumC2094os0.class);
        EnumC2094os0[] enumC2094os0Arr = EnumC1999ns0.STORAGE.l;
        for (int i2 = 0; i2 < enumC2094os0Arr.length; i2++) {
            String str2 = str == null ? "" : str;
            EnumC2094os0 enumC2094os0 = enumC2094os0Arr[i2];
            int i3 = i2 + 2;
            if (i3 < str2.length()) {
                enumMap.put((EnumMap) enumC2094os0, (EnumC2094os0) e(str2.charAt(i3)));
            } else {
                enumMap.put((EnumMap) enumC2094os0, (EnumC2094os0) EnumC1809ls0.m);
            }
        }
        return new C2284qs0(enumMap, i);
    }

    public static EnumC1809ls0 d(String str) {
        EnumC1809ls0 enumC1809ls0 = EnumC1809ls0.m;
        return str == null ? enumC1809ls0 : str.equals("granted") ? EnumC1809ls0.p : str.equals("denied") ? EnumC1809ls0.f627o : enumC1809ls0;
    }

    public static EnumC1809ls0 e(char c2) {
        return c2 != '+' ? c2 != '0' ? c2 != '1' ? EnumC1809ls0.m : EnumC1809ls0.p : EnumC1809ls0.f627o : EnumC1809ls0.n;
    }

    public static char h(EnumC1809ls0 enumC1809ls0) {
        if (enumC1809ls0 == null) {
            return '-';
        }
        int iOrdinal = enumC1809ls0.ordinal();
        if (iOrdinal == 1) {
            return '+';
        }
        if (iOrdinal != 2) {
            return iOrdinal != 3 ? '-' : '1';
        }
        return '0';
    }

    public static boolean l(int i, int i2) {
        int i3 = -30;
        if (i == -20) {
            if (i2 == -30) {
                return true;
            }
            i = -20;
        }
        if (i != -30) {
            i3 = i;
        } else if (i2 == -20) {
            return true;
        }
        return i3 == i2 || i < i2;
    }

    public final boolean equals(Object obj) {
        if (!(obj instanceof C2284qs0)) {
            return false;
        }
        C2284qs0 c2284qs0 = (C2284qs0) obj;
        for (EnumC2094os0 enumC2094os0 : EnumC1999ns0.STORAGE.l) {
            if (this.a.get(enumC2094os0) != c2284qs0.a.get(enumC2094os0)) {
                return false;
            }
        }
        return this.b == c2284qs0.b;
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x0030  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.String f() {
        /*
            r7 = this;
            java.lang.StringBuilder r0 = new java.lang.StringBuilder
            java.lang.String r1 = "G1"
            r0.<init>(r1)
            o.ns0 r1 = o.EnumC1999ns0.STORAGE
            o.os0[] r1 = r1.l
            int r2 = r1.length
            r3 = 0
        Ld:
            if (r3 >= r2) goto L38
            r4 = r1[r3]
            java.util.EnumMap r5 = r7.a
            java.lang.Object r4 = r5.get(r4)
            o.ls0 r4 = (o.EnumC1809ls0) r4
            r5 = 45
            if (r4 == 0) goto L32
            int r4 = r4.ordinal()
            if (r4 == 0) goto L32
            r6 = 1
            if (r4 == r6) goto L30
            r6 = 2
            if (r4 == r6) goto L2d
            r6 = 3
            if (r4 == r6) goto L30
            goto L32
        L2d:
            r5 = 48
            goto L32
        L30:
            r5 = 49
        L32:
            r0.append(r5)
            int r3 = r3 + 1
            goto Ld
        L38:
            java.lang.String r0 = r0.toString()
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2284qs0.f():java.lang.String");
    }

    public final String g() {
        StringBuilder sb = new StringBuilder("G1");
        for (EnumC2094os0 enumC2094os0 : EnumC1999ns0.STORAGE.l) {
            sb.append(h((EnumC1809ls0) this.a.get(enumC2094os0)));
        }
        return sb.toString();
    }

    public final int hashCode() {
        Iterator it = this.a.values().iterator();
        int iHashCode = this.b * 17;
        while (it.hasNext()) {
            iHashCode = (iHashCode * 31) + ((EnumC1809ls0) it.next()).hashCode();
        }
        return iHashCode;
    }

    public final boolean i(EnumC2094os0 enumC2094os0) {
        return ((EnumC1809ls0) this.a.get(enumC2094os0)) != EnumC1809ls0.f627o;
    }

    /* JADX WARN: Removed duplicated region for block: B:14:0x0031  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final o.C2284qs0 j(o.C2284qs0 r9) {
        /*
            r8 = this;
            java.util.EnumMap r0 = new java.util.EnumMap
            java.lang.Class<o.os0> r1 = o.EnumC2094os0.class
            r0.<init>(r1)
            o.ns0 r1 = o.EnumC1999ns0.STORAGE
            o.os0[] r1 = r1.l
            int r2 = r1.length
            r3 = 0
        Ld:
            if (r3 >= r2) goto L48
            r4 = r1[r3]
            java.util.EnumMap r5 = r8.a
            java.lang.Object r5 = r5.get(r4)
            o.ls0 r5 = (o.EnumC1809ls0) r5
            java.util.EnumMap r6 = r9.a
            java.lang.Object r6 = r6.get(r4)
            o.ls0 r6 = (o.EnumC1809ls0) r6
            if (r5 != 0) goto L24
            goto L31
        L24:
            if (r6 == 0) goto L40
            o.ls0 r7 = o.EnumC1809ls0.m
            if (r5 != r7) goto L2b
            goto L31
        L2b:
            if (r6 == r7) goto L40
            o.ls0 r7 = o.EnumC1809ls0.n
            if (r5 != r7) goto L33
        L31:
            r5 = r6
            goto L40
        L33:
            if (r6 == r7) goto L40
            o.ls0 r7 = o.EnumC1809ls0.f627o
            if (r5 == r7) goto L3f
            if (r6 != r7) goto L3c
            goto L3f
        L3c:
            o.ls0 r5 = o.EnumC1809ls0.p
            goto L40
        L3f:
            r5 = r7
        L40:
            if (r5 == 0) goto L45
            r0.put(r4, r5)
        L45:
            int r3 = r3 + 1
            goto Ld
        L48:
            o.qs0 r9 = new o.qs0
            r1 = 100
            r9.<init>(r0, r1)
            return r9
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2284qs0.j(o.qs0):o.qs0");
    }

    public final C2284qs0 k(C2284qs0 c2284qs0) {
        EnumMap enumMap = new EnumMap(EnumC2094os0.class);
        for (EnumC2094os0 enumC2094os0 : EnumC1999ns0.STORAGE.l) {
            EnumC1809ls0 enumC1809ls0 = (EnumC1809ls0) this.a.get(enumC2094os0);
            if (enumC1809ls0 == EnumC1809ls0.m) {
                enumC1809ls0 = (EnumC1809ls0) c2284qs0.a.get(enumC2094os0);
            }
            if (enumC1809ls0 != null) {
                enumMap.put((EnumMap) enumC2094os0, (EnumC2094os0) enumC1809ls0);
            }
        }
        return new C2284qs0(enumMap, this.b);
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder("source=");
        sb.append(a(this.b));
        for (EnumC2094os0 enumC2094os0 : EnumC1999ns0.STORAGE.l) {
            sb.append(",");
            sb.append(enumC2094os0.l);
            sb.append("=");
            EnumC1809ls0 enumC1809ls0 = (EnumC1809ls0) this.a.get(enumC2094os0);
            if (enumC1809ls0 == null) {
                enumC1809ls0 = EnumC1809ls0.m;
            }
            sb.append(enumC1809ls0);
        }
        return sb.toString();
    }

    public C2284qs0(EnumMap enumMap, int i) {
        EnumMap enumMap2 = new EnumMap(EnumC2094os0.class);
        this.a = enumMap2;
        enumMap2.putAll(enumMap);
        this.b = i;
    }
}
