package defpackage;

import j$.util.DesugarCollections;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

/* renamed from: ᵭˇⁱ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C4101 {

    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public Long f15322;

    /* renamed from: ˎˏʜʾ, reason: contains not printable characters */
    public final /* synthetic */ int f15323;

    /* renamed from: ˏˋٴ, reason: contains not printable characters */
    public Long f15324;

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public Boolean f15325;

    /* renamed from: ᵝᵵᵺ, reason: contains not printable characters */
    public final AbstractC4985 f15326;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final String f15327;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final int f15328;

    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final /* synthetic */ C3365 f15329;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public Boolean f15330;

    public C4101(C3365 c3365, String str, int i, AbstractC4985 abstractC4985, int i2) {
        this.f15323 = i2;
        this.f15329 = c3365;
        this.f15327 = str;
        this.f15328 = i;
        this.f15326 = abstractC4985;
    }

    /* JADX WARN: Removed duplicated region for block: B:38:0x008a  */
    /* JADX WARN: Removed duplicated region for block: B:80:0x0108  */
    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static java.lang.Boolean m8982(java.math.BigDecimal r8, defpackage.C0676 r9, double r10) {
        /*
            Method dump skipped, instructions count: 281
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C4101.m8982(java.math.BigDecimal, ˁˌˈˎ, double):java.lang.Boolean");
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public static Boolean m8983(Boolean bool, boolean z) {
        if (bool == null) {
            return null;
        }
        return Boolean.valueOf(bool.booleanValue() != z);
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public static Boolean m8984(String str, C2276 c2276, C1736 c1736) {
        List listM5957;
        ᵩʛʽ.ᵝᵵᵺ(c2276);
        if (str != null && c2276.m5956() && c2276.m5951() != 1 && (c2276.m5951() != 7 ? c2276.m5952() : c2276.m5954() != 0)) {
            int iM5951 = c2276.m5951();
            boolean zM5958 = c2276.m5958();
            String strM5955 = (zM5958 || iM5951 == 2 || iM5951 == 7) ? c2276.m5955() : c2276.m5955().toUpperCase(Locale.ENGLISH);
            if (c2276.m5954() == 0) {
                listM5957 = null;
            } else {
                listM5957 = c2276.m5957();
                if (!zM5958) {
                    ArrayList arrayList = new ArrayList(listM5957.size());
                    Iterator it = listM5957.iterator();
                    while (it.hasNext()) {
                        arrayList.add(((String) it.next()).toUpperCase(Locale.ENGLISH));
                    }
                    listM5957 = DesugarCollections.unmodifiableList(arrayList);
                }
            }
            String str2 = iM5951 == 2 ? strM5955 : null;
            if (iM5951 != 7 ? strM5955 != null : listM5957 != null && !listM5957.isEmpty()) {
                if (!zM5958 && iM5951 != 2) {
                    str = str.toUpperCase(Locale.ENGLISH);
                }
                switch (iM5951 - 1) {
                    case 1:
                        if (str2 != null) {
                            try {
                                return Boolean.valueOf(Pattern.compile(str2, true != zM5958 ? 66 : 0).matcher(str).matches());
                            } catch (PatternSyntaxException unused) {
                                if (c1736 != null) {
                                    c1736.f6934.m6039(str2, "Invalid regular expression in REGEXP audience filter. expression");
                                    break;
                                }
                            }
                        }
                        break;
                    case 2:
                        return Boolean.valueOf(str.startsWith(strM5955));
                    case 3:
                        return Boolean.valueOf(str.endsWith(strM5955));
                    case 4:
                        return Boolean.valueOf(str.contains(strM5955));
                    case 5:
                        return Boolean.valueOf(str.equals(strM5955));
                    case C1339.STRING_SET_FIELD_NUMBER /* 6 */:
                        if (listM5957 != null) {
                            return Boolean.valueOf(listM5957.contains(str));
                        }
                        break;
                }
            }
        }
        return null;
    }

    /* JADX WARN: Removed duplicated region for block: B:150:0x035f  */
    /* JADX WARN: Removed duplicated region for block: B:163:0x03ce  */
    /* JADX WARN: Removed duplicated region for block: B:164:0x03d1  */
    /* JADX WARN: Removed duplicated region for block: B:167:0x03da A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:169:0x03dc  */
    /* JADX WARN: Removed duplicated region for block: B:234:0x03c9 A[EDGE_INSN: B:234:0x03c9->B:161:0x03c9 BREAK  A[LOOP:3: B:89:0x0246->B:238:0x0246], SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:58:0x017c  */
    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public boolean m8985(java.lang.Long r22, java.lang.Long r23, defpackage.C2461 r24, long r25, defpackage.C4774 r27, boolean r28) {
        /*
            Method dump skipped, instructions count: 1085
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: defpackage.C4101.m8985(java.lang.Long, java.lang.Long, ᵗᵟ, long, ᵶʣʿᵭ, boolean):boolean");
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public boolean m8986(Long l, Long l2, C3963 c3963, boolean z) {
        boolean z2;
        Boolean boolM8983;
        Boolean boolM8982;
        Boolean boolM89822;
        Boolean boolM89823;
        C4409.m9449();
        C4205 c4205 = (C4205) ((ᵢˇᵭ) this.f15329).ᵧᵾˀˈ;
        C1904 c1904 = c4205.f15726;
        C2862 c2862 = c4205.f15705;
        C1736 c1736 = c4205.f15715;
        boolean zM5353 = c1904.m5353(this.f15327, AbstractC5018.f18696);
        C5226 c5226 = (C5226) this.f15326;
        boolean zM10872 = c5226.m10872();
        boolean zM10871 = c5226.m10871();
        boolean zM10866 = c5226.m10866();
        boolean z3 = zM10872 || zM10871 || zM10866;
        if (z && !z3) {
            C4205.m9132(c1736);
            c1736.f6935.m6037("Property filter already evaluated true and it is not associated with an enhanced audience. audience ID, filter ID", Integer.valueOf(this.f15328), c5226.m10870() ? Integer.valueOf(c5226.m10864()) : null);
            return true;
        }
        C5272 c5272M10867 = c5226.m10867();
        boolean zM10921 = c5272M10867.m10921();
        if (!c3963.m8781()) {
            z2 = zM10866;
            if (!c3963.m8771()) {
                if (!c3963.m8773()) {
                    C4205.m9132(c1736);
                    c1736.f6934.m6039(c2862.m6999(c3963.m8776()), "User property has no value, property");
                } else if (c5272M10867.m10920()) {
                    String strM8782 = c3963.m8782();
                    C2276 c2276M10914 = c5272M10867.m10914();
                    C4205.m9132(c1736);
                    boolM8983 = m8983(m8984(strM8782, c2276M10914, c1736), zM10921);
                } else if (!c5272M10867.m10919()) {
                    C4205.m9132(c1736);
                    c1736.f6934.m6039(c2862.m6999(c3963.m8776()), "No string or number filter defined. property");
                } else if (C1680.m4815(c3963.m8782())) {
                    String strM87822 = c3963.m8782();
                    C0676 c0676M10917 = c5272M10867.m10917();
                    if (C1680.m4815(strM87822)) {
                        try {
                            boolM8982 = m8982(new BigDecimal(strM87822), c0676M10917, 0.0d);
                        } catch (NumberFormatException unused) {
                        }
                        boolM8983 = m8983(boolM8982, zM10921);
                    } else {
                        boolM8982 = null;
                        boolM8983 = m8983(boolM8982, zM10921);
                    }
                } else {
                    C4205.m9132(c1736);
                    c1736.f6934.m6037("Invalid user property value for Numeric number filter. property, value", c2862.m6999(c3963.m8776()), c3963.m8782());
                }
                boolM8983 = null;
            } else if (c5272M10867.m10919()) {
                double dM8767 = c3963.m8767();
                try {
                    boolM89822 = m8982(new BigDecimal(dM8767), c5272M10867.m10917(), Math.ulp(dM8767));
                } catch (NumberFormatException unused2) {
                    boolM89822 = null;
                }
                boolM8983 = m8983(boolM89822, zM10921);
            } else {
                C4205.m9132(c1736);
                c1736.f6934.m6039(c2862.m6999(c3963.m8776()), "No number filter for double property. property");
                boolM8983 = null;
            }
        } else if (c5272M10867.m10919()) {
            z2 = zM10866;
            try {
                boolM89823 = m8982(new BigDecimal(c3963.m8774()), c5272M10867.m10917(), 0.0d);
            } catch (NumberFormatException unused3) {
                boolM89823 = null;
            }
            boolM8983 = m8983(boolM89823, zM10921);
        } else {
            C4205.m9132(c1736);
            c1736.f6934.m6039(c2862.m6999(c3963.m8776()), "No number filter for long property. property");
            z2 = zM10866;
            boolM8983 = null;
        }
        C4205.m9132(c1736);
        c1736.f6935.m6039(boolM8983 == null ? "null" : boolM8983, "Property filter result");
        if (boolM8983 == null) {
            return false;
        }
        this.f15325 = Boolean.TRUE;
        if (!z2 || boolM8983.booleanValue()) {
            if (!z || c5226.m10872()) {
                this.f15330 = boolM8983;
            }
            if (boolM8983.booleanValue() && z3 && c3963.m8777()) {
                long jM8768 = c3963.m8768();
                if (l != null) {
                    jM8768 = l.longValue();
                }
                if (zM5353 && c5226.m10872() && !c5226.m10871() && l2 != null) {
                    jM8768 = l2.longValue();
                }
                if (c5226.m10871()) {
                    this.f15324 = Long.valueOf(jM8768);
                } else {
                    this.f15322 = Long.valueOf(jM8768);
                }
            }
        }
        return true;
    }
}
