package com.google.android.gms.measurement.internal;

import androidx.collection.a;
import com.google.android.gms.internal.measurement.zzfo;
import com.google.android.gms.internal.measurement.zzfy;
import java.util.HashSet;
import java.util.Iterator;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzx extends zzaa {
    private zzfo.zzb zzg;
    private final /* synthetic */ zzt zzh;

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public zzx(zzt zztVar, String str, int i10, zzfo.zzb zzbVar) {
        super(str, i10);
        this.zzh = zztVar;
        this.zzg = zzbVar;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    @Override // com.google.android.gms.measurement.internal.zzaa
    public final int zza() {
        return this.zzg.zzb();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    @Override // com.google.android.gms.measurement.internal.zzaa
    public final boolean zzb() {
        return this.zzg.zzk();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    @Override // com.google.android.gms.measurement.internal.zzaa
    public final boolean zzc() {
        return false;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Removed duplicated region for block: B:42:0x03ae  */
    /* JADX WARN: Removed duplicated region for block: B:45:0x03b9 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:46:0x03ba  */
    /* JADX WARN: Removed duplicated region for block: B:66:0x03b1  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final boolean zza(Long l10, Long l11, zzfy.zzf zzfVar, long j10, zzbb zzbbVar, boolean z10) {
        Boolean zza;
        Object[] objArr = com.google.android.gms.internal.measurement.zzoe.zza() && this.zzh.zze().zzf(this.zza, zzbh.zzbp);
        long j11 = this.zzg.zzj() ? zzbbVar.zze : j10;
        r7 = null;
        r7 = null;
        r7 = null;
        r7 = null;
        r7 = null;
        r7 = null;
        r7 = null;
        r7 = null;
        r7 = null;
        r7 = null;
        r7 = null;
        Boolean bool = null;
        if (this.zzh.zzj().zza(2)) {
            this.zzh.zzj().zzp().zza("Evaluating filter. audience, filter, event", Integer.valueOf(this.zzb), this.zzg.zzl() ? Integer.valueOf(this.zzg.zzb()) : null, this.zzh.zzi().zza(this.zzg.zzf()));
            this.zzh.zzj().zzp().zza("Filter definition", this.zzh.g_().zza(this.zzg));
        }
        if (!this.zzg.zzl() || this.zzg.zzb() > 256) {
            this.zzh.zzj().zzu().zza("Invalid event filter ID. appId, id", zzgo.zza(this.zza), String.valueOf(this.zzg.zzl() ? Integer.valueOf(this.zzg.zzb()) : null));
            return false;
        }
        Object[] objArr2 = this.zzg.zzh() || this.zzg.zzi() || this.zzg.zzj();
        if (z10 && objArr2 == false) {
            this.zzh.zzj().zzp().zza("Event filter already evaluated true and it is not associated with an enhanced audience. audience ID, filter ID", Integer.valueOf(this.zzb), this.zzg.zzl() ? Integer.valueOf(this.zzg.zzb()) : null);
            return true;
        }
        zzfo.zzb zzbVar = this.zzg;
        String zzg = zzfVar.zzg();
        if (zzbVar.zzk()) {
            Boolean zza2 = zzaa.zza(j11, zzbVar.zze());
            if (zza2 != null) {
                if (!zza2.booleanValue()) {
                    bool = Boolean.FALSE;
                }
            }
            this.zzh.zzj().zzp().zza("Event filter result", bool != null ? "null" : bool);
            if (bool != null) {
                return false;
            }
            Boolean bool2 = Boolean.TRUE;
            this.zzc = bool2;
            if (!bool.booleanValue()) {
                return true;
            }
            this.zzd = bool2;
            if (objArr2 != false && zzfVar.zzk()) {
                Long valueOf = Long.valueOf(zzfVar.zzd());
                if (this.zzg.zzi()) {
                    if (objArr != false && this.zzg.zzk()) {
                        valueOf = l10;
                    }
                    this.zzf = valueOf;
                } else {
                    if (objArr != false && this.zzg.zzk()) {
                        valueOf = l11;
                    }
                    this.zze = valueOf;
                }
            }
            return true;
        }
        HashSet hashSet = new HashSet();
        Iterator<zzfo.zzc> it = zzbVar.zzg().iterator();
        while (true) {
            if (it.hasNext()) {
                zzfo.zzc next = it.next();
                if (next.zze().isEmpty()) {
                    this.zzh.zzj().zzu().zza("null or empty param name in filter. event", this.zzh.zzi().zza(zzg));
                    break;
                }
                hashSet.add(next.zze());
            } else {
                a aVar = new a();
                Iterator<zzfy.zzh> it2 = zzfVar.zzh().iterator();
                while (true) {
                    if (it2.hasNext()) {
                        zzfy.zzh next2 = it2.next();
                        if (hashSet.contains(next2.zzg())) {
                            if (next2.zzl()) {
                                aVar.put(next2.zzg(), next2.zzl() ? Long.valueOf(next2.zzd()) : null);
                            } else if (next2.zzj()) {
                                aVar.put(next2.zzg(), next2.zzj() ? Double.valueOf(next2.zza()) : null);
                            } else if (next2.zzn()) {
                                aVar.put(next2.zzg(), next2.zzh());
                            } else {
                                this.zzh.zzj().zzu().zza("Unknown value for param. event, param", this.zzh.zzi().zza(zzg), this.zzh.zzi().zzb(next2.zzg()));
                                break;
                            }
                        }
                    } else {
                        Iterator<zzfo.zzc> it3 = zzbVar.zzg().iterator();
                        while (true) {
                            if (it3.hasNext()) {
                                zzfo.zzc next3 = it3.next();
                                boolean z11 = next3.zzg() && next3.zzf();
                                String zze = next3.zze();
                                if (zze.isEmpty()) {
                                    this.zzh.zzj().zzu().zza("Event has empty param name. event", this.zzh.zzi().zza(zzg));
                                    break;
                                }
                                Object obj = aVar.get(zze);
                                if (obj instanceof Long) {
                                    if (!next3.zzh()) {
                                        this.zzh.zzj().zzu().zza("No number filter for long param. event, param", this.zzh.zzi().zza(zzg), this.zzh.zzi().zzb(zze));
                                        break;
                                    }
                                    Boolean zza3 = zzaa.zza(((Long) obj).longValue(), next3.zzc());
                                    if (zza3 == null) {
                                        break;
                                    }
                                    if (zza3.booleanValue() == z11) {
                                        bool = Boolean.FALSE;
                                        break;
                                    }
                                } else if (obj instanceof Double) {
                                    if (!next3.zzh()) {
                                        this.zzh.zzj().zzu().zza("No number filter for double param. event, param", this.zzh.zzi().zza(zzg), this.zzh.zzi().zzb(zze));
                                        break;
                                    }
                                    Boolean zza4 = zzaa.zza(((Double) obj).doubleValue(), next3.zzc());
                                    if (zza4 == null) {
                                        break;
                                    }
                                    if (zza4.booleanValue() == z11) {
                                        bool = Boolean.FALSE;
                                        break;
                                    }
                                } else if (obj instanceof String) {
                                    if (next3.zzj()) {
                                        zza = zzaa.zza((String) obj, next3.zzd(), this.zzh.zzj());
                                    } else if (next3.zzh()) {
                                        String str = (String) obj;
                                        if (zzoo.zzb(str)) {
                                            zza = zzaa.zza(str, next3.zzc());
                                        } else {
                                            this.zzh.zzj().zzu().zza("Invalid param value for number filter. event, param", this.zzh.zzi().zza(zzg), this.zzh.zzi().zzb(zze));
                                            break;
                                        }
                                    } else {
                                        this.zzh.zzj().zzu().zza("No filter for String param. event, param", this.zzh.zzi().zza(zzg), this.zzh.zzi().zzb(zze));
                                        break;
                                    }
                                    if (zza == null) {
                                        break;
                                    }
                                    if (zza.booleanValue() == z11) {
                                        bool = Boolean.FALSE;
                                        break;
                                    }
                                } else if (obj == null) {
                                    this.zzh.zzj().zzp().zza("Missing param for filter. event, param", this.zzh.zzi().zza(zzg), this.zzh.zzi().zzb(zze));
                                    bool = Boolean.FALSE;
                                } else {
                                    this.zzh.zzj().zzu().zza("Unknown param type. event, param", this.zzh.zzi().zza(zzg), this.zzh.zzi().zzb(zze));
                                }
                            } else {
                                bool = Boolean.TRUE;
                                break;
                            }
                        }
                    }
                }
            }
        }
        this.zzh.zzj().zzp().zza("Event filter result", bool != null ? "null" : bool);
        if (bool != null) {
        }
    }
}
