package f;

/* JADX INFO: renamed from: f.f, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C0460f {

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

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private int f3863c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private int[] f3864d;

    private void a(int i2, int i3, int i4) {
        if (this.f3864d == null) {
            this.f3864d = new int[6];
        }
        int i5 = this.f3863c;
        int[] iArr = this.f3864d;
        if (i5 >= iArr.length) {
            int[] iArr2 = new int[iArr.length + 6];
            System.arraycopy(iArr, 0, iArr2, 0, iArr.length);
            this.f3864d = iArr2;
        }
        int[] iArr3 = this.f3864d;
        int i6 = this.f3863c;
        int i7 = i6 + 1;
        this.f3863c = i7;
        iArr3[i6] = i2;
        this.f3863c = i6 + 2;
        iArr3[i7] = i3 | i4;
    }

    void b(i iVar, C0455a c0455a, int i2, boolean z2) {
        if ((this.f3861a & 2) != 0) {
            if (z2) {
                c0455a.f(this.f3862b - i2);
                return;
            } else {
                c0455a.g(this.f3862b - i2);
                return;
            }
        }
        if (z2) {
            a(i2, c0455a.f3823b, 536870912);
            c0455a.f(-1);
        } else {
            a(i2, c0455a.f3823b, 268435456);
            c0455a.g(-1);
        }
    }

    void c(i iVar, int i2, byte[] bArr) {
        this.f3861a |= 2;
        this.f3862b = i2;
        int i3 = 0;
        while (i3 < this.f3863c) {
            int[] iArr = this.f3864d;
            int i4 = i3 + 1;
            int i5 = iArr[i3];
            i3 += 2;
            int i6 = iArr[i4];
            int i7 = 268435455 & i6;
            int i8 = i2 - i5;
            if ((i6 & (-268435456)) == 268435456) {
                bArr[i7] = (byte) (i8 >>> 8);
                bArr[i7 + 1] = (byte) i8;
            } else {
                bArr[i7] = (byte) (i8 >>> 24);
                bArr[i7 + 1] = (byte) (i8 >>> 16);
                bArr[i7 + 2] = (byte) (i8 >>> 8);
                bArr[i7 + 3] = (byte) i8;
            }
        }
    }
}
