package pl;

import java.util.EnumMap;
import java.util.Map;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class v {

    /* renamed from: a, reason: collision with root package name */
    private final int[] f32911a = new int[4];

    /* renamed from: b, reason: collision with root package name */
    private final StringBuilder f32912b = new StringBuilder();

    private int a(fl.a aVar, int[] iArr, StringBuilder sb2) {
        int[] iArr2 = this.f32911a;
        iArr2[0] = 0;
        iArr2[1] = 0;
        iArr2[2] = 0;
        iArr2[3] = 0;
        int n10 = aVar.n();
        int i10 = iArr[1];
        int i11 = 0;
        for (int i12 = 0; i12 < 2 && i10 < n10; i12++) {
            int j10 = y.j(aVar, iArr2, i10, y.f32923h);
            sb2.append((char) ((j10 % 10) + 48));
            for (int i13 : iArr2) {
                i10 += i13;
            }
            if (j10 >= 10) {
                i11 |= 1 << (1 - i12);
            }
            if (i12 != 1) {
                i10 = aVar.l(aVar.k(i10));
            }
        }
        if (sb2.length() != 2) {
            throw yk.m.a();
        }
        if (Integer.parseInt(sb2.toString()) % 4 == i11) {
            return i10;
        }
        throw yk.m.a();
    }

    private static Map c(String str) {
        if (str.length() != 2) {
            return null;
        }
        EnumMap enumMap = new EnumMap(yk.r.class);
        enumMap.put((EnumMap) yk.r.ISSUE_NUMBER, (yk.r) Integer.valueOf(str));
        return enumMap;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public yk.q b(int i10, fl.a aVar, int[] iArr) {
        StringBuilder sb2 = this.f32912b;
        sb2.setLength(0);
        int a10 = a(aVar, iArr, sb2);
        String sb3 = sb2.toString();
        Map c10 = c(sb3);
        float f10 = i10;
        yk.q qVar = new yk.q(sb3, null, new yk.s[]{new yk.s((iArr[0] + iArr[1]) / 2.0f, f10), new yk.s(a10, f10)}, yk.a.UPC_EAN_EXTENSION);
        if (c10 != null) {
            qVar.g(c10);
        }
        return qVar;
    }
}
