package androidx.appcompat.widget;

/* JADX INFO: compiled from: RtlSpacingHelper.java */
/* JADX INFO: loaded from: classes.dex */
class l0 {
    private int a = 0;
    private int b = 0;
    private int c = Integer.MIN_VALUE;
    private int d = Integer.MIN_VALUE;
    private int e = 0;
    private int f = 0;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private boolean f185g = false;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private boolean f186h = false;

    l0() {
    }

    public int a() {
        return this.f185g ? this.a : this.b;
    }

    public int b() {
        return this.a;
    }

    public int c() {
        return this.b;
    }

    public int d() {
        return this.f185g ? this.b : this.a;
    }

    public void e(int i2, int i3) {
        this.f186h = false;
        if (i2 != Integer.MIN_VALUE) {
            this.e = i2;
            this.a = i2;
        }
        if (i3 != Integer.MIN_VALUE) {
            this.f = i3;
            this.b = i3;
        }
    }

    public void f(boolean z) {
        if (z == this.f185g) {
            return;
        }
        this.f185g = z;
        if (!this.f186h) {
            this.a = this.e;
            this.b = this.f;
            return;
        }
        if (z) {
            int i2 = this.d;
            if (i2 == Integer.MIN_VALUE) {
                i2 = this.e;
            }
            this.a = i2;
            int i3 = this.c;
            if (i3 == Integer.MIN_VALUE) {
                i3 = this.f;
            }
            this.b = i3;
            return;
        }
        int i4 = this.c;
        if (i4 == Integer.MIN_VALUE) {
            i4 = this.e;
        }
        this.a = i4;
        int i5 = this.d;
        if (i5 == Integer.MIN_VALUE) {
            i5 = this.f;
        }
        this.b = i5;
    }

    public void g(int i2, int i3) {
        this.c = i2;
        this.d = i3;
        this.f186h = true;
        if (this.f185g) {
            if (i3 != Integer.MIN_VALUE) {
                this.a = i3;
            }
            if (i2 != Integer.MIN_VALUE) {
                this.b = i2;
                return;
            }
            return;
        }
        if (i2 != Integer.MIN_VALUE) {
            this.a = i2;
        }
        if (i3 != Integer.MIN_VALUE) {
            this.b = i3;
        }
    }
}
