package e.a.u.h;

/* JADX INFO: compiled from: AppendOnlyLinkedArrayList.java */
/* JADX INFO: loaded from: classes.dex */
public class a<T> {
    final int a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    final Object[] f3856b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    Object[] f3857c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    int f3858d;

    /* JADX INFO: renamed from: e.a.u.h.a$a, reason: collision with other inner class name */
    /* JADX INFO: compiled from: AppendOnlyLinkedArrayList.java */
    public interface InterfaceC0119a<T> extends e.a.t.e<T> {
        @Override // e.a.t.e
        boolean test(T t);
    }

    public a(int i2) {
        this.a = i2;
        Object[] objArr = new Object[i2 + 1];
        this.f3856b = objArr;
        this.f3857c = objArr;
    }

    /* JADX WARN: Code restructure failed: missing block: B:19:0x0019, code lost:
    
        continue;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public <U> boolean a(e.a.m<? super U> r5) {
        /*
            r4 = this;
            java.lang.Object[] r0 = r4.f3856b
            int r1 = r4.a
        L4:
            r2 = 0
            if (r0 == 0) goto L1e
        L7:
            if (r2 >= r1) goto L19
            r3 = r0[r2]
            if (r3 != 0) goto Le
            goto L19
        Le:
            boolean r3 = e.a.u.h.e.acceptFull(r3, r5)
            if (r3 == 0) goto L16
            r5 = 1
            return r5
        L16:
            int r2 = r2 + 1
            goto L7
        L19:
            r0 = r0[r1]
            java.lang.Object[] r0 = (java.lang.Object[]) r0
            goto L4
        L1e:
            return r2
        */
        throw new UnsupportedOperationException("Method not decompiled: e.a.u.h.a.a(e.a.m):boolean");
    }

    public void b(T t) {
        int i2 = this.a;
        int i3 = this.f3858d;
        if (i3 == i2) {
            Object[] objArr = new Object[i2 + 1];
            this.f3857c[i2] = objArr;
            this.f3857c = objArr;
            i3 = 0;
        }
        this.f3857c[i3] = t;
        this.f3858d = i3 + 1;
    }

    public void c(InterfaceC0119a<? super T> interfaceC0119a) {
        int i2;
        int i3 = this.a;
        for (Object[] objArr = this.f3856b; objArr != null; objArr = (Object[]) objArr[i3]) {
            while (i2 < i3) {
                Object obj = objArr[i2];
                i2 = (obj == null || interfaceC0119a.test(obj)) ? 0 : i2 + 1;
            }
        }
    }

    public void d(T t) {
        this.f3856b[0] = t;
    }
}
