package o;

import java.util.ArrayList;
import java.util.Iterator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.u90, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2599u90 implements Iterable, InterfaceC2989yJ {
    public static final C2599u90 p = new C2599u90(0, 0, 0, null);
    public final long l;
    public final long m;
    public final long n;

    /* renamed from: o, reason: collision with root package name */
    public final long[] f741o;

    public C2599u90(long j, long j2, long j3, long[] jArr) {
        this.l = j;
        this.m = j2;
        this.n = j3;
        this.f741o = jArr;
    }

    public final C2599u90 a(C2599u90 c2599u90) {
        C2599u90 c2599u90B;
        long j;
        long[] jArr;
        C2599u90 c2599u902 = p;
        if (c2599u90 == c2599u902) {
            return this;
        }
        if (this == c2599u902) {
            return c2599u902;
        }
        long j2 = c2599u90.n;
        long j3 = c2599u90.n;
        long[] jArr2 = c2599u90.f741o;
        long j4 = c2599u90.m;
        long j5 = c2599u90.l;
        long j6 = this.n;
        if (j2 == j6 && jArr2 == (jArr = this.f741o)) {
            return new C2599u90(this.l & (~j5), this.m & (~j4), j6, jArr);
        }
        if (jArr2 != null) {
            c2599u90B = this;
            for (long j7 : jArr2) {
                c2599u90B = c2599u90B.b(j7);
            }
        } else {
            c2599u90B = this;
        }
        long j8 = 0;
        if (j4 != 0) {
            int i = 0;
            while (i < 64) {
                if (((1 << i) & j4) != j8) {
                    j = j8;
                    c2599u90B = c2599u90B.b(i + j3);
                } else {
                    j = j8;
                }
                i++;
                j8 = j;
            }
        }
        long j9 = j8;
        if (j5 != j9) {
            for (int i2 = 0; i2 < 64; i2++) {
                if (((1 << i2) & j5) != j9) {
                    c2599u90B = c2599u90B.b(i2 + j3 + 64);
                }
            }
        }
        return c2599u90B;
    }

    public final C2599u90 b(long j) {
        long[] jArr;
        int iH;
        long[] jArr2;
        long j2 = j - this.n;
        long j3 = 0;
        if (F3.n(j2, j3) >= 0 && F3.n(j2, 64) < 0) {
            long j4 = 1 << ((int) j2);
            long j5 = this.m;
            if ((j5 & j4) != 0) {
                return new C2599u90(this.l, j5 & (~j4), this.n, this.f741o);
            }
        } else if (F3.n(j2, 64) >= 0 && F3.n(j2, 128) < 0) {
            long j6 = 1 << (((int) j2) - 64);
            long j7 = this.l;
            if ((j7 & j6) != 0) {
                return new C2599u90(j7 & (~j6), this.m, this.n, this.f741o);
            }
        } else if (F3.n(j2, j3) < 0 && (jArr = this.f741o) != null && (iH = AbstractC0662Zn.h(jArr, j)) >= 0) {
            int length = jArr.length;
            int i = length - 1;
            if (i == 0) {
                jArr2 = null;
            } else {
                long[] jArr3 = new long[i];
                if (iH > 0) {
                    AbstractC2219q9.K(jArr, jArr3, 0, 0, iH);
                }
                if (iH < i) {
                    AbstractC2219q9.K(jArr, jArr3, iH, iH + 1, length);
                }
                jArr2 = jArr3;
            }
            return new C2599u90(this.l, this.m, this.n, jArr2);
        }
        return this;
    }

    public final boolean c(long j) {
        long[] jArr;
        long j2 = j - this.n;
        long j3 = 0;
        return (F3.n(j2, j3) < 0 || F3.n(j2, (long) 64) >= 0) ? (F3.n(j2, (long) 64) < 0 || F3.n(j2, (long) 128) >= 0) ? F3.n(j2, j3) <= 0 && (jArr = this.f741o) != null && AbstractC0662Zn.h(jArr, j) >= 0 : ((1 << (((int) j2) - 64)) & this.l) != 0 : ((1 << ((int) j2)) & this.m) != 0;
    }

    public final C2599u90 d(C2599u90 c2599u90) {
        C2599u90 c2599u90E;
        C2599u90 c2599u90E2;
        long[] jArr;
        C2599u90 c2599u902 = p;
        if (c2599u90 == c2599u902) {
            return this;
        }
        if (this == c2599u902) {
            return c2599u90;
        }
        long j = c2599u90.n;
        long j2 = c2599u90.n;
        long[] jArr2 = c2599u90.f741o;
        long j3 = c2599u90.m;
        long j4 = c2599u90.l;
        long j5 = this.n;
        long j6 = this.m;
        long j7 = this.l;
        if (j == j5 && jArr2 == (jArr = this.f741o)) {
            return new C2599u90(j7 | j4, j6 | j3, j5, jArr);
        }
        int i = 0;
        long[] jArr3 = this.f741o;
        if (jArr3 != null) {
            if (jArr2 != null) {
                c2599u90E = this;
                for (long j8 : jArr2) {
                    c2599u90E = c2599u90E.e(j8);
                }
            } else {
                c2599u90E = this;
            }
            if (j3 != 0) {
                for (int i2 = 0; i2 < 64; i2++) {
                    if (((1 << i2) & j3) != 0) {
                        c2599u90E = c2599u90E.e(i2 + j2);
                    }
                }
            }
            if (j4 != 0) {
                while (i < 64) {
                    if (((1 << i) & j4) != 0) {
                        c2599u90E = c2599u90E.e(i + j2 + 64);
                    }
                    i++;
                }
            }
            return c2599u90E;
        }
        if (jArr3 != null) {
            c2599u90E2 = c2599u90;
            for (long j9 : jArr3) {
                c2599u90E2 = c2599u90E2.e(j9);
            }
        } else {
            c2599u90E2 = c2599u90;
        }
        long j10 = this.n;
        if (j6 != 0) {
            for (int i3 = 0; i3 < 64; i3++) {
                if (((1 << i3) & j6) != 0) {
                    c2599u90E2 = c2599u90E2.e(i3 + j10);
                }
            }
        }
        if (j7 != 0) {
            while (i < 64) {
                if (((1 << i) & j7) != 0) {
                    c2599u90E2 = c2599u90E2.e(i + j10 + 64);
                }
                i++;
            }
        }
        return c2599u90E2;
    }

    /* JADX WARN: Removed duplicated region for block: B:57:0x010e  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final o.C2599u90 e(long r30) {
        /*
            Method dump skipped, instructions count: 341
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C2599u90.e(long):o.u90");
    }

    @Override // java.lang.Iterable
    public final Iterator iterator() {
        return AbstractC2461sm0.C(new C2504t90(this, null));
    }

    public final String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(super.toString());
        sb.append(" [");
        ArrayList arrayList = new ArrayList(AbstractC0034Bi.W(this, 10));
        Iterator it = iterator();
        while (it.hasNext()) {
            arrayList.add(String.valueOf(((Number) it.next()).longValue()));
        }
        StringBuilder sb2 = new StringBuilder();
        sb2.append((CharSequence) "");
        int size = arrayList.size();
        int i = 0;
        for (int i2 = 0; i2 < size; i2++) {
            Object obj = arrayList.get(i2);
            i++;
            if (i > 1) {
                sb2.append((CharSequence) ", ");
            }
            if (obj != null ? obj instanceof CharSequence : true) {
                sb2.append((CharSequence) obj);
            } else if (obj instanceof Character) {
                sb2.append(((Character) obj).charValue());
            } else {
                sb2.append((CharSequence) obj.toString());
            }
        }
        sb2.append((CharSequence) "");
        sb.append(sb2.toString());
        sb.append(']');
        return sb.toString();
    }
}
