package androidx.recyclerview.widget;

import o0.C2631b;
import x.EnumC3207z0;

/* JADX INFO: renamed from: androidx.recyclerview.widget.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1152b {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public long f13026b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Object f13027c;

    public /* synthetic */ C1152b(Object obj, long j4, int i6) {
        this.f13025a = i6;
        this.f13027c = obj;
        this.f13026b = j4;
    }

    public long a(long j4, float f6, long j6) {
        long jE = C2631b.e(this.f13026b, C2631b.d(j4, j6));
        this.f13026b = jE;
        if ((((EnumC3207z0) this.f13027c) == null ? C2631b.c(jE) : Math.abs(g(jE))) < f6) {
            return 9205357640488583168L;
        }
        if (((EnumC3207z0) this.f13027c) == null) {
            long j7 = this.f13026b;
            float fC = C2631b.c(j7);
            return C2631b.d(this.f13026b, C2631b.f(f6, (((long) Float.floatToRawIntBits(Float.intBitsToFloat((int) (j7 >> 32)) / fC)) << 32) | (4294967295L & ((long) Float.floatToRawIntBits(Float.intBitsToFloat((int) (j7 & 4294967295L)) / fC)))));
        }
        float fG = g(this.f13026b) - (Math.signum(g(this.f13026b)) * f6);
        long j8 = this.f13026b;
        EnumC3207z0 enumC3207z0 = (EnumC3207z0) this.f13027c;
        EnumC3207z0 enumC3207z02 = EnumC3207z0.f25985b;
        float fIntBitsToFloat = Float.intBitsToFloat((int) (enumC3207z0 == enumC3207z02 ? j8 & 4294967295L : j8 >> 32));
        if (((EnumC3207z0) this.f13027c) == enumC3207z02) {
            return (((long) Float.floatToRawIntBits(fG)) << 32) | (((long) Float.floatToRawIntBits(fIntBitsToFloat)) & 4294967295L);
        }
        return (((long) Float.floatToRawIntBits(fIntBitsToFloat)) << 32) | (((long) Float.floatToRawIntBits(fG)) & 4294967295L);
    }

    public void b(int i6) {
        if (i6 < 64) {
            this.f13026b &= ~(1 << i6);
            return;
        }
        C1152b c1152b = (C1152b) this.f13027c;
        if (c1152b != null) {
            c1152b.b(i6 - 64);
        }
    }

    public int c(int i6) {
        C1152b c1152b = (C1152b) this.f13027c;
        if (c1152b == null) {
            return i6 >= 64 ? Long.bitCount(this.f13026b) : Long.bitCount(this.f13026b & ((1 << i6) - 1));
        }
        if (i6 < 64) {
            return Long.bitCount(this.f13026b & ((1 << i6) - 1));
        }
        return Long.bitCount(this.f13026b) + c1152b.c(i6 - 64);
    }

    public void d() {
        if (((C1152b) this.f13027c) == null) {
            this.f13027c = new C1152b();
        }
    }

    public boolean e(int i6) {
        if (i6 < 64) {
            return (this.f13026b & (1 << i6)) != 0;
        }
        d();
        return ((C1152b) this.f13027c).e(i6 - 64);
    }

    public void f(int i6, boolean z6) {
        if (i6 >= 64) {
            d();
            ((C1152b) this.f13027c).f(i6 - 64, z6);
            return;
        }
        long j4 = this.f13026b;
        boolean z7 = (Long.MIN_VALUE & j4) != 0;
        long j6 = (1 << i6) - 1;
        this.f13026b = ((j4 & (~j6)) << 1) | (j4 & j6);
        if (z6) {
            j(i6);
        } else {
            b(i6);
        }
        if (z7 || ((C1152b) this.f13027c) != null) {
            d();
            ((C1152b) this.f13027c).f(0, z7);
        }
    }

    public float g(long j4) {
        return Float.intBitsToFloat((int) (((EnumC3207z0) this.f13027c) == EnumC3207z0.f25985b ? j4 >> 32 : j4 & 4294967295L));
    }

    public boolean h(int i6) {
        if (i6 >= 64) {
            d();
            return ((C1152b) this.f13027c).h(i6 - 64);
        }
        long j4 = 1 << i6;
        long j6 = this.f13026b;
        boolean z6 = (j6 & j4) != 0;
        long j7 = j6 & (~j4);
        this.f13026b = j7;
        long j8 = j4 - 1;
        this.f13026b = (j7 & j8) | Long.rotateRight((~j8) & j7, 1);
        C1152b c1152b = (C1152b) this.f13027c;
        if (c1152b != null) {
            if (c1152b.e(0)) {
                j(63);
            }
            ((C1152b) this.f13027c).h(0);
        }
        return z6;
    }

    public void i() {
        this.f13026b = 0L;
        C1152b c1152b = (C1152b) this.f13027c;
        if (c1152b != null) {
            c1152b.i();
        }
    }

    public void j(int i6) {
        if (i6 < 64) {
            this.f13026b |= 1 << i6;
        } else {
            d();
            ((C1152b) this.f13027c).j(i6 - 64);
        }
    }

    public String toString() {
        switch (this.f13025a) {
            case 0:
                if (((C1152b) this.f13027c) == null) {
                    return Long.toBinaryString(this.f13026b);
                }
                return ((C1152b) this.f13027c).toString() + "xx" + Long.toBinaryString(this.f13026b);
            default:
                return super.toString();
        }
    }

    public C1152b() {
        this.f13025a = 0;
        this.f13026b = 0L;
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ C1152b(EnumC3207z0 enumC3207z0) {
        this(enumC3207z0, 0L, 2);
        this.f13025a = 2;
    }
}
