package o; /* loaded from: classes.dex */ public final class HNv implements BNe { final BNe c; private int b = 0; private int a = -1; private int e = -1; private Object d = null; public HNv(BNe bNe) { this.c = bNe; } public final void e() { int i = this.b; if (i == 0) { return; } if (i == 1) { this.c.e(this.a, this.e); } else if (i == 2) { this.c.b(this.a, this.e); } else if (i == 3) { this.c.b(this.a, this.e, this.d); } this.d = null; this.b = 0; } @Override // o.BNe public final void e(int i, int i2) { int i3; if (this.b == 1 && i >= (i3 = this.a)) { int i4 = this.e; if (i <= i3 + i4) { this.e = i4 + i2; this.a = Math.min(i, i3); return; } } e(); this.a = i; this.e = i2; this.b = 1; } @Override // o.BNe public final void b(int i, int i2) { int i3; if (this.b == 2 && (i3 = this.a) >= i && i3 <= i + i2) { this.e += i2; this.a = i; } else { e(); this.a = i; this.e = i2; this.b = 2; } } @Override // o.BNe public final void c(int i, int i2) { e(); this.c.c(i, i2); } @Override // o.BNe public final void b(int i, int i2, Object obj) { int i3; int i4; int i5; if (this.b == 3 && i <= (i4 = this.e + (i3 = this.a)) && (i5 = i + i2) >= i3 && this.d == obj) { this.a = Math.min(i, i3); this.e = Math.max(i4, i5) - this.a; return; } e(); this.a = i; this.e = i2; this.d = obj; this.b = 3; } }