package F7;

import a.AbstractC0386a;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.WildcardType;
import java.net.URI;
import java.util.Map;
import java.util.regex.Pattern;
import k7.InterfaceC1112d;

/* JADX INFO: renamed from: F7.t, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC0135t {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final InterfaceC1112d f2723b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final InterfaceC0130n f2724c;

    public AbstractC0135t(S s8, InterfaceC1112d interfaceC1112d, InterfaceC0130n interfaceC0130n) {
        this.f2722a = s8;
        this.f2723b = interfaceC1112d;
        this.f2724c = interfaceC0130n;
    }

    /* JADX WARN: Code restructure failed: missing block: B:121:0x0208, code lost:
    
        throw F7.b0.o(r10, r8, "@Url must be okhttp3.HttpUrl, String, java.net.URI, or android.net.Uri type.", new java.lang.Object[0]);
     */
    /* JADX WARN: Code restructure failed: missing block: B:373:0x08c3, code lost:
    
        throw F7.b0.o(r10, r8, "@Body parameters cannot be used with form or multi-part encoding.", new java.lang.Object[0]);
     */
    /* JADX WARN: Code restructure failed: missing block: B:53:0x0113, code lost:
    
        r0 = new java.lang.Object[r17];
        r0[0] = r12;
     */
    /* JADX WARN: Code restructure failed: missing block: B:54:0x0120, code lost:
    
        throw F7.b0.n(r10, null, "@Headers value must be in the form \"Name: Value\". Found: \"%s\"", r0);
     */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:390:0x0925  */
    /* JADX WARN: Type inference failed for: r12v6 */
    /* JADX WARN: Type inference failed for: r12v7, types: [int] */
    /* JADX WARN: Type inference failed for: r12v8 */
    /* JADX WARN: Type inference failed for: r17v4, types: [int] */
    /* JADX WARN: Type inference failed for: r5v0 */
    /* JADX WARN: Type inference failed for: r5v1, types: [boolean] */
    /* JADX WARN: Type inference failed for: r5v31 */
    /* JADX WARN: Type inference failed for: r5v37 */
    /* JADX WARN: Type inference failed for: r5v38 */
    /* JADX WARN: Type inference failed for: r5v41 */
    /* JADX WARN: Type inference failed for: r6v0, types: [F7.Q] */
    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$ArrayArg
    	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)
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static AbstractC0135t b(V v7, Class cls, Method method) {
        Method method2;
        Type genericReturnType;
        boolean z8;
        boolean z9;
        boolean zM;
        b0 b0Var;
        Annotation[][] annotationArr;
        int i;
        b0[] b0VarArr;
        int i5;
        String str;
        int i8;
        b0 c3;
        b0 l8;
        b0 h8;
        C c8;
        char c9;
        int i9;
        int i10;
        ?? r12;
        int i11 = -1;
        int i12 = 0;
        ?? r52 = 1;
        ?? q8 = new Q(v7, cls, method);
        Annotation[] annotationArr2 = q8.f2646d;
        int length = annotationArr2.length;
        int i13 = 0;
        loop0: while (true) {
            Method method3 = q8.f2645c;
            String str2 = "HEAD";
            if (i13 >= length) {
                if (q8.f2656o == null) {
                    throw b0.n(method3, null, "HTTP method annotation is required (e.g., @GET, @POST, etc.).", new Object[0]);
                }
                if (!q8.f2657p) {
                    if (q8.f2659r) {
                        throw b0.n(method3, null, "Multipart can only be specified on HTTP methods with request body (e.g., @POST).", new Object[0]);
                    }
                    if (q8.f2658q) {
                        throw b0.n(method3, null, "FormUrlEncoded can only be specified on HTTP methods with request body (e.g., @POST).", new Object[0]);
                    }
                }
                Annotation[][] annotationArr3 = q8.f2647e;
                int length2 = annotationArr3.length;
                q8.f2664w = new b0[length2];
                int i14 = length2 - 1;
                int i15 = 0;
                loop2: while (i15 < length2) {
                    b0[] b0VarArr2 = q8.f2664w;
                    Type type = q8.f2648f[i15];
                    Annotation[] annotationArr4 = annotationArr3[i15];
                    int i16 = i15 == i14 ? 1 : i12;
                    if (annotationArr4 != null) {
                        int length3 = annotationArr4.length;
                        b0Var = null;
                        while (true) {
                            annotationArr = annotationArr3;
                            if (i12 >= length3) {
                                break;
                            }
                            Annotation annotation = annotationArr4[i12];
                            int i17 = length2;
                            int i18 = i12;
                            if (annotation instanceof H7.y) {
                                q8.c(i15, type);
                                if (q8.f2655n) {
                                    throw b0.o(method3, i15, "Multiple @Url method annotations found.", new Object[0]);
                                }
                                if (q8.f2651j) {
                                    throw b0.o(method3, i15, "@Path parameters may not be used with @Url.", new Object[0]);
                                }
                                if (q8.f2652k) {
                                    throw b0.o(method3, i15, "A @Url parameter must not come after a @Query.", new Object[0]);
                                }
                                if (q8.f2653l) {
                                    throw b0.o(method3, i15, "A @Url parameter must not come after a @QueryName.", new Object[0]);
                                }
                                if (q8.f2654m) {
                                    throw b0.o(method3, i15, "A @Url parameter must not come after a @QueryMap.", new Object[0]);
                                }
                                if (q8.f2660s != null) {
                                    throw b0.o(method3, i15, "@Url cannot be used with @%s URL", q8.f2656o);
                                }
                                q8.f2655n = true;
                                if (type != k7.q.class && type != String.class && type != URI.class && (!(type instanceof Class) || !"android.net.Uri".equals(((Class) type).getName()))) {
                                    break loop2;
                                }
                                c3 = new G(method3, i15, 1);
                                i = i14;
                            } else {
                                i = i14;
                                boolean z10 = annotation instanceof H7.s;
                                V v8 = q8.f2643a;
                                if (z10) {
                                    q8.c(i15, type);
                                    if (q8.f2652k) {
                                        throw b0.o(method3, i15, "A @Path parameter must not come after a @Query.", new Object[0]);
                                    }
                                    if (q8.f2653l) {
                                        throw b0.o(method3, i15, "A @Path parameter must not come after a @QueryName.", new Object[0]);
                                    }
                                    if (q8.f2654m) {
                                        throw b0.o(method3, i15, "A @Path parameter must not come after a @QueryMap.", new Object[0]);
                                    }
                                    if (q8.f2655n) {
                                        throw b0.o(method3, i15, "@Path parameters may not be used with @Url.", new Object[0]);
                                    }
                                    if (q8.f2660s == null) {
                                        throw b0.o(method3, i15, "@Path can only be used with relative url on @%s", q8.f2656o);
                                    }
                                    q8.f2651j = true;
                                    H7.s sVar = (H7.s) annotation;
                                    String strValue = sVar.value();
                                    if (!Q.f2642z.matcher(strValue).matches()) {
                                        throw b0.o(method3, i15, "@Path parameter name must match %s. Found: %s", Q.f2641y.pattern(), strValue);
                                    }
                                    if (!q8.f2663v.contains(strValue)) {
                                        throw b0.o(method3, i15, "URL \"%s\" does not contain \"{%s}\".", q8.f2660s, strValue);
                                    }
                                    v8.e(type, annotationArr4);
                                    c3 = new I(method3, i15, strValue, sVar.encoded());
                                } else {
                                    b0VarArr = b0VarArr2;
                                    i5 = i16;
                                    if (annotation instanceof H7.t) {
                                        q8.c(i15, type);
                                        H7.t tVar = (H7.t) annotation;
                                        String strValue2 = tVar.value();
                                        boolean zEncoded = tVar.encoded();
                                        i8 = length3;
                                        Class clsH = b0.h(type);
                                        str = str2;
                                        q8.f2652k = true;
                                        if (!Iterable.class.isAssignableFrom(clsH)) {
                                            if (clsH.isArray()) {
                                                v8.e(Q.a(clsH.getComponentType()), annotationArr4);
                                                c9 = 2;
                                                c3 = new C(new E(2, strValue2, zEncoded), 1);
                                            } else {
                                                c9 = 2;
                                                v8.e(type, annotationArr4);
                                                c3 = new E(2, strValue2, zEncoded);
                                            }
                                            if (c3 != null) {
                                                if (b0Var != null) {
                                                    throw b0.o(method3, i15, "Multiple Retrofit annotations found, only one allowed.", new Object[0]);
                                                }
                                                b0Var = c3;
                                            }
                                            i12 = i18 + 1;
                                            annotationArr3 = annotationArr;
                                            length2 = i17;
                                            i14 = i;
                                            length3 = i8;
                                            b0VarArr2 = b0VarArr;
                                            i16 = i5;
                                            str2 = str;
                                        } else {
                                            if (!(type instanceof ParameterizedType)) {
                                                throw b0.o(method3, i15, clsH.getSimpleName() + " must include generic type (e.g., " + clsH.getSimpleName() + "<String>)", new Object[0]);
                                            }
                                            v8.e(b0.g(0, (ParameterizedType) type), annotationArr4);
                                            c8 = new C(new E(2, strValue2, zEncoded), 0);
                                            c3 = c8;
                                        }
                                    } else {
                                        str = str2;
                                        i8 = length3;
                                        if (annotation instanceof H7.v) {
                                            q8.c(i15, type);
                                            boolean zEncoded2 = ((H7.v) annotation).encoded();
                                            Class clsH2 = b0.h(type);
                                            q8.f2653l = true;
                                            if (Iterable.class.isAssignableFrom(clsH2)) {
                                                if (!(type instanceof ParameterizedType)) {
                                                    throw b0.o(method3, i15, clsH2.getSimpleName() + " must include generic type (e.g., " + clsH2.getSimpleName() + "<String>)", new Object[0]);
                                                }
                                                v8.e(b0.g(0, (ParameterizedType) type), annotationArr4);
                                                c8 = new C(new J(zEncoded2), 0);
                                            } else if (clsH2.isArray()) {
                                                v8.e(Q.a(clsH2.getComponentType()), annotationArr4);
                                                c8 = new C(new J(zEncoded2), 1);
                                            } else {
                                                v8.e(type, annotationArr4);
                                                c3 = new J(zEncoded2);
                                            }
                                            c3 = c8;
                                        } else {
                                            if (annotation instanceof H7.u) {
                                                q8.c(i15, type);
                                                Class clsH3 = b0.h(type);
                                                q8.f2654m = true;
                                                if (!Map.class.isAssignableFrom(clsH3)) {
                                                    throw b0.o(method3, i15, "@QueryMap parameter type must be Map.", new Object[0]);
                                                }
                                                Type typeI = b0.i(type, clsH3);
                                                if (!(typeI instanceof ParameterizedType)) {
                                                    throw b0.o(method3, i15, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
                                                }
                                                ParameterizedType parameterizedType = (ParameterizedType) typeI;
                                                Type typeG = b0.g(0, parameterizedType);
                                                if (String.class != typeG) {
                                                    throw b0.o(method3, i15, "@QueryMap keys must be of type String: " + typeG, new Object[0]);
                                                }
                                                v8.e(b0.g(1, parameterizedType), annotationArr4);
                                                c3 = new F(method3, i15, ((H7.u) annotation).encoded(), 2);
                                            } else if (annotation instanceof H7.i) {
                                                q8.c(i15, type);
                                                H7.i iVar = (H7.i) annotation;
                                                String strValue3 = iVar.value();
                                                Class clsH4 = b0.h(type);
                                                if (Iterable.class.isAssignableFrom(clsH4)) {
                                                    if (!(type instanceof ParameterizedType)) {
                                                        throw b0.o(method3, i15, clsH4.getSimpleName() + " must include generic type (e.g., " + clsH4.getSimpleName() + "<String>)", new Object[0]);
                                                    }
                                                    v8.e(b0.g(0, (ParameterizedType) type), annotationArr4);
                                                    c3 = new C(new E(1, strValue3, iVar.allowUnsafeNonAsciiValues()), 0);
                                                } else if (clsH4.isArray()) {
                                                    v8.e(Q.a(clsH4.getComponentType()), annotationArr4);
                                                    c3 = new C(new E(1, strValue3, iVar.allowUnsafeNonAsciiValues()), 1);
                                                } else {
                                                    v8.e(type, annotationArr4);
                                                    h8 = new E(1, strValue3, iVar.allowUnsafeNonAsciiValues());
                                                    c3 = h8;
                                                }
                                            } else if (annotation instanceof H7.j) {
                                                if (type == k7.o.class) {
                                                    c3 = new G(method3, i15, 0);
                                                } else {
                                                    q8.c(i15, type);
                                                    Class clsH5 = b0.h(type);
                                                    if (!Map.class.isAssignableFrom(clsH5)) {
                                                        throw b0.o(method3, i15, "@HeaderMap parameter type must be Map or Headers.", new Object[0]);
                                                    }
                                                    Type typeI2 = b0.i(type, clsH5);
                                                    if (!(typeI2 instanceof ParameterizedType)) {
                                                        throw b0.o(method3, i15, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
                                                    }
                                                    ParameterizedType parameterizedType2 = (ParameterizedType) typeI2;
                                                    Type typeG2 = b0.g(0, parameterizedType2);
                                                    if (String.class != typeG2) {
                                                        throw b0.o(method3, i15, "@HeaderMap keys must be of type String: " + typeG2, new Object[0]);
                                                    }
                                                    v8.e(b0.g(1, parameterizedType2), annotationArr4);
                                                    c3 = new F(method3, i15, ((H7.j) annotation).allowUnsafeNonAsciiValues(), 1);
                                                }
                                            } else if (annotation instanceof H7.c) {
                                                q8.c(i15, type);
                                                if (!q8.f2658q) {
                                                    throw b0.o(method3, i15, "@Field parameters can only be used with form encoding.", new Object[0]);
                                                }
                                                H7.c cVar = (H7.c) annotation;
                                                String strValue4 = cVar.value();
                                                boolean zEncoded3 = cVar.encoded();
                                                q8.f2649g = true;
                                                Class clsH6 = b0.h(type);
                                                if (Iterable.class.isAssignableFrom(clsH6)) {
                                                    if (!(type instanceof ParameterizedType)) {
                                                        throw b0.o(method3, i15, clsH6.getSimpleName() + " must include generic type (e.g., " + clsH6.getSimpleName() + "<String>)", new Object[0]);
                                                    }
                                                    v8.e(b0.g(0, (ParameterizedType) type), annotationArr4);
                                                    c3 = new C(new E(0, strValue4, zEncoded3), 0);
                                                } else if (clsH6.isArray()) {
                                                    v8.e(Q.a(clsH6.getComponentType()), annotationArr4);
                                                    c3 = new C(new E(0, strValue4, zEncoded3), 1);
                                                } else {
                                                    v8.e(type, annotationArr4);
                                                    h8 = new E(0, strValue4, zEncoded3);
                                                    c3 = h8;
                                                }
                                            } else if (annotation instanceof H7.d) {
                                                q8.c(i15, type);
                                                if (!q8.f2658q) {
                                                    throw b0.o(method3, i15, "@FieldMap parameters can only be used with form encoding.", new Object[0]);
                                                }
                                                Class clsH7 = b0.h(type);
                                                if (!Map.class.isAssignableFrom(clsH7)) {
                                                    throw b0.o(method3, i15, "@FieldMap parameter type must be Map.", new Object[0]);
                                                }
                                                Type typeI3 = b0.i(type, clsH7);
                                                if (!(typeI3 instanceof ParameterizedType)) {
                                                    throw b0.o(method3, i15, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
                                                }
                                                ParameterizedType parameterizedType3 = (ParameterizedType) typeI3;
                                                Type typeG3 = b0.g(0, parameterizedType3);
                                                if (String.class != typeG3) {
                                                    throw b0.o(method3, i15, "@FieldMap keys must be of type String: " + typeG3, new Object[0]);
                                                }
                                                v8.e(b0.g(1, parameterizedType3), annotationArr4);
                                                q8.f2649g = true;
                                                c3 = new F(method3, i15, ((H7.d) annotation).encoded(), 0);
                                            } else if (annotation instanceof H7.q) {
                                                q8.c(i15, type);
                                                if (!q8.f2659r) {
                                                    throw b0.o(method3, i15, "@Part parameters can only be used with multipart encoding.", new Object[0]);
                                                }
                                                H7.q qVar = (H7.q) annotation;
                                                q8.f2650h = true;
                                                String strValue5 = qVar.value();
                                                Class clsH8 = b0.h(type);
                                                if (strValue5.isEmpty()) {
                                                    boolean zIsAssignableFrom = Iterable.class.isAssignableFrom(clsH8);
                                                    K k8 = K.f2620d;
                                                    if (zIsAssignableFrom) {
                                                        if (!(type instanceof ParameterizedType)) {
                                                            throw b0.o(method3, i15, clsH8.getSimpleName() + " must include generic type (e.g., " + clsH8.getSimpleName() + "<String>)", new Object[0]);
                                                        }
                                                        if (!k7.t.class.isAssignableFrom(b0.h(b0.g(0, (ParameterizedType) type)))) {
                                                            throw b0.o(method3, i15, "@Part annotation must supply a name or use MultipartBody.Part parameter type.", new Object[0]);
                                                        }
                                                        c3 = new C(k8, 0);
                                                    } else if (clsH8.isArray()) {
                                                        if (!k7.t.class.isAssignableFrom(clsH8.getComponentType())) {
                                                            throw b0.o(method3, i15, "@Part annotation must supply a name or use MultipartBody.Part parameter type.", new Object[0]);
                                                        }
                                                        c3 = new C(k8, 1);
                                                    } else {
                                                        if (!k7.t.class.isAssignableFrom(clsH8)) {
                                                            throw b0.o(method3, i15, "@Part annotation must supply a name or use MultipartBody.Part parameter type.", new Object[0]);
                                                        }
                                                        c3 = k8;
                                                    }
                                                } else {
                                                    k7.o oVarQ = W3.b.q("Content-Disposition", I1.a.p("form-data; name=\"", strValue5, "\""), "Content-Transfer-Encoding", qVar.encoding());
                                                    if (Iterable.class.isAssignableFrom(clsH8)) {
                                                        if (!(type instanceof ParameterizedType)) {
                                                            throw b0.o(method3, i15, clsH8.getSimpleName() + " must include generic type (e.g., " + clsH8.getSimpleName() + "<String>)", new Object[0]);
                                                        }
                                                        Type typeG4 = b0.g(0, (ParameterizedType) type);
                                                        if (k7.t.class.isAssignableFrom(b0.h(typeG4))) {
                                                            throw b0.o(method3, i15, "@Part parameters using the MultipartBody.Part must not include a part name in the annotation.", new Object[0]);
                                                        }
                                                        c3 = new C(new H(method3, i15, oVarQ, v8.c(typeG4, annotationArr4, annotationArr2)), 0);
                                                    } else if (clsH8.isArray()) {
                                                        Class clsA = Q.a(clsH8.getComponentType());
                                                        if (k7.t.class.isAssignableFrom(clsA)) {
                                                            throw b0.o(method3, i15, "@Part parameters using the MultipartBody.Part must not include a part name in the annotation.", new Object[0]);
                                                        }
                                                        c3 = new C(new H(method3, i15, oVarQ, v8.c(clsA, annotationArr4, annotationArr2)), 1);
                                                    } else {
                                                        if (k7.t.class.isAssignableFrom(clsH8)) {
                                                            throw b0.o(method3, i15, "@Part parameters using the MultipartBody.Part must not include a part name in the annotation.", new Object[0]);
                                                        }
                                                        h8 = new H(method3, i15, oVarQ, v8.c(type, annotationArr4, annotationArr2));
                                                        c3 = h8;
                                                    }
                                                }
                                            } else {
                                                if (annotation instanceof H7.r) {
                                                    q8.c(i15, type);
                                                    if (!q8.f2659r) {
                                                        throw b0.o(method3, i15, "@PartMap parameters can only be used with multipart encoding.", new Object[0]);
                                                    }
                                                    q8.f2650h = true;
                                                    Class clsH9 = b0.h(type);
                                                    if (!Map.class.isAssignableFrom(clsH9)) {
                                                        throw b0.o(method3, i15, "@PartMap parameter type must be Map.", new Object[0]);
                                                    }
                                                    Type typeI4 = b0.i(type, clsH9);
                                                    if (!(typeI4 instanceof ParameterizedType)) {
                                                        throw b0.o(method3, i15, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
                                                    }
                                                    ParameterizedType parameterizedType4 = (ParameterizedType) typeI4;
                                                    Type typeG5 = b0.g(0, parameterizedType4);
                                                    if (String.class != typeG5) {
                                                        throw b0.o(method3, i15, "@PartMap keys must be of type String: " + typeG5, new Object[0]);
                                                    }
                                                    Type typeG6 = b0.g(1, parameterizedType4);
                                                    if (k7.t.class.isAssignableFrom(b0.h(typeG6))) {
                                                        throw b0.o(method3, i15, "@PartMap values cannot be MultipartBody.Part. Use @Part List<Part> or a different value type instead.", new Object[0]);
                                                    }
                                                    l8 = new H(method3, i15, v8.c(typeG6, annotationArr4, annotationArr2), ((H7.r) annotation).encoding());
                                                } else if (annotation instanceof H7.a) {
                                                    q8.c(i15, type);
                                                    if (q8.f2658q || q8.f2659r) {
                                                        break loop2;
                                                    }
                                                    if (q8.i) {
                                                        throw b0.o(method3, i15, "Multiple @Body method annotations found.", new Object[0]);
                                                    }
                                                    try {
                                                        InterfaceC0130n interfaceC0130nC = v8.c(type, annotationArr4, annotationArr2);
                                                        q8.i = true;
                                                        l8 = new D(method3, i15, interfaceC0130nC);
                                                    } catch (RuntimeException e8) {
                                                        throw b0.p(method3, e8, i15, "Unable to create @Body converter for %s", type);
                                                    }
                                                } else if (annotation instanceof H7.x) {
                                                    q8.c(i15, type);
                                                    Class clsH10 = b0.h(type);
                                                    for (int i19 = i15 - 1; i19 >= 0; i19--) {
                                                        b0 b0Var2 = q8.f2664w[i19];
                                                        if ((b0Var2 instanceof L) && ((L) b0Var2).f2621d.equals(clsH10)) {
                                                            throw b0.o(method3, i15, "@Tag type " + clsH10.getName() + " is duplicate of " + M.f2623b.c(method3, i19) + " and would always overwrite its value.", new Object[0]);
                                                        }
                                                    }
                                                    l8 = new L(clsH10);
                                                } else {
                                                    c3 = null;
                                                }
                                                c3 = l8;
                                            }
                                            if (c3 != null) {
                                            }
                                            i12 = i18 + 1;
                                            annotationArr3 = annotationArr;
                                            length2 = i17;
                                            i14 = i;
                                            length3 = i8;
                                            b0VarArr2 = b0VarArr;
                                            i16 = i5;
                                            str2 = str;
                                        }
                                    }
                                    if (c3 != null) {
                                    }
                                    i12 = i18 + 1;
                                    annotationArr3 = annotationArr;
                                    length2 = i17;
                                    i14 = i;
                                    length3 = i8;
                                    b0VarArr2 = b0VarArr;
                                    i16 = i5;
                                    str2 = str;
                                }
                            }
                            b0VarArr = b0VarArr2;
                            str = str2;
                            i5 = i16;
                            i8 = length3;
                            if (c3 != null) {
                            }
                            i12 = i18 + 1;
                            annotationArr3 = annotationArr;
                            length2 = i17;
                            i14 = i;
                            length3 = i8;
                            b0VarArr2 = b0VarArr;
                            i16 = i5;
                            str2 = str;
                        }
                    } else {
                        b0Var = null;
                        annotationArr = annotationArr3;
                    }
                    int i20 = length2;
                    int i21 = i14;
                    b0[] b0VarArr3 = b0VarArr2;
                    String str3 = str2;
                    int i22 = i16;
                    if (b0Var == null) {
                        if (i22 != 0) {
                            try {
                                if (b0.h(type) == E6.d.class) {
                                    q8.f2665x = true;
                                    b0Var = null;
                                }
                            } catch (NoClassDefFoundError unused) {
                            }
                        }
                        throw b0.o(method3, i15, "No Retrofit annotation found.", new Object[0]);
                    }
                    b0VarArr3[i15] = b0Var;
                    i15++;
                    annotationArr3 = annotationArr;
                    length2 = i20;
                    i14 = i21;
                    str2 = str3;
                    i12 = 0;
                }
                String str4 = str2;
                if (q8.f2660s == null && !q8.f2655n) {
                    throw b0.n(method3, null, "Missing either @%s URL or @Url parameter.", q8.f2656o);
                }
                boolean z11 = q8.f2658q;
                if (!z11 && !q8.f2659r && !q8.f2657p && q8.i) {
                    throw b0.n(method3, null, "Non-body HTTP method cannot contain @Body.", new Object[0]);
                }
                if (z11 && !q8.f2649g) {
                    throw b0.n(method3, null, "Form-encoded method must contain at least one @Field.", new Object[0]);
                }
                if (q8.f2659r && !q8.f2650h) {
                    throw b0.n(method3, null, "Multipart method must contain at least one @Part.", new Object[0]);
                }
                S s8 = new S(q8);
                Type genericReturnType2 = method.getGenericReturnType();
                if (b0.j(genericReturnType2)) {
                    throw b0.n(method, null, "Method return type must not include a type variable or wildcard: %s", genericReturnType2);
                }
                if (genericReturnType2 == Void.TYPE) {
                    throw b0.n(method, null, "Service methods cannot return void.", new Object[0]);
                }
                Annotation[] annotations = method.getAnnotations();
                boolean z12 = s8.f2676l;
                if (z12) {
                    Type typeG7 = ((ParameterizedType) method.getGenericParameterTypes()[r4.length - 1]).getActualTypeArguments()[0];
                    if (typeG7 instanceof WildcardType) {
                        typeG7 = ((WildcardType) typeG7).getLowerBounds()[0];
                    }
                    if (b0.h(typeG7) == T.class && (typeG7 instanceof ParameterizedType)) {
                        typeG7 = b0.g(0, (ParameterizedType) typeG7);
                        zM = false;
                        z8 = true;
                    } else {
                        if (b0.h(typeG7) == InterfaceC0121e.class) {
                            throw b0.n(method, null, "Suspend functions should not return Call, as they already execute asynchronously.\nChange its return type to %s", b0.g(0, (ParameterizedType) typeG7));
                        }
                        zM = b0.m(typeG7);
                        z8 = false;
                    }
                    genericReturnType = new Z(null, InterfaceC0121e.class, typeG7);
                    if (!b0.l(annotations, W.class)) {
                        Annotation[] annotationArr5 = new Annotation[annotations.length + 1];
                        annotationArr5[0] = X.f2688a;
                        System.arraycopy(annotations, 0, annotationArr5, 1, annotations.length);
                        annotations = annotationArr5;
                    }
                    method2 = method;
                    z9 = zM;
                } else {
                    method2 = method;
                    genericReturnType = method2.getGenericReturnType();
                    z8 = false;
                    z9 = false;
                }
                try {
                    InterfaceC0123g interfaceC0123gA = v7.a(genericReturnType, annotations);
                    Type typeO = interfaceC0123gA.o();
                    if (typeO == k7.C.class) {
                        throw b0.n(method2, null, "'" + b0.h(typeO).getName() + "' is not a valid response body type. Did you mean ResponseBody?", new Object[0]);
                    }
                    if (typeO == T.class) {
                        throw b0.n(method2, null, "Response must include generic type (e.g., Response<String>)", new Object[0]);
                    }
                    if (s8.f2669d.equals(str4) && !Void.class.equals(typeO) && !b0.m(typeO)) {
                        throw b0.n(method2, null, "HEAD method must use Void or Unit as response type.", new Object[0]);
                    }
                    try {
                        InterfaceC0130n interfaceC0130nD = v7.d(typeO, method2.getAnnotations());
                        InterfaceC1112d interfaceC1112d = v7.f2684b;
                        return !z12 ? new r(s8, interfaceC1112d, interfaceC0130nD, interfaceC0123gA, 0) : z8 ? new r(s8, interfaceC1112d, interfaceC0130nD, interfaceC0123gA, 1) : new C0134s(s8, interfaceC1112d, interfaceC0130nD, interfaceC0123gA, z9);
                    } catch (RuntimeException e9) {
                        throw b0.n(method2, e9, "Unable to create converter for %s", typeO);
                    }
                } catch (RuntimeException e10) {
                    throw b0.n(method2, e10, "Unable to create call adapter for %s", genericReturnType);
                }
            }
            Annotation annotation2 = annotationArr2[i13];
            if (annotation2 instanceof H7.b) {
                q8.b("DELETE", ((H7.b) annotation2).value(), false);
            } else if (annotation2 instanceof H7.f) {
                q8.b("GET", ((H7.f) annotation2).value(), false);
            } else if (annotation2 instanceof H7.g) {
                q8.b("HEAD", ((H7.g) annotation2).value(), false);
            } else if (annotation2 instanceof H7.n) {
                q8.b("PATCH", ((H7.n) annotation2).value(), r52);
            } else if (annotation2 instanceof H7.o) {
                q8.b("POST", ((H7.o) annotation2).value(), r52);
            } else if (annotation2 instanceof H7.p) {
                q8.b("PUT", ((H7.p) annotation2).value(), r52);
            } else if (annotation2 instanceof H7.m) {
                q8.b("OPTIONS", ((H7.m) annotation2).value(), false);
            } else if (annotation2 instanceof H7.h) {
                H7.h hVar = (H7.h) annotation2;
                q8.b(hVar.method(), hVar.path(), hVar.hasBody());
            } else {
                if (annotation2 instanceof H7.k) {
                    H7.k kVar = (H7.k) annotation2;
                    String[] strArrValue = kVar.value();
                    if (strArrValue.length == 0) {
                        throw b0.n(method3, null, "@Headers annotation is empty.", new Object[0]);
                    }
                    boolean zAllowUnsafeNonAsciiValues = kVar.allowUnsafeNonAsciiValues();
                    N0.c cVar2 = new N0.c(r52 == true ? 1 : 0);
                    int length4 = strArrValue.length;
                    int i23 = 0;
                    ?? r53 = r52;
                    while (i23 < length4) {
                        String str5 = strArrValue[i23];
                        int i24 = r53;
                        int iIndexOf = str5.indexOf(58);
                        if (iIndexOf == i11 || iIndexOf == 0) {
                            break loop0;
                        }
                        int i25 = i11;
                        if (iIndexOf == str5.length() - 1) {
                            break loop0;
                        }
                        String strSubstring = str5.substring(0, iIndexOf);
                        String strTrim = str5.substring(iIndexOf + 1).trim();
                        if ("Content-Type".equalsIgnoreCase(strSubstring)) {
                            try {
                                Pattern pattern = k7.s.f14130d;
                                q8.f2662u = AbstractC0386a.m(strTrim);
                                r12 = i24;
                            } catch (IllegalArgumentException e11) {
                                Object[] objArr = new Object[i24];
                                objArr[0] = strTrim;
                                throw b0.n(method3, e11, "Malformed content type: %s", objArr);
                            }
                        } else {
                            r12 = i24;
                            if (zAllowUnsafeNonAsciiValues) {
                                cVar2.h(strSubstring, strTrim);
                            } else {
                                cVar2.f(strSubstring, strTrim);
                            }
                        }
                        i23 += r12;
                        r53 = r12;
                        i11 = i25;
                    }
                    i9 = i11;
                    q8.f2661t = cVar2.i();
                    i10 = 1;
                } else {
                    i9 = i11;
                    if (!(annotation2 instanceof H7.l)) {
                        i10 = 1;
                        i10 = 1;
                        if (!(annotation2 instanceof H7.e)) {
                            continue;
                        } else {
                            if (q8.f2659r) {
                                throw b0.n(method3, null, "Only one encoding annotation is allowed.", new Object[0]);
                            }
                            q8.f2658q = true;
                        }
                    } else {
                        if (q8.f2658q) {
                            throw b0.n(method3, null, "Only one encoding annotation is allowed.", new Object[0]);
                        }
                        i10 = 1;
                        q8.f2659r = true;
                    }
                }
                i13 += i10;
                r52 = i10;
                i11 = i9;
            }
            i9 = i11;
            i10 = r52 == true ? 1 : 0;
            i13 += i10;
            r52 = i10;
            i11 = i9;
        }
    }

    public abstract Object a(B b8, Object[] objArr);
}
