package j$.util.stream;

/* JADX INFO: compiled from: r8-map-id-da1bda724d8b26dc30f90d2ccf434f42461d6c82e7dbdeb074f412e5504de99c */
/* JADX INFO: loaded from: classes2.dex */
public final class i8 extends h5 implements q8 {
    public long b;
    public boolean c;
    public final /* synthetic */ boolean d;
    public final /* synthetic */ h8 e;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public i8(h8 h8Var, l5 l5Var, boolean z) {
        super(l5Var);
        this.e = h8Var;
        this.d = z;
    }

    /* JADX WARN: Removed duplicated region for block: B:8:0x0015  */
    @Override // java.util.function.Consumer
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void accept(Object obj) {
        boolean z;
        if (!this.c) {
            boolean zTest = this.e.m.test(obj);
            this.c = !zTest;
            z = !zTest;
        }
        boolean z2 = this.d;
        if (z2 && !z) {
            this.b++;
        }
        if (z2 || z) {
            this.a.accept(obj);
        }
    }

    @Override // j$.util.stream.q8
    public final long h() {
        return this.b;
    }
}
