package com.google.gson.internal.bind;

import com.bytedance.covode.number.Covode;
import com.google.gson.Gson;
import com.google.gson.a.b;
import com.google.gson.b.a;
import com.google.gson.internal.c;
import com.google.gson.u;
import com.google.gson.v;

public final class JsonAdapterAnnotationTypeAdapterFactory implements v {
    public final c LIZ;

    static {
        Covode.recordClassIndex(45410);
    }

    public JsonAdapterAnnotationTypeAdapterFactory(c cVar) {
        this.LIZ = cVar;
    }

    public final <T> u<T> create(Gson gson, a<T> aVar) {
        b bVar = (b) aVar.rawType.getAnnotation(b.class);
        if (bVar == null) {
            return null;
        }
        return LIZ(this.LIZ, gson, aVar, bVar);
    }

    /* JADX WARNING: Removed duplicated region for block: B:26:? A[RETURN, SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:6:0x001e  */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final com.google.gson.u<?> LIZ(com.google.gson.internal.c r10, com.google.gson.Gson r11, com.google.gson.b.a<?> r12, com.google.gson.a.b r13) {
        /*
            r9 = this;
            java.lang.Class r0 = r13.LIZ()
            com.google.gson.b.a r0 = com.google.gson.b.a.get(r0)
            com.google.gson.internal.h r0 = r10.LIZ(r0)
            java.lang.Object r3 = r0.LIZ()
            boolean r0 = r3 instanceof com.google.gson.u
            if (r0 == 0) goto L_0x0023
            com.google.gson.u r3 = (com.google.gson.u) r3
        L_0x0016:
            if (r3 == 0) goto L_0x0022
        L_0x0018:
            boolean r0 = r13.LIZIZ()
            if (r0 == 0) goto L_0x0022
            com.google.gson.u r3 = r3.nullSafe()
        L_0x0022:
            return r3
        L_0x0023:
            boolean r0 = r3 instanceof com.google.gson.v
            r6 = r11
            r7 = r12
            if (r0 == 0) goto L_0x0030
            com.google.gson.v r3 = (com.google.gson.v) r3
            com.google.gson.u r3 = r3.create(r6, r7)
            goto L_0x0016
        L_0x0030:
            boolean r1 = r3 instanceof com.google.gson.r
            if (r1 != 0) goto L_0x0038
            boolean r0 = r3 instanceof com.google.gson.i
            if (r0 == 0) goto L_0x004e
        L_0x0038:
            r5 = 0
            if (r1 == 0) goto L_0x004c
            r4 = r3
            com.google.gson.r r4 = (com.google.gson.r) r4
        L_0x003e:
            boolean r0 = r3 instanceof com.google.gson.i
            if (r0 == 0) goto L_0x0045
            r5 = r3
            com.google.gson.i r5 = (com.google.gson.i) r5
        L_0x0045:
            com.google.gson.internal.bind.TreeTypeAdapter r3 = new com.google.gson.internal.bind.TreeTypeAdapter
            r8 = 0
            r3.<init>(r4, r5, r6, r7, r8)
            goto L_0x0018
        L_0x004c:
            r4 = r5
            goto L_0x003e
        L_0x004e:
            java.lang.IllegalArgumentException r2 = new java.lang.IllegalArgumentException
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            java.lang.String r0 = "Invalid attempt to bind an instance of "
            r1.<init>(r0)
            java.lang.Class r0 = r3.getClass()
            java.lang.String r0 = r0.getName()
            r1.append(r0)
            java.lang.String r0 = " as a @JsonAdapter for "
            r1.append(r0)
            java.lang.String r0 = r7.toString()
            r1.append(r0)
            java.lang.String r0 = ". @JsonAdapter value must be a TypeAdapter, TypeAdapterFactory, JsonSerializer or JsonDeserializer."
            r1.append(r0)
            java.lang.String r0 = r1.toString()
            r2.<init>(r0)
            throw r2
        */
        throw new UnsupportedOperationException("Method not decompiled: com.google.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory.LIZ(com.google.gson.internal.c, com.google.gson.Gson, com.google.gson.b.a, com.google.gson.a.b):com.google.gson.u");
    }
}
