package pb;

import com.google.zxing.BarcodeFormat;
import com.google.zxing.DecodeHintType;
import com.google.zxing.FormatException;
import com.google.zxing.NotFoundException;
import com.google.zxing.ResultMetadataType;
import java.util.List;
import java.util.Map;
import ob.e;
import ob.f;
import ob.g;
import ob.h;
import tb.c;

/* JADX INFO: loaded from: classes.dex */
public final class b implements e {
    /* JADX WARN: Removed duplicated region for block: B:24:0x0040  */
    /* JADX WARN: Removed duplicated region for block: B:36:0x0064  */
    /* JADX WARN: Removed duplicated region for block: B:40:0x0071 A[LOOP:0: B:39:0x006f->B:40:0x0071, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:43:0x008d  */
    /* JADX WARN: Removed duplicated region for block: B:46:0x0096  */
    @Override // ob.e
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final f a(xyz.stream.utils.f fVar, Map map) throws NotFoundException, FormatException {
        g[] gVarArr;
        int i10;
        int i11;
        g[] gVarArr2;
        FormatException formatException;
        g[] gVarArr3;
        List list;
        String str;
        h hVar;
        a aVarA;
        qb.a aVar = new qb.a(fVar.o());
        c cVarA = null;
        try {
            aVarA = aVar.a(false);
            gVarArr = (g[]) aVarA.f36129c;
        } catch (FormatException e10) {
            e = e10;
            gVarArr = null;
        } catch (NotFoundException e11) {
            e = e11;
            gVarArr = null;
        }
        try {
            i10 = aVarA.f31924h;
            try {
                i11 = i10;
                gVarArr2 = gVarArr;
                formatException = null;
                cVarA = new com.google.zxing.aztec.decoder.a().a(aVarA);
                e = null;
            } catch (FormatException e12) {
                e = e12;
                i11 = i10;
                gVarArr2 = gVarArr;
                formatException = e;
                e = null;
            } catch (NotFoundException e13) {
                e = e13;
                i11 = i10;
                gVarArr2 = gVarArr;
                formatException = null;
            }
        } catch (FormatException e14) {
            e = e14;
            i10 = 0;
            i11 = i10;
            gVarArr2 = gVarArr;
            formatException = e;
            e = null;
            if (cVarA == null) {
            }
            int i12 = i11;
            gVarArr3 = gVarArr2;
            if (map != null) {
                while (i < r2) {
                }
            }
            String str2 = cVarA.f33010b;
            byte[] bArr = cVarA.f33009a;
            BarcodeFormat barcodeFormat = BarcodeFormat.f24302a;
            System.currentTimeMillis();
            f fVar2 = new f(str2, bArr, gVarArr3, barcodeFormat, 0);
            list = cVarA.f33011c;
            if (list != null) {
            }
            str = cVarA.f33012d;
            if (str != null) {
            }
            fVar2.b(ResultMetadataType.f24335d, Integer.valueOf(cVarA.f33013e.intValue() + i12));
            fVar2.b(ResultMetadataType.f24344m, "]z" + cVarA.f33018j);
            return fVar2;
        } catch (NotFoundException e15) {
            e = e15;
            i10 = 0;
            i11 = i10;
            gVarArr2 = gVarArr;
            formatException = null;
            if (cVarA == null) {
            }
            int i122 = i11;
            gVarArr3 = gVarArr2;
            if (map != null) {
            }
            String str22 = cVarA.f33010b;
            byte[] bArr2 = cVarA.f33009a;
            BarcodeFormat barcodeFormat2 = BarcodeFormat.f24302a;
            System.currentTimeMillis();
            f fVar22 = new f(str22, bArr2, gVarArr3, barcodeFormat2, 0);
            list = cVarA.f33011c;
            if (list != null) {
            }
            str = cVarA.f33012d;
            if (str != null) {
            }
            fVar22.b(ResultMetadataType.f24335d, Integer.valueOf(cVarA.f33013e.intValue() + i122));
            fVar22.b(ResultMetadataType.f24344m, "]z" + cVarA.f33018j);
            return fVar22;
        }
        if (cVarA == null) {
            try {
                a aVarA2 = aVar.a(true);
                gVarArr2 = (g[]) aVarA2.f36129c;
                i11 = aVarA2.f31924h;
                cVarA = new com.google.zxing.aztec.decoder.a().a(aVarA2);
            } catch (FormatException | NotFoundException e16) {
                if (e != null) {
                    throw e;
                }
                if (formatException != null) {
                    throw formatException;
                }
                throw e16;
            }
        }
        int i1222 = i11;
        gVarArr3 = gVarArr2;
        if (map != null && (hVar = (h) map.get(DecodeHintType.f24324i)) != null) {
            for (g gVar : gVarArr3) {
                hVar.a(gVar);
            }
        }
        String str222 = cVarA.f33010b;
        byte[] bArr22 = cVarA.f33009a;
        BarcodeFormat barcodeFormat22 = BarcodeFormat.f24302a;
        System.currentTimeMillis();
        f fVar222 = new f(str222, bArr22, gVarArr3, barcodeFormat22, 0);
        list = cVarA.f33011c;
        if (list != null) {
            fVar222.b(ResultMetadataType.f24333b, list);
        }
        str = cVarA.f33012d;
        if (str != null) {
            fVar222.b(ResultMetadataType.f24334c, str);
        }
        fVar222.b(ResultMetadataType.f24335d, Integer.valueOf(cVarA.f33013e.intValue() + i1222));
        fVar222.b(ResultMetadataType.f24344m, "]z" + cVarA.f33018j);
        return fVar222;
    }

    @Override // ob.e
    public final f b(xyz.stream.utils.f fVar) {
        return a(fVar, null);
    }

    @Override // ob.e
    public final void reset() {
    }
}
