package o; import com.google.common.primitives.UnsignedBytes; import java.io.IOException; import java.util.Collections; /* loaded from: classes.dex */ public final class KCy implements yYF { @Override // o.yYF public final Iterable c() { return Collections.singletonList(EnumC2874amo.APPD); } @Override // o.yYF public final void d(Iterable iterable, C16613piz c16613piz, EnumC2874amo enumC2874amo) { for (byte[] bArr : iterable) { if (bArr.length != 0 && bArr[0] == 28) { d(new C0629LEh(bArr), c16613piz, bArr.length); } } } public static void d(Eaa eaa, C16613piz c16613piz, long j) { POn pOn = new POn(); c16613piz.c.add(pOn); int i = 0; while (i < j) { try { short b = (short) (eaa.b() & UnsignedBytes.MAX_VALUE); int i2 = i + 1; if (b != 28) { if (i2 != j) { StringBuilder sb = new StringBuilder("Invalid IPTC tag marker at offset "); sb.append(i); sb.append(". Expected '0x"); sb.append(Integer.toHexString(28)); sb.append("' but got '0x"); sb.append(Integer.toHexString(b)); sb.append("'."); BrP.b(new Object[]{pOn, sb.toString()}, -1786863991, 1786863992, System.identityHashCode(pOn)); return; } return; } if (i + 5 > j) { BrP.b(new Object[]{pOn, "Too few bytes remain for a valid IPTC tag"}, -1786863991, 1786863992, System.identityHashCode(pOn)); return; } try { short b2 = (short) (eaa.b() & UnsignedBytes.MAX_VALUE); short b3 = (short) (eaa.b() & UnsignedBytes.MAX_VALUE); int h = eaa.h(); if (h > 32767) { h = ((h & 32767) << 16) | eaa.h(); i2 = i + 3; } i = i2 + 4 + h; if (i > j) { BrP.b(new Object[]{pOn, "Data for tag extends beyond end of IPTC segment"}, -1786863991, 1786863992, System.identityHashCode(pOn)); return; } else { try { d(eaa, pOn, b2, b3, h); } catch (IOException unused) { BrP.b(new Object[]{pOn, "Error processing IPTC tag"}, -1786863991, 1786863992, System.identityHashCode(pOn)); return; } } } catch (IOException unused2) { BrP.b(new Object[]{pOn, "IPTC data segment ended mid-way through tag descriptor"}, -1786863991, 1786863992, System.identityHashCode(pOn)); return; } } catch (IOException unused3) { BrP.b(new Object[]{pOn, "Unable to read starting byte of IPTC tag"}, -1786863991, 1786863992, System.identityHashCode(pOn)); return; } } } /* JADX WARN: Code restructure failed: missing block: B:18:0x0029, code lost: if (r9 != 582) goto L56; */ /* JADX WARN: Removed duplicated region for block: B:23:0x00bd */ /* JADX WARN: Removed duplicated region for block: B:26:0x00e3 */ /* JADX WARN: Removed duplicated region for block: B:32:0x00fd */ /* JADX WARN: Removed duplicated region for block: B:34:0x00c7 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static void d(o.Eaa r7, o.BrP r8, int r9, int r10, int r11) throws java.io.IOException { /* Method dump skipped, instructions count: 271 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: o.KCy.d(o.Eaa, o.BrP, int, int, int):void"); } }