package defpackage;

import android.view.View;
import java.util.Arrays;

/* JADX INFO: renamed from: ᵬˎ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C4048 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public int f15536;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public int f15537;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public boolean f15538;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final /* synthetic */ int f15539 = 1;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public boolean f15540;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public Object f15541;

    public C4048() {
        m8858();
    }

    public C4048(int i) {
        this.f15536 = i;
        byte[] bArr = new byte[131];
        this.f15541 = bArr;
        bArr[2] = 1;
    }

    public C4048(C4220 c4220) {
        this.f15541 = c4220;
    }

    public String toString() {
        switch (this.f15539) {
            case 1:
                return "AnchorInfo{mPosition=" + this.f15536 + ", mCoordinate=" + this.f15537 + ", mLayoutFromEnd=" + this.f15540 + ", mValid=" + this.f15538 + '}';
            default:
                return super.toString();
        }
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public void m8852() {
        boolean z = this.f15540;
        AbstractC3010 abstractC3010 = (AbstractC3010) this.f15541;
        this.f15537 = z ? abstractC3010.mo1733() : abstractC3010.mo1734();
    }

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public void m8853(View view, int i) {
        AbstractC3010 abstractC3010 = (AbstractC3010) this.f15541;
        int iMo1731 = Integer.MIN_VALUE == abstractC3010.f11598 ? 0 : abstractC3010.mo1731() - abstractC3010.f11598;
        if (iMo1731 >= 0) {
            boolean z = this.f15540;
            AbstractC3010 abstractC30102 = (AbstractC3010) this.f15541;
            if (z) {
                int iMo1724 = abstractC30102.mo1724(view);
                AbstractC3010 abstractC30103 = (AbstractC3010) this.f15541;
                this.f15537 = (Integer.MIN_VALUE != abstractC30103.f11598 ? abstractC30103.mo1731() - abstractC30103.f11598 : 0) + iMo1724;
            } else {
                this.f15537 = abstractC30102.mo1729(view);
            }
            this.f15536 = i;
            return;
        }
        this.f15536 = i;
        boolean z2 = this.f15540;
        AbstractC3010 abstractC30104 = (AbstractC3010) this.f15541;
        if (!z2) {
            int iMo1729 = abstractC30104.mo1729(view);
            int iMo1734 = iMo1729 - ((AbstractC3010) this.f15541).mo1734();
            this.f15537 = iMo1729;
            if (iMo1734 > 0) {
                int iMo1733 = (((AbstractC3010) this.f15541).mo1733() - Math.min(0, (((AbstractC3010) this.f15541).mo1733() - iMo1731) - ((AbstractC3010) this.f15541).mo1724(view))) - (((AbstractC3010) this.f15541).mo1727(view) + iMo1729);
                if (iMo1733 < 0) {
                    this.f15537 -= Math.min(iMo1734, -iMo1733);
                    return;
                }
                return;
            }
            return;
        }
        int iMo17332 = (abstractC30104.mo1733() - iMo1731) - ((AbstractC3010) this.f15541).mo1724(view);
        this.f15537 = ((AbstractC3010) this.f15541).mo1733() - iMo17332;
        if (iMo17332 > 0) {
            int iMo1727 = this.f15537 - ((AbstractC3010) this.f15541).mo1727(view);
            int iMo17342 = ((AbstractC3010) this.f15541).mo1734();
            int iMin = iMo1727 - (Math.min(((AbstractC3010) this.f15541).mo1729(view) - iMo17342, 0) + iMo17342);
            if (iMin < 0) {
                this.f15537 = Math.min(iMo17332, -iMin) + this.f15537;
            }
        }
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public void m8854(int i) {
        this.f15540 |= i > 0;
        this.f15536 += i;
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public void m8855(byte[] bArr, int i, int i2) {
        if (this.f15540) {
            int i3 = i2 - i;
            byte[] bArr2 = (byte[]) this.f15541;
            int length = bArr2.length;
            int i4 = this.f15537 + i3;
            if (length < i4) {
                this.f15541 = Arrays.copyOf(bArr2, i4 * 2);
            }
            System.arraycopy(bArr, i, (byte[]) this.f15541, this.f15537, i3);
            this.f15537 += i3;
        }
    }

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public void m8856(int i) {
        ᵻᵪ.ˌᴵ(!this.f15540);
        boolean z = i == this.f15536;
        this.f15540 = z;
        if (z) {
            this.f15537 = 3;
            this.f15538 = false;
        }
    }

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public boolean m8857(int i) {
        if (!this.f15540) {
            return false;
        }
        this.f15537 -= i;
        this.f15540 = false;
        this.f15538 = true;
        return true;
    }

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public void m8858() {
        switch (this.f15539) {
            case 1:
                this.f15536 = -1;
                this.f15537 = Integer.MIN_VALUE;
                this.f15540 = false;
                this.f15538 = false;
                break;
            default:
                this.f15540 = false;
                this.f15538 = false;
                break;
        }
    }
}
