package zb;

import androidx.media3.exoplayer.rtsp.SessionDescription;
import com.google.android.gms.measurement.internal.u1;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.NotFoundException;
import com.google.zxing.ResultMetadataType;
import java.util.EnumMap;

/* JADX INFO: loaded from: classes.dex */
public final class k {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final int[] f37150c = {24, 20, 18, 17, 12, 6, 3, 10, 9, 5};

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final int[] f37151a = new int[4];

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final StringBuilder f37152b = new StringBuilder();

    /* JADX WARN: Removed duplicated region for block: B:31:0x0094  */
    /* JADX WARN: Removed duplicated region for block: B:68:0x011d  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final ob.f a(int i10, tb.a aVar, int[] iArr) throws NotFoundException {
        String str;
        String str2;
        EnumMap enumMap;
        StringBuilder sb = this.f37152b;
        sb.setLength(0);
        int[] iArr2 = this.f37151a;
        iArr2[0] = 0;
        iArr2[1] = 0;
        iArr2[2] = 0;
        iArr2[3] = 0;
        int i11 = aVar.f33004b;
        int iF = iArr[1];
        int i12 = 0;
        for (int i13 = 0; i13 < 5 && iF < i11; i13++) {
            int i14 = m.i(aVar, iArr2, iF, m.f37159g);
            sb.append((char) ((i14 % 10) + 48));
            for (int i15 : iArr2) {
                iF += i15;
            }
            if (i14 >= 10) {
                i12 |= 1 << (4 - i13);
            }
            if (i13 != 4) {
                iF = aVar.f(aVar.e(iF));
            }
        }
        if (sb.length() != 5) {
            throw NotFoundException.a();
        }
        for (int i16 = 0; i16 < 10; i16++) {
            if (i12 == f37150c[i16]) {
                String string = sb.toString();
                int length = string.length();
                int iCharAt = 0;
                for (int i17 = length - 2; i17 >= 0; i17 -= 2) {
                    iCharAt += string.charAt(i17) - '0';
                }
                int iCharAt2 = iCharAt * 3;
                for (int i18 = length - 1; i18 >= 0; i18 -= 2) {
                    iCharAt2 += string.charAt(i18) - '0';
                }
                if ((iCharAt2 * 3) % 10 != i16) {
                    throw NotFoundException.a();
                }
                String string2 = sb.toString();
                if (string2.length() == 5) {
                    char cCharAt = string2.charAt(0);
                    if (cCharAt == '0') {
                        str = "£";
                    } else if (cCharAt != '5') {
                        str = "";
                        if (cCharAt == '9') {
                            string2.hashCode();
                            switch (string2) {
                                case "90000":
                                    str2 = null;
                                    break;
                                case "99990":
                                    str2 = "Used";
                                    break;
                                case "99991":
                                    str2 = "0.00";
                                    break;
                            }
                            if (str2 != null) {
                                enumMap = null;
                            } else {
                                enumMap = new EnumMap(ResultMetadataType.class);
                                enumMap.put(ResultMetadataType.f24338g, str2);
                            }
                        }
                    } else {
                        str = "$";
                    }
                    int i19 = Integer.parseInt(string2.substring(1));
                    String strValueOf = String.valueOf(i19 / 100);
                    int i20 = i19 % 100;
                    str2 = str + strValueOf + '.' + (i20 < 10 ? u1.g(SessionDescription.SUPPORTED_SDP_VERSION, i20) : String.valueOf(i20));
                    if (str2 != null) {
                    }
                }
                float f10 = i10;
                ob.f fVar = new ob.f(string2, null, new ob.g[]{new ob.g((iArr[0] + iArr[1]) / 2.0f, f10), new ob.g(iF, f10)}, BarcodeFormat.T);
                if (enumMap != null) {
                    fVar.a(enumMap);
                }
                return fVar;
            }
        }
        throw NotFoundException.a();
    }
}
