package o;

import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.yn0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C3033yn0 extends Drawable implements Drawable.Callback {
    public long m;
    public int n;
    public int p;
    public boolean s;
    public final C2843wn0 t;
    public Drawable u;
    public Drawable v;
    public boolean w;
    public boolean x;
    public boolean y;
    public int z;
    public int l = 0;

    /* renamed from: o, reason: collision with root package name */
    public int f812o = 255;
    public int q = 0;
    public final boolean r = true;

    public C3033yn0(C2843wn0 c2843wn0) {
        C2843wn0 c2843wn02 = new C2843wn0();
        if (c2843wn0 != null) {
            c2843wn02.a = c2843wn0.a;
            c2843wn02.b = c2843wn0.b;
        }
        this.t = c2843wn02;
    }

    public final boolean a() {
        if (!this.w) {
            boolean z = false;
            if (this.u.getConstantState() != null && this.v.getConstantState() != null) {
                z = true;
            }
            this.x = z;
            this.w = true;
        }
        return this.x;
    }

    /* JADX WARN: Removed duplicated region for block: B:25:0x005b  */
    /* JADX WARN: Removed duplicated region for block: B:36:? A[RETURN, SYNTHETIC] */
    @Override // android.graphics.drawable.Drawable
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final void draw(android.graphics.Canvas r8) {
        /*
            r7 = this;
            int r0 = r7.l
            r1 = 2
            r2 = 0
            r3 = 1
            if (r0 == r3) goto L3a
            if (r0 == r1) goto Lb
        L9:
            r4 = r3
            goto L43
        Lb:
            long r0 = r7.m
            r4 = 0
            int r0 = (r0 > r4 ? 1 : (r0 == r4 ? 0 : -1))
            if (r0 < 0) goto L9
            long r0 = android.os.SystemClock.uptimeMillis()
            long r4 = r7.m
            long r0 = r0 - r4
            int r4 = r7.p
            float r4 = (float) r4
            float r0 = (float) r0
            float r0 = r0 / r4
            r1 = 1065353216(0x3f800000, float:1.0)
            int r4 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1))
            if (r4 < 0) goto L27
            r4 = r3
            goto L28
        L27:
            r4 = r2
        L28:
            if (r4 == 0) goto L2c
            r7.l = r2
        L2c:
            float r0 = java.lang.Math.min(r0, r1)
            int r1 = r7.n
            float r1 = (float) r1
            float r1 = r1 * r0
            r0 = 0
            float r1 = r1 + r0
            int r0 = (int) r1
            r7.q = r0
            goto L43
        L3a:
            long r4 = android.os.SystemClock.uptimeMillis()
            r7.m = r4
            r7.l = r1
            r4 = r2
        L43:
            int r0 = r7.q
            android.graphics.drawable.Drawable r1 = r7.u
            android.graphics.drawable.Drawable r5 = r7.v
            boolean r6 = r7.r
            if (r4 == 0) goto L62
            if (r6 == 0) goto L52
            if (r0 != 0) goto L57
            goto L53
        L52:
            r2 = r0
        L53:
            r1.draw(r8)
            r0 = r2
        L57:
            int r1 = r7.f812o
            if (r0 != r1) goto L61
            r5.setAlpha(r1)
            r5.draw(r8)
        L61:
            return
        L62:
            if (r6 == 0) goto L6b
            int r2 = r7.f812o
            int r2 = r2 - r0
            r1.setAlpha(r2)
            r2 = r3
        L6b:
            r1.draw(r8)
            if (r2 == 0) goto L75
            int r2 = r7.f812o
            r1.setAlpha(r2)
        L75:
            if (r0 <= 0) goto L82
            r5.setAlpha(r0)
            r5.draw(r8)
            int r8 = r7.f812o
            r5.setAlpha(r8)
        L82:
            r7.invalidateSelf()
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: o.C3033yn0.draw(android.graphics.Canvas):void");
    }

    @Override // android.graphics.drawable.Drawable
    public final int getChangingConfigurations() {
        int changingConfigurations = super.getChangingConfigurations();
        C2843wn0 c2843wn0 = this.t;
        return changingConfigurations | c2843wn0.a | c2843wn0.b;
    }

    @Override // android.graphics.drawable.Drawable
    public final Drawable.ConstantState getConstantState() {
        if (!a()) {
            return null;
        }
        int changingConfigurations = getChangingConfigurations();
        C2843wn0 c2843wn0 = this.t;
        c2843wn0.a = changingConfigurations;
        return c2843wn0;
    }

    @Override // android.graphics.drawable.Drawable
    public final int getIntrinsicHeight() {
        return Math.max(this.u.getIntrinsicHeight(), this.v.getIntrinsicHeight());
    }

    @Override // android.graphics.drawable.Drawable
    public final int getIntrinsicWidth() {
        return Math.max(this.u.getIntrinsicWidth(), this.v.getIntrinsicWidth());
    }

    @Override // android.graphics.drawable.Drawable
    public final int getOpacity() {
        if (!this.y) {
            this.z = Drawable.resolveOpacity(this.u.getOpacity(), this.v.getOpacity());
            this.y = true;
        }
        return this.z;
    }

    @Override // android.graphics.drawable.Drawable.Callback
    public final void invalidateDrawable(Drawable drawable) {
        Drawable.Callback callback = getCallback();
        if (callback != null) {
            callback.invalidateDrawable(this);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public final Drawable mutate() {
        if (this.s || super.mutate() != this) {
            return this;
        }
        if (!a()) {
            throw new IllegalStateException("One or more children of this LayerDrawable does not have constant state; this drawable cannot be mutated.");
        }
        this.u.mutate();
        this.v.mutate();
        this.s = true;
        return this;
    }

    @Override // android.graphics.drawable.Drawable
    public final void onBoundsChange(Rect rect) {
        this.u.setBounds(rect);
        this.v.setBounds(rect);
    }

    @Override // android.graphics.drawable.Drawable.Callback
    public final void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
        Drawable.Callback callback = getCallback();
        if (callback != null) {
            callback.scheduleDrawable(this, runnable, j);
        }
    }

    @Override // android.graphics.drawable.Drawable
    public final void setAlpha(int i) {
        if (this.q == this.f812o) {
            this.q = i;
        }
        this.f812o = i;
        invalidateSelf();
    }

    @Override // android.graphics.drawable.Drawable
    public final void setColorFilter(ColorFilter colorFilter) {
        this.u.setColorFilter(colorFilter);
        this.v.setColorFilter(colorFilter);
    }

    @Override // android.graphics.drawable.Drawable.Callback
    public final void unscheduleDrawable(Drawable drawable, Runnable runnable) {
        Drawable.Callback callback = getCallback();
        if (callback != null) {
            callback.unscheduleDrawable(this, runnable);
        }
    }
}
