package p491;

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.util.Map;
import p138.p139.p143.p144.C2803;
import p402.p405.InterfaceC6575;
import p447.AbstractC6936;
import p447.C6905;
import p447.C6914;
import p447.C6916;
import p447.C6933;
import p447.InterfaceC6868;
import p491.AbstractC7326;
import p491.AbstractC7348;
import p491.C7364;
import p491.C7373;
import p491.p494.InterfaceC7380;
import p491.p494.InterfaceC7381;
import p491.p494.InterfaceC7382;
import p491.p494.InterfaceC7383;
import p491.p494.InterfaceC7384;
import p491.p494.InterfaceC7385;
import p491.p494.InterfaceC7386;
import p491.p494.InterfaceC7387;
import p491.p494.InterfaceC7388;
import p491.p494.InterfaceC7389;
import p491.p494.InterfaceC7390;
import p491.p494.InterfaceC7391;
import p491.p494.InterfaceC7392;
import p491.p494.InterfaceC7393;
import p491.p494.InterfaceC7394;
import p491.p494.InterfaceC7395;
import p491.p494.InterfaceC7396;
import p491.p494.InterfaceC7397;

/* JADX INFO: renamed from: ޓ.ޛ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractC7370<T> {
    /* JADX WARN: Removed duplicated region for block: B:284:0x0754  */
    /* JADX WARN: Removed duplicated region for block: B:453:0x0758 A[SYNTHETIC] */
    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static <T> AbstractC7370<T> m10986(C7367 c7367, Method method) throws CloneNotSupportedException {
        Type genericReturnType;
        boolean z;
        int i;
        int i2;
        AbstractC7348<?> abstractC7348;
        int i3;
        int i4;
        int i5;
        AbstractC7348<?> c7352;
        AbstractC7348<?> c7353;
        AbstractC7348<?> c7347;
        AbstractC7348<?> c7354;
        AbstractC7348<?> c7349;
        C7364.C7365 c7365 = new C7364.C7365(c7367, method);
        for (Annotation annotation : c7365.f21335) {
            if (annotation instanceof InterfaceC7380) {
                c7365.m10975("DELETE", ((InterfaceC7380) annotation).value(), false);
            } else if (annotation instanceof InterfaceC7383) {
                c7365.m10975("GET", ((InterfaceC7383) annotation).value(), false);
            } else if (annotation instanceof InterfaceC7384) {
                c7365.m10975("HEAD", ((InterfaceC7384) annotation).value(), false);
            } else if (annotation instanceof InterfaceC7389) {
                c7365.m10975("PATCH", ((InterfaceC7389) annotation).value(), true);
            } else if (annotation instanceof InterfaceC7390) {
                c7365.m10975("POST", ((InterfaceC7390) annotation).value(), true);
            } else if (annotation instanceof InterfaceC7391) {
                c7365.m10975("PUT", ((InterfaceC7391) annotation).value(), true);
            } else if (annotation instanceof InterfaceC7388) {
                c7365.m10975("OPTIONS", ((InterfaceC7388) annotation).value(), false);
            } else if (annotation instanceof InterfaceC7385) {
                InterfaceC7385 interfaceC7385 = (InterfaceC7385) annotation;
                c7365.m10975(interfaceC7385.method(), interfaceC7385.path(), interfaceC7385.hasBody());
            } else if (annotation instanceof InterfaceC7387) {
                String[] strArrValue = ((InterfaceC7387) annotation).value();
                if (strArrValue.length == 0) {
                    throw C7373.m10989(c7365.f21334, "@Headers annotation is empty.", new Object[0]);
                }
                C6905.C6906 c6906 = new C6905.C6906();
                for (String str : strArrValue) {
                    int iIndexOf = str.indexOf(58);
                    if (iIndexOf == -1 || iIndexOf == 0 || iIndexOf == str.length() - 1) {
                        throw C7373.m10989(c7365.f21334, "@Headers value must be in the form \"Name: Value\". Found: \"%s\"", str);
                    }
                    String strSubstring = str.substring(0, iIndexOf);
                    String strTrim = str.substring(iIndexOf + 1).trim();
                    if ("Content-Type".equalsIgnoreCase(strSubstring)) {
                        try {
                            c7365.f21352 = C6914.m10103(strTrim);
                        } catch (IllegalArgumentException e) {
                            throw C7373.m10990(c7365.f21334, e, "Malformed content type: %s", strTrim);
                        }
                    } else {
                        c6906.m10072(strSubstring, strTrim);
                    }
                }
                c7365.f21351 = c6906.m10073();
            } else {
                continue;
            }
        }
        if (c7365.f21346 == null) {
            throw C7373.m10989(c7365.f21334, "HTTP method annotation is required (e.g., @GET, @POST, etc.).", new Object[0]);
        }
        if (!c7365.f21347) {
            if (c7365.f21349) {
                throw C7373.m10989(c7365.f21334, "Multipart can only be specified on HTTP methods with request body (e.g., @POST).", new Object[0]);
            }
            if (c7365.f21348) {
                throw C7373.m10989(c7365.f21334, "FormUrlEncoded can only be specified on HTTP methods with request body (e.g., @POST).", new Object[0]);
            }
        }
        int length = c7365.f21336.length;
        c7365.f21354 = new AbstractC7348[length];
        int i6 = length - 1;
        int i7 = 0;
        while (i7 < length) {
            AbstractC7348<?>[] abstractC7348Arr = c7365.f21354;
            Type type = c7365.f21337[i7];
            Annotation[] annotationArr = c7365.f21336[i7];
            boolean z2 = i7 == i6;
            if (annotationArr != null) {
                int length2 = annotationArr.length;
                abstractC7348 = null;
                int i8 = 0;
                while (i8 < length2) {
                    Annotation annotation2 = annotationArr[i8];
                    int i9 = length;
                    if (annotation2 instanceof InterfaceC7394) {
                        c7365.m10974(i7, type);
                        if (c7365.f21342) {
                            throw C7373.m10988(c7365.f21334, i7, "A @Path parameter must not come after a @Query.", new Object[0]);
                        }
                        if (c7365.f21343) {
                            throw C7373.m10988(c7365.f21334, i7, "A @Path parameter must not come after a @QueryName.", new Object[0]);
                        }
                        if (c7365.f21344) {
                            throw C7373.m10988(c7365.f21334, i7, "A @Path parameter must not come after a @QueryMap.", new Object[0]);
                        }
                        if (c7365.f21345) {
                            throw C7373.m10988(c7365.f21334, i7, "@Path parameters may not be used with @Url.", new Object[0]);
                        }
                        if (c7365.f21350 == null) {
                            throw C7373.m10988(c7365.f21334, i7, "@Path can only be used with relative url on @%s", c7365.f21346);
                        }
                        c7365.f21341 = true;
                        InterfaceC7394 interfaceC7394 = (InterfaceC7394) annotation2;
                        String strValue = interfaceC7394.value();
                        if (!C7364.C7365.f21332.matcher(strValue).matches()) {
                            throw C7373.m10988(c7365.f21334, i7, "@Path parameter name must match %s. Found: %s", C7364.C7365.f21331.pattern(), strValue);
                        }
                        if (!c7365.f21353.contains(strValue)) {
                            throw C7373.m10988(c7365.f21334, i7, "URL \"%s\" does not contain \"{%s}\".", c7365.f21350, strValue);
                        }
                        i3 = i8;
                        i4 = length2;
                        c7354 = new AbstractC7348.C7354<>(c7365.f21334, i7, strValue, c7365.f21333.m10983(type, annotationArr), interfaceC7394.encoded());
                    } else {
                        i3 = i8;
                        i4 = length2;
                        if (annotation2 instanceof InterfaceC7395) {
                            c7365.m10974(i7, type);
                            InterfaceC7395 interfaceC7395 = (InterfaceC7395) annotation2;
                            String strValue2 = interfaceC7395.value();
                            boolean zEncoded = interfaceC7395.encoded();
                            Class<?> clsM10999 = C7373.m10999(type);
                            c7365.f21342 = true;
                            if (Iterable.class.isAssignableFrom(clsM10999)) {
                                if (!(type instanceof ParameterizedType)) {
                                    throw C7373.m10988(c7365.f21334, i7, C2803.m4869(clsM10999, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
                                }
                                c7353 = new C7346<>(new AbstractC7348.C7355(strValue2, c7365.f21333.m10983(C7373.m10991(0, (ParameterizedType) type), annotationArr), zEncoded));
                            } else if (clsM10999.isArray()) {
                                c7353 = new C7347(new AbstractC7348.C7355(strValue2, c7365.f21333.m10983(C7364.C7365.m10973(clsM10999.getComponentType()), annotationArr), zEncoded));
                            } else {
                                c7349 = new AbstractC7348.C7355<>(strValue2, c7365.f21333.m10983(type, annotationArr), zEncoded);
                                c7354 = c7349;
                            }
                            i5 = i6;
                            c7352 = c7353;
                        } else if (annotation2 instanceof InterfaceC7397) {
                            c7365.m10974(i7, type);
                            boolean zEncoded2 = ((InterfaceC7397) annotation2).encoded();
                            Class<?> clsM109992 = C7373.m10999(type);
                            c7365.f21343 = true;
                            if (Iterable.class.isAssignableFrom(clsM109992)) {
                                if (!(type instanceof ParameterizedType)) {
                                    throw C7373.m10988(c7365.f21334, i7, C2803.m4869(clsM109992, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
                                }
                                c7353 = new C7346<>(new AbstractC7348.C7357(c7365.f21333.m10983(C7373.m10991(0, (ParameterizedType) type), annotationArr), zEncoded2));
                            } else if (clsM109992.isArray()) {
                                c7353 = new C7347(new AbstractC7348.C7357(c7365.f21333.m10983(C7364.C7365.m10973(clsM109992.getComponentType()), annotationArr), zEncoded2));
                            } else {
                                c7352 = new AbstractC7348.C7357<>(c7365.f21333.m10983(type, annotationArr), zEncoded2);
                                i5 = i6;
                            }
                            i5 = i6;
                            c7352 = c7353;
                        } else {
                            if (annotation2 instanceof InterfaceC7396) {
                                c7365.m10974(i7, type);
                                Class<?> clsM109993 = C7373.m10999(type);
                                c7365.f21344 = true;
                                if (!Map.class.isAssignableFrom(clsM109993)) {
                                    throw C7373.m10988(c7365.f21334, i7, "@QueryMap parameter type must be Map.", new Object[0]);
                                }
                                Type typeM11000 = C7373.m11000(type, clsM109993, Map.class);
                                if (!(typeM11000 instanceof ParameterizedType)) {
                                    throw C7373.m10988(c7365.f21334, i7, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
                                }
                                ParameterizedType parameterizedType = (ParameterizedType) typeM11000;
                                Type typeM10991 = C7373.m10991(0, parameterizedType);
                                if (String.class != typeM10991) {
                                    throw C7373.m10988(c7365.f21334, i7, "@QueryMap keys must be of type String: " + typeM10991, new Object[0]);
                                }
                                c7352 = new AbstractC7348.C7356<>(c7365.f21334, i7, c7365.f21333.m10983(C7373.m10991(1, parameterizedType), annotationArr), ((InterfaceC7396) annotation2).encoded());
                            } else if (annotation2 instanceof InterfaceC7386) {
                                c7365.m10974(i7, type);
                                String strValue3 = ((InterfaceC7386) annotation2).value();
                                Class<?> clsM109994 = C7373.m10999(type);
                                if (Iterable.class.isAssignableFrom(clsM109994)) {
                                    if (!(type instanceof ParameterizedType)) {
                                        throw C7373.m10988(c7365.f21334, i7, C2803.m4869(clsM109994, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
                                    }
                                    c7353 = new C7346<>(new AbstractC7348.C7351(strValue3, c7365.f21333.m10983(C7373.m10991(0, (ParameterizedType) type), annotationArr)));
                                } else if (clsM109994.isArray()) {
                                    c7353 = new C7347(new AbstractC7348.C7351(strValue3, c7365.f21333.m10983(C7364.C7365.m10973(clsM109994.getComponentType()), annotationArr)));
                                } else {
                                    c7352 = new AbstractC7348.C7351<>(strValue3, c7365.f21333.m10983(type, annotationArr));
                                }
                                i5 = i6;
                                c7352 = c7353;
                            } else if (annotation2 instanceof InterfaceC7381) {
                                c7365.m10974(i7, type);
                                if (!c7365.f21348) {
                                    throw C7373.m10988(c7365.f21334, i7, "@Field parameters can only be used with form encoding.", new Object[0]);
                                }
                                InterfaceC7381 interfaceC7381 = (InterfaceC7381) annotation2;
                                String strValue4 = interfaceC7381.value();
                                boolean zEncoded3 = interfaceC7381.encoded();
                                c7365.f21338 = true;
                                Class<?> clsM109995 = C7373.m10999(type);
                                if (Iterable.class.isAssignableFrom(clsM109995)) {
                                    if (!(type instanceof ParameterizedType)) {
                                        throw C7373.m10988(c7365.f21334, i7, C2803.m4869(clsM109995, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
                                    }
                                    c7353 = new C7346<>(new AbstractC7348.C7349(strValue4, c7365.f21333.m10983(C7373.m10991(0, (ParameterizedType) type), annotationArr), zEncoded3));
                                } else if (clsM109995.isArray()) {
                                    c7353 = new C7347(new AbstractC7348.C7349(strValue4, c7365.f21333.m10983(C7364.C7365.m10973(clsM109995.getComponentType()), annotationArr), zEncoded3));
                                } else {
                                    c7349 = new AbstractC7348.C7349<>(strValue4, c7365.f21333.m10983(type, annotationArr), zEncoded3);
                                    c7354 = c7349;
                                }
                                i5 = i6;
                                c7352 = c7353;
                            } else if (annotation2 instanceof InterfaceC7382) {
                                c7365.m10974(i7, type);
                                if (!c7365.f21348) {
                                    throw C7373.m10988(c7365.f21334, i7, "@FieldMap parameters can only be used with form encoding.", new Object[0]);
                                }
                                Class<?> clsM109996 = C7373.m10999(type);
                                if (!Map.class.isAssignableFrom(clsM109996)) {
                                    throw C7373.m10988(c7365.f21334, i7, "@FieldMap parameter type must be Map.", new Object[0]);
                                }
                                Type typeM110002 = C7373.m11000(type, clsM109996, Map.class);
                                if (!(typeM110002 instanceof ParameterizedType)) {
                                    throw C7373.m10988(c7365.f21334, i7, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
                                }
                                ParameterizedType parameterizedType2 = (ParameterizedType) typeM110002;
                                Type typeM109912 = C7373.m10991(0, parameterizedType2);
                                if (String.class != typeM109912) {
                                    throw C7373.m10988(c7365.f21334, i7, "@FieldMap keys must be of type String: " + typeM109912, new Object[0]);
                                }
                                InterfaceC7320<T, String> interfaceC7320M10983 = c7365.f21333.m10983(C7373.m10991(1, parameterizedType2), annotationArr);
                                c7365.f21338 = true;
                                c7352 = new AbstractC7348.C7350<>(c7365.f21334, i7, interfaceC7320M10983, ((InterfaceC7382) annotation2).encoded());
                            } else if (annotation2 instanceof InterfaceC7392) {
                                c7365.m10974(i7, type);
                                if (!c7365.f21349) {
                                    throw C7373.m10988(c7365.f21334, i7, "@Part parameters can only be used with multipart encoding.", new Object[0]);
                                }
                                InterfaceC7392 interfaceC7392 = (InterfaceC7392) annotation2;
                                c7365.f21339 = true;
                                String strValue5 = interfaceC7392.value();
                                Class<?> clsM109997 = C7373.m10999(type);
                                if (strValue5.isEmpty()) {
                                    if (Iterable.class.isAssignableFrom(clsM109997)) {
                                        if (!(type instanceof ParameterizedType)) {
                                            throw C7373.m10988(c7365.f21334, i7, C2803.m4869(clsM109997, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
                                        }
                                        if (!C6916.C6919.class.isAssignableFrom(C7373.m10999(C7373.m10991(0, (ParameterizedType) type)))) {
                                            throw C7373.m10988(c7365.f21334, i7, "@Part annotation must supply a name or use MultipartBody.Part parameter type.", new Object[0]);
                                        }
                                        c7347 = new C7346<>(AbstractC7348.C7358.f21300);
                                    } else if (clsM109997.isArray()) {
                                        if (!C6916.C6919.class.isAssignableFrom(clsM109997.getComponentType())) {
                                            throw C7373.m10988(c7365.f21334, i7, "@Part annotation must supply a name or use MultipartBody.Part parameter type.", new Object[0]);
                                        }
                                        c7347 = new C7347(AbstractC7348.C7358.f21300);
                                    } else {
                                        if (!C6916.C6919.class.isAssignableFrom(clsM109997)) {
                                            throw C7373.m10988(c7365.f21334, i7, "@Part annotation must supply a name or use MultipartBody.Part parameter type.", new Object[0]);
                                        }
                                        c7352 = AbstractC7348.C7358.f21300;
                                    }
                                    c7354 = c7347;
                                } else {
                                    i5 = i6;
                                    C6905 c6905M10076 = C6905.f20008.m10076("Content-Disposition", C2803.m4880("form-data; name=\"", strValue5, "\""), "Content-Transfer-Encoding", interfaceC7392.encoding());
                                    if (Iterable.class.isAssignableFrom(clsM109997)) {
                                        if (!(type instanceof ParameterizedType)) {
                                            throw C7373.m10988(c7365.f21334, i7, C2803.m4869(clsM109997, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
                                        }
                                        Type typeM109913 = C7373.m10991(0, (ParameterizedType) type);
                                        if (C6916.C6919.class.isAssignableFrom(C7373.m10999(typeM109913))) {
                                            throw C7373.m10988(c7365.f21334, i7, "@Part parameters using the MultipartBody.Part must not include a part name in the annotation.", new Object[0]);
                                        }
                                        c7353 = new C7346<>(new AbstractC7348.C7352(c7365.f21334, i7, c6905M10076, c7365.f21333.m10980(typeM109913, annotationArr, c7365.f21335)));
                                    } else if (clsM109997.isArray()) {
                                        Class<?> clsM10973 = C7364.C7365.m10973(clsM109997.getComponentType());
                                        if (C6916.C6919.class.isAssignableFrom(clsM10973)) {
                                            throw C7373.m10988(c7365.f21334, i7, "@Part parameters using the MultipartBody.Part must not include a part name in the annotation.", new Object[0]);
                                        }
                                        c7353 = new C7347(new AbstractC7348.C7352(c7365.f21334, i7, c6905M10076, c7365.f21333.m10980(clsM10973, annotationArr, c7365.f21335)));
                                    } else {
                                        if (C6916.C6919.class.isAssignableFrom(clsM109997)) {
                                            throw C7373.m10988(c7365.f21334, i7, "@Part parameters using the MultipartBody.Part must not include a part name in the annotation.", new Object[0]);
                                        }
                                        c7352 = new AbstractC7348.C7352<>(c7365.f21334, i7, c6905M10076, c7365.f21333.m10980(type, annotationArr, c7365.f21335));
                                    }
                                    c7352 = c7353;
                                }
                            } else {
                                i5 = i6;
                                if (annotation2 instanceof InterfaceC7393) {
                                    c7365.m10974(i7, type);
                                    if (!c7365.f21349) {
                                        throw C7373.m10988(c7365.f21334, i7, "@PartMap parameters can only be used with multipart encoding.", new Object[0]);
                                    }
                                    c7365.f21339 = true;
                                    Class<?> clsM109998 = C7373.m10999(type);
                                    if (!Map.class.isAssignableFrom(clsM109998)) {
                                        throw C7373.m10988(c7365.f21334, i7, "@PartMap parameter type must be Map.", new Object[0]);
                                    }
                                    Type typeM110003 = C7373.m11000(type, clsM109998, Map.class);
                                    if (!(typeM110003 instanceof ParameterizedType)) {
                                        throw C7373.m10988(c7365.f21334, i7, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
                                    }
                                    ParameterizedType parameterizedType3 = (ParameterizedType) typeM110003;
                                    Type typeM109914 = C7373.m10991(0, parameterizedType3);
                                    if (String.class != typeM109914) {
                                        throw C7373.m10988(c7365.f21334, i7, "@PartMap keys must be of type String: " + typeM109914, new Object[0]);
                                    }
                                    Type typeM109915 = C7373.m10991(1, parameterizedType3);
                                    if (C6916.C6919.class.isAssignableFrom(C7373.m10999(typeM109915))) {
                                        throw C7373.m10988(c7365.f21334, i7, "@PartMap values cannot be MultipartBody.Part. Use @Part List<Part> or a different value type instead.", new Object[0]);
                                    }
                                    c7353 = new AbstractC7348.C7353<>(c7365.f21334, i7, c7365.f21333.m10980(typeM109915, annotationArr, c7365.f21335), ((InterfaceC7393) annotation2).encoding());
                                    c7352 = c7353;
                                } else {
                                    c7352 = null;
                                }
                            }
                            i5 = i6;
                        }
                        if (c7352 != null) {
                            if (abstractC7348 != null) {
                                throw C7373.m10988(c7365.f21334, i7, "Multiple Retrofit annotations found, only one allowed.", new Object[0]);
                            }
                            abstractC7348 = c7352;
                        }
                        i8 = i3 + 1;
                        length = i9;
                        i6 = i5;
                        length2 = i4;
                    }
                    c7352 = c7354;
                    i5 = i6;
                    if (c7352 != null) {
                    }
                    i8 = i3 + 1;
                    length = i9;
                    i6 = i5;
                    length2 = i4;
                }
                i = length;
                i2 = i6;
            } else {
                i = length;
                i2 = i6;
                abstractC7348 = null;
            }
            if (abstractC7348 == null) {
                if (z2) {
                    try {
                        if (C7373.m10999(type) == InterfaceC6575.class) {
                            c7365.f21355 = true;
                            abstractC7348 = null;
                        }
                    } catch (NoClassDefFoundError unused) {
                    }
                }
                throw C7373.m10988(c7365.f21334, i7, "No Retrofit annotation found.", new Object[0]);
            }
            abstractC7348Arr[i7] = abstractC7348;
            i7++;
            length = i;
            i6 = i2;
        }
        if (c7365.f21350 == null && !c7365.f21345) {
            throw C7373.m10989(c7365.f21334, "Missing either @%s URL or @Url parameter.", c7365.f21346);
        }
        if (!c7365.f21348 && !c7365.f21349 && !c7365.f21347 && c7365.f21340) {
            throw C7373.m10989(c7365.f21334, "Non-body HTTP method cannot contain @Body.", new Object[0]);
        }
        if (c7365.f21348 && !c7365.f21338) {
            throw C7373.m10989(c7365.f21334, "Form-encoded method must contain at least one @Field.", new Object[0]);
        }
        if (c7365.f21349 && !c7365.f21339) {
            throw C7373.m10989(c7365.f21334, "Multipart method must contain at least one @Part.", new Object[0]);
        }
        C7364 c7364 = new C7364(c7365);
        Type genericReturnType2 = method.getGenericReturnType();
        if (C7373.m11001(genericReturnType2)) {
            throw C7373.m10989(method, "Method return type must not include a type variable or wildcard: %s", genericReturnType2);
        }
        if (genericReturnType2 == Void.TYPE) {
            throw C7373.m10989(method, "Service methods cannot return void.", new Object[0]);
        }
        boolean z3 = c7364.f21330;
        Annotation[] annotations = method.getAnnotations();
        if (z3) {
            Type typeM109916 = ((ParameterizedType) method.getGenericParameterTypes()[r5.length - 1]).getActualTypeArguments()[0];
            if (typeM109916 instanceof WildcardType) {
                typeM109916 = ((WildcardType) typeM109916).getLowerBounds()[0];
            }
            if (C7373.m10999(typeM109916) == C7366.class && (typeM109916 instanceof ParameterizedType)) {
                typeM109916 = C7373.m10991(0, (ParameterizedType) typeM109916);
                z = true;
            } else {
                z = false;
            }
            genericReturnType = new C7373.C7375(null, InterfaceC7310.class, typeM109916);
            annotations = C7372.m10987(annotations);
        } else {
            genericReturnType = method.getGenericReturnType();
            z = false;
        }
        try {
            InterfaceC7311<?, ?> interfaceC7311M10979 = c7367.m10979(genericReturnType, annotations);
            Type typeMo10955 = interfaceC7311M10979.mo10955();
            if (typeMo10955 == C6933.class) {
                StringBuilder sbM4889 = C2803.m4889("'");
                sbM4889.append(C7373.m10999(typeMo10955).getName());
                sbM4889.append("' is not a valid response body type. Did you mean ResponseBody?");
                throw C7373.m10989(method, sbM4889.toString(), new Object[0]);
            }
            if (typeMo10955 == C7366.class) {
                throw C7373.m10989(method, "Response must include generic type (e.g., Response<String>)", new Object[0]);
            }
            if (c7364.f21322.equals("HEAD") && !Void.class.equals(typeMo10955)) {
                throw C7373.m10989(method, "HEAD method must use Void as response type.", new Object[0]);
            }
            try {
                InterfaceC7320<AbstractC6936, T> interfaceC7320M10982 = c7367.m10982(typeMo10955, method.getAnnotations());
                InterfaceC6868.InterfaceC6869 interfaceC6869 = c7367.f21359;
                return !z3 ? new AbstractC7326.C7327(c7364, interfaceC6869, interfaceC7320M10982, interfaceC7311M10979) : z ? new AbstractC7326.C7329(c7364, interfaceC6869, interfaceC7320M10982, interfaceC7311M10979) : new AbstractC7326.C7328(c7364, interfaceC6869, interfaceC7320M10982, interfaceC7311M10979, false);
            } catch (RuntimeException e2) {
                throw C7373.m10990(method, e2, "Unable to create converter for %s", typeMo10955);
            }
        } catch (RuntimeException e3) {
            throw C7373.m10990(method, e3, "Unable to create call adapter for %s", genericReturnType);
        }
    }
}
