package o; /* loaded from: classes6.dex */ public final class gpQ extends AbstractC15346gnv { public C15396gpM a; private int b; public gpP c; public gpT d; public gpQ(AbstractC15317gnH abstractC15317gnH) { this.b = 1; if (abstractC15317gnH.e() > 3) { StringBuilder sb = new StringBuilder("Bad sequence size: "); sb.append(abstractC15317gnH.e()); throw new IllegalArgumentException(sb.toString()); } for (int i = 0; i != abstractC15317gnH.e(); i++) { AbstractC15321gnP d = AbstractC15321gnP.d(abstractC15317gnH.d(i)); int i2 = d.e; if (i2 == 0) { AbstractC15317gnH b = AbstractC15317gnH.b(d, false); this.a = b != null ? new C15396gpM(AbstractC15317gnH.a(b)) : null; } else if (i2 != 1) { if (i2 != 2) { throw new IllegalArgumentException("unknown tag in Holder"); } AbstractC15317gnH b2 = AbstractC15317gnH.b(d, false); this.d = b2 != null ? new gpT(AbstractC15317gnH.a(b2)) : null; } else { AbstractC15317gnH b3 = AbstractC15317gnH.b(d, false); this.c = b3 != null ? new gpP(AbstractC15317gnH.a(b3)) : null; } } this.b = 1; } @Override // o.AbstractC15346gnv, o.InterfaceC15342gnr public final AbstractC15315gnE i() { if (this.b != 1) { if (this.c != null) { return new C15355goI(true, 1, this.c); } return new C15355goI(true, 0, this.a); } C15343gns c15343gns = new C15343gns(); if (this.a != null) { c15343gns.a.addElement(new C15355goI(false, 0, this.a)); } if (this.c != null) { c15343gns.a.addElement(new C15355goI(false, 1, this.c)); } if (this.d != null) { c15343gns.a.addElement(new C15355goI(false, 2, this.d)); } return new C15385goy(c15343gns); } }