package o; import java.util.Stack; /* loaded from: classes6.dex */ public final class ghV implements Cloneable { public boolean a; public boolean b; public boolean c; public Stack d; public ghV() { this.d = new Stack<>(); this.b = true; this.a = false; this.c = false; } private ghV(Stack stack, boolean z, boolean z2, boolean z3) { this.d = stack; this.b = z; this.a = z2; this.c = z3; } public final int e() { if (this.d.isEmpty()) { throw new IllegalStateException("Tag not yet read."); } return this.d.peek().e; } public final void a(int i) { if (this.d.isEmpty()) { return; } Sts peek = this.d.peek(); int i2 = peek.d - peek.c; if (i > i2) { StringBuilder sb = new StringBuilder("Cannot process "); sb.append(i); sb.append(" bytes! Only "); sb.append(i2); sb.append(" bytes left in this TLV object "); sb.append(peek); throw new IllegalArgumentException(sb.toString()); } peek.c += i; int i3 = peek.d; if (peek.c != i3) { this.b = false; this.a = false; this.c = true; } else { this.d.pop(); a(i3); this.b = true; this.a = false; this.c = false; } } public final Object clone() { Stack stack = new Stack(); for (int i = 0; i < this.d.size(); i++) { stack.add((Sts) this.d.get(i).clone()); } return new ghV(stack, this.b, this.a, this.c); } public final String toString() { return this.d.toString(); } /* loaded from: classes6.dex */ public class Sts implements Cloneable { private ghV b; int e; public int d = Integer.MAX_VALUE; public int c = 0; public Sts(ghV ghv, int i) { this.b = ghv; this.e = i; } public final Object clone() { Sts sts = new Sts(this.b, this.e); sts.d = this.d; sts.c = this.c; return sts; } public final String toString() { StringBuilder sb = new StringBuilder("[TLStruct "); sb.append(Integer.toHexString(this.e)); sb.append(", "); sb.append(this.d); sb.append(", "); sb.append(this.c); sb.append("]"); return sb.toString(); } } }