package lo;

import bo.b0;
import com.google.firebase.messaging.Constants;
import java.security.AccessControlException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import ko.t;
import lo.a;
import ro.f;
import tn.z0;

/* loaded from: classes3.dex */
public class b implements t.c {

    /* renamed from: j, reason: collision with root package name */
    private static boolean f28471j;

    /* renamed from: k, reason: collision with root package name */
    private static final Map f28472k;

    /* renamed from: a, reason: collision with root package name */
    private int[] f28473a = null;

    /* renamed from: b, reason: collision with root package name */
    private String f28474b = null;

    /* renamed from: c, reason: collision with root package name */
    private int f28475c = 0;

    /* renamed from: d, reason: collision with root package name */
    private String f28476d = null;

    /* renamed from: e, reason: collision with root package name */
    private String[] f28477e = null;

    /* renamed from: f, reason: collision with root package name */
    private String[] f28478f = null;

    /* renamed from: g, reason: collision with root package name */
    private String[] f28479g = null;

    /* renamed from: h, reason: collision with root package name */
    private a.EnumC0634a f28480h = null;

    /* renamed from: i, reason: collision with root package name */
    private String[] f28481i = null;

    /* renamed from: lo.b$b, reason: collision with other inner class name */
    /* loaded from: classes3.dex */
    private static abstract class AbstractC0636b implements t.b {

        /* renamed from: a, reason: collision with root package name */
        private final List f28482a = new ArrayList();

        private static /* synthetic */ void f(int i10) {
            Object[] objArr = new Object[3];
            if (i10 == 1) {
                objArr[0] = "enumEntryName";
            } else if (i10 == 2) {
                objArr[0] = "classLiteralValue";
            } else if (i10 != 3) {
                objArr[0] = "enumClassId";
            } else {
                objArr[0] = "classId";
            }
            objArr[1] = "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor$CollectStringArrayAnnotationVisitor";
            if (i10 == 2) {
                objArr[2] = "visitClassLiteral";
            } else if (i10 != 3) {
                objArr[2] = "visitEnum";
            } else {
                objArr[2] = "visitAnnotation";
            }
            throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", objArr));
        }

        @Override // ko.t.b
        public void a() {
            g((String[]) this.f28482a.toArray(new String[0]));
        }

        @Override // ko.t.b
        public void b(ro.b bVar, f fVar) {
            if (bVar == null) {
                f(0);
            }
            if (fVar == null) {
                f(1);
            }
        }

        @Override // ko.t.b
        public void c(vo.f fVar) {
            if (fVar == null) {
                f(2);
            }
        }

        @Override // ko.t.b
        public void d(Object obj) {
            if (obj instanceof String) {
                this.f28482a.add((String) obj);
            }
        }

        @Override // ko.t.b
        public t.a e(ro.b bVar) {
            if (bVar != null) {
                return null;
            }
            f(3);
            return null;
        }

        protected abstract void g(String[] strArr);
    }

    /* loaded from: classes3.dex */
    private class c implements t.a {

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes3.dex */
        public class a extends AbstractC0636b {
            a() {
            }

            private static /* synthetic */ void f(int i10) {
                throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", "result", "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor$KotlinMetadataArgumentVisitor$1", "visitEnd"));
            }

            @Override // lo.b.AbstractC0636b
            protected void g(String[] strArr) {
                if (strArr == null) {
                    f(0);
                }
                b.this.f28477e = strArr;
            }
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        /* renamed from: lo.b$c$b, reason: collision with other inner class name */
        /* loaded from: classes3.dex */
        public class C0637b extends AbstractC0636b {
            C0637b() {
            }

            private static /* synthetic */ void f(int i10) {
                throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", "result", "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor$KotlinMetadataArgumentVisitor$2", "visitEnd"));
            }

            @Override // lo.b.AbstractC0636b
            protected void g(String[] strArr) {
                if (strArr == null) {
                    f(0);
                }
                b.this.f28478f = strArr;
            }
        }

        private c() {
        }

        private static /* synthetic */ void g(int i10) {
            Object[] objArr = new Object[3];
            if (i10 == 1) {
                objArr[0] = "enumClassId";
            } else if (i10 == 2) {
                objArr[0] = "enumEntryName";
            } else if (i10 != 3) {
                objArr[0] = "classLiteralValue";
            } else {
                objArr[0] = "classId";
            }
            objArr[1] = "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor$KotlinMetadataArgumentVisitor";
            if (i10 == 1 || i10 == 2) {
                objArr[2] = "visitEnum";
            } else if (i10 != 3) {
                objArr[2] = "visitClassLiteral";
            } else {
                objArr[2] = "visitAnnotation";
            }
            throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", objArr));
        }

        private t.b h() {
            return new a();
        }

        private t.b i() {
            return new C0637b();
        }

        @Override // ko.t.a
        public void a() {
        }

        @Override // ko.t.a
        public void b(f fVar, vo.f fVar2) {
            if (fVar2 == null) {
                g(0);
            }
        }

        @Override // ko.t.a
        public void c(f fVar, ro.b bVar, f fVar2) {
            if (bVar == null) {
                g(1);
            }
            if (fVar2 == null) {
                g(2);
            }
        }

        @Override // ko.t.a
        public t.b d(f fVar) {
            String e10 = fVar != null ? fVar.e() : null;
            if ("d1".equals(e10)) {
                return h();
            }
            if ("d2".equals(e10)) {
                return i();
            }
            return null;
        }

        @Override // ko.t.a
        public t.a e(f fVar, ro.b bVar) {
            if (bVar != null) {
                return null;
            }
            g(3);
            return null;
        }

        @Override // ko.t.a
        public void f(f fVar, Object obj) {
            if (fVar == null) {
                return;
            }
            String e10 = fVar.e();
            if ("k".equals(e10)) {
                if (obj instanceof Integer) {
                    b.this.f28480h = a.EnumC0634a.getById(((Integer) obj).intValue());
                    return;
                }
                return;
            }
            if ("mv".equals(e10)) {
                if (obj instanceof int[]) {
                    b.this.f28473a = (int[]) obj;
                    return;
                }
                return;
            }
            if ("xs".equals(e10)) {
                if (obj instanceof String) {
                    String str = (String) obj;
                    if (str.isEmpty()) {
                        return;
                    }
                    b.this.f28474b = str;
                    return;
                }
                return;
            }
            if ("xi".equals(e10)) {
                if (obj instanceof Integer) {
                    b.this.f28475c = ((Integer) obj).intValue();
                    return;
                }
                return;
            }
            if ("pn".equals(e10) && (obj instanceof String)) {
                String str2 = (String) obj;
                if (str2.isEmpty()) {
                    return;
                }
                b.this.f28476d = str2;
            }
        }
    }

    /* loaded from: classes3.dex */
    private class d implements t.a {

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes3.dex */
        public class a extends AbstractC0636b {
            a() {
            }

            private static /* synthetic */ void f(int i10) {
                throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", "result", "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor$KotlinSerializedIrArgumentVisitor$1", "visitEnd"));
            }

            @Override // lo.b.AbstractC0636b
            protected void g(String[] strArr) {
                if (strArr == null) {
                    f(0);
                }
                b.this.f28481i = strArr;
            }
        }

        private d() {
        }

        private static /* synthetic */ void g(int i10) {
            Object[] objArr = new Object[3];
            if (i10 == 1) {
                objArr[0] = "enumClassId";
            } else if (i10 == 2) {
                objArr[0] = "enumEntryName";
            } else if (i10 != 3) {
                objArr[0] = "classLiteralValue";
            } else {
                objArr[0] = "classId";
            }
            objArr[1] = "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor$KotlinSerializedIrArgumentVisitor";
            if (i10 == 1 || i10 == 2) {
                objArr[2] = "visitEnum";
            } else if (i10 != 3) {
                objArr[2] = "visitClassLiteral";
            } else {
                objArr[2] = "visitAnnotation";
            }
            throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", objArr));
        }

        private t.b h() {
            return new a();
        }

        @Override // ko.t.a
        public void a() {
        }

        @Override // ko.t.a
        public void b(f fVar, vo.f fVar2) {
            if (fVar2 == null) {
                g(0);
            }
        }

        @Override // ko.t.a
        public void c(f fVar, ro.b bVar, f fVar2) {
            if (bVar == null) {
                g(1);
            }
            if (fVar2 == null) {
                g(2);
            }
        }

        @Override // ko.t.a
        public t.b d(f fVar) {
            if ("b".equals(fVar != null ? fVar.e() : null)) {
                return h();
            }
            return null;
        }

        @Override // ko.t.a
        public t.a e(f fVar, ro.b bVar) {
            if (bVar != null) {
                return null;
            }
            g(3);
            return null;
        }

        @Override // ko.t.a
        public void f(f fVar, Object obj) {
        }
    }

    /* loaded from: classes3.dex */
    private class e implements t.a {

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes3.dex */
        public class a extends AbstractC0636b {
            a() {
            }

            private static /* synthetic */ void f(int i10) {
                throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", Constants.ScionAnalytics.MessageType.DATA_MESSAGE, "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor$OldDeprecatedAnnotationArgumentVisitor$1", "visitEnd"));
            }

            @Override // lo.b.AbstractC0636b
            protected void g(String[] strArr) {
                if (strArr == null) {
                    f(0);
                }
                b.this.f28477e = strArr;
            }
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        /* renamed from: lo.b$e$b, reason: collision with other inner class name */
        /* loaded from: classes3.dex */
        public class C0638b extends AbstractC0636b {
            C0638b() {
            }

            private static /* synthetic */ void f(int i10) {
                throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", Constants.ScionAnalytics.MessageType.DATA_MESSAGE, "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor$OldDeprecatedAnnotationArgumentVisitor$2", "visitEnd"));
            }

            @Override // lo.b.AbstractC0636b
            protected void g(String[] strArr) {
                if (strArr == null) {
                    f(0);
                }
                b.this.f28478f = strArr;
            }
        }

        private e() {
        }

        private static /* synthetic */ void g(int i10) {
            Object[] objArr = new Object[3];
            if (i10 == 1) {
                objArr[0] = "enumClassId";
            } else if (i10 == 2) {
                objArr[0] = "enumEntryName";
            } else if (i10 != 3) {
                objArr[0] = "classLiteralValue";
            } else {
                objArr[0] = "classId";
            }
            objArr[1] = "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor$OldDeprecatedAnnotationArgumentVisitor";
            if (i10 == 1 || i10 == 2) {
                objArr[2] = "visitEnum";
            } else if (i10 != 3) {
                objArr[2] = "visitClassLiteral";
            } else {
                objArr[2] = "visitAnnotation";
            }
            throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", objArr));
        }

        private t.b h() {
            return new a();
        }

        private t.b i() {
            return new C0638b();
        }

        @Override // ko.t.a
        public void a() {
        }

        @Override // ko.t.a
        public void b(f fVar, vo.f fVar2) {
            if (fVar2 == null) {
                g(0);
            }
        }

        @Override // ko.t.a
        public void c(f fVar, ro.b bVar, f fVar2) {
            if (bVar == null) {
                g(1);
            }
            if (fVar2 == null) {
                g(2);
            }
        }

        @Override // ko.t.a
        public t.b d(f fVar) {
            String e10 = fVar != null ? fVar.e() : null;
            if (Constants.ScionAnalytics.MessageType.DATA_MESSAGE.equals(e10) || "filePartClassNames".equals(e10)) {
                return h();
            }
            if ("strings".equals(e10)) {
                return i();
            }
            return null;
        }

        @Override // ko.t.a
        public t.a e(f fVar, ro.b bVar) {
            if (bVar != null) {
                return null;
            }
            g(3);
            return null;
        }

        @Override // ko.t.a
        public void f(f fVar, Object obj) {
            if (fVar == null) {
                return;
            }
            String e10 = fVar.e();
            if ("version".equals(e10)) {
                if (obj instanceof int[]) {
                    b.this.f28473a = (int[]) obj;
                }
            } else if ("multifileClassName".equals(e10)) {
                b.this.f28474b = obj instanceof String ? (String) obj : null;
            }
        }
    }

    static {
        try {
            f28471j = "true".equals(System.getProperty("kotlin.ignore.old.metadata"));
        } catch (AccessControlException unused) {
            f28471j = false;
        }
        HashMap hashMap = new HashMap();
        f28472k = hashMap;
        hashMap.put(ro.b.m(new ro.c("kotlin.jvm.internal.KotlinClass")), a.EnumC0634a.CLASS);
        hashMap.put(ro.b.m(new ro.c("kotlin.jvm.internal.KotlinFileFacade")), a.EnumC0634a.FILE_FACADE);
        hashMap.put(ro.b.m(new ro.c("kotlin.jvm.internal.KotlinMultifileClass")), a.EnumC0634a.MULTIFILE_CLASS);
        hashMap.put(ro.b.m(new ro.c("kotlin.jvm.internal.KotlinMultifileClassPart")), a.EnumC0634a.MULTIFILE_CLASS_PART);
        hashMap.put(ro.b.m(new ro.c("kotlin.jvm.internal.KotlinSyntheticClass")), a.EnumC0634a.SYNTHETIC_CLASS);
    }

    private static /* synthetic */ void d(int i10) {
        Object[] objArr = new Object[3];
        if (i10 != 1) {
            objArr[0] = "classId";
        } else {
            objArr[0] = "source";
        }
        objArr[1] = "kotlin/reflect/jvm/internal/impl/load/kotlin/header/ReadKotlinClassHeaderAnnotationVisitor";
        objArr[2] = "visitAnnotation";
        throw new IllegalArgumentException(String.format("Argument for @NotNull parameter '%s' of %s.%s must not be null", objArr));
    }

    private boolean o() {
        a.EnumC0634a enumC0634a = this.f28480h;
        return enumC0634a == a.EnumC0634a.CLASS || enumC0634a == a.EnumC0634a.FILE_FACADE || enumC0634a == a.EnumC0634a.MULTIFILE_CLASS_PART;
    }

    @Override // ko.t.c
    public void a() {
    }

    @Override // ko.t.c
    public t.a b(ro.b bVar, z0 z0Var) {
        a.EnumC0634a enumC0634a;
        if (bVar == null) {
            d(0);
        }
        if (z0Var == null) {
            d(1);
        }
        ro.c b10 = bVar.b();
        if (b10.equals(b0.f7055a)) {
            return new c();
        }
        if (b10.equals(b0.f7074t)) {
            return new d();
        }
        if (f28471j || this.f28480h != null || (enumC0634a = (a.EnumC0634a) f28472k.get(bVar)) == null) {
            return null;
        }
        this.f28480h = enumC0634a;
        return new e();
    }

    public lo.a m(qo.e eVar) {
        if (this.f28480h == null || this.f28473a == null) {
            return null;
        }
        qo.e eVar2 = new qo.e(this.f28473a, (this.f28475c & 8) != 0);
        if (!eVar2.h(eVar)) {
            this.f28479g = this.f28477e;
            this.f28477e = null;
        } else if (o() && this.f28477e == null) {
            return null;
        }
        String[] strArr = this.f28481i;
        return new lo.a(this.f28480h, eVar2, this.f28477e, this.f28479g, this.f28478f, this.f28474b, this.f28475c, this.f28476d, strArr != null ? qo.a.e(strArr) : null);
    }

    public lo.a n() {
        return m(qo.e.f34059i);
    }
}
