package i3;

import java.io.IOException;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicLongArray;
import q3.C0957b;

/* JADX INFO: renamed from: i3.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0634b extends k {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f6657a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ k f6658b;

    public /* synthetic */ C0634b(k kVar, int i) {
        this.f6657a = i;
        this.f6658b = kVar;
    }

    @Override // i3.k
    public final Object a(C0957b c0957b) throws IOException {
        switch (this.f6657a) {
            case 0:
                return new AtomicLong(((Number) this.f6658b.a(c0957b)).longValue());
            case 1:
                ArrayList arrayList = new ArrayList();
                c0957b.a();
                while (c0957b.t()) {
                    arrayList.add(Long.valueOf(((Number) this.f6658b.a(c0957b)).longValue()));
                }
                c0957b.k();
                int size = arrayList.size();
                AtomicLongArray atomicLongArray = new AtomicLongArray(size);
                for (int i = 0; i < size; i++) {
                    atomicLongArray.set(i, ((Long) arrayList.get(i)).longValue());
                }
                return atomicLongArray;
            default:
                if (c0957b.G() != 9) {
                    return this.f6658b.a(c0957b);
                }
                c0957b.C();
                return null;
        }
    }

    @Override // i3.k
    public final void b(q3.c cVar, Object obj) throws IOException {
        switch (this.f6657a) {
            case 0:
                this.f6658b.b(cVar, Long.valueOf(((AtomicLong) obj).get()));
                break;
            case 1:
                AtomicLongArray atomicLongArray = (AtomicLongArray) obj;
                cVar.e();
                int length = atomicLongArray.length();
                for (int i = 0; i < length; i++) {
                    this.f6658b.b(cVar, Long.valueOf(atomicLongArray.get(i)));
                }
                cVar.k();
                break;
            default:
                if (obj == null) {
                    cVar.o();
                } else {
                    this.f6658b.b(cVar, obj);
                }
                break;
        }
    }
}
