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

import java.util.Objects;

/* JADX INFO: loaded from: classes2.dex */
public final class io2 implements kq2 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final kq2 f12584a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f12585b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ jo2 f12586c;

    public io2(jo2 jo2Var, kq2 kq2Var) {
        Objects.requireNonNull(jo2Var);
        this.f12586c = jo2Var;
        this.f12584a = kq2Var;
    }

    @Override // com.google.android.gms.internal.ads.kq2
    public final int a(long j10) {
        if (this.f12586c.k()) {
            return -3;
        }
        return this.f12584a.a(j10);
    }

    /* JADX WARN: Removed duplicated region for block: B:18:0x0038  */
    @Override // com.google.android.gms.internal.ads.kq2
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final int b(di2 di2Var, fe2 fe2Var, int i10) {
        jo2 jo2Var = this.f12586c;
        if (jo2Var.k()) {
            return -3;
        }
        if (this.f12585b) {
            fe2Var.f32097b = 4;
            return -4;
        }
        long jZzi = jo2Var.zzi();
        int iB = this.f12584a.b(di2Var, fe2Var, i10);
        if (iB != -5) {
            long j10 = jo2Var.f12951d;
            if (j10 == Long.MIN_VALUE || ((iB != -4 || fe2Var.f11190e < j10) && !(iB == -3 && jZzi == Long.MIN_VALUE && !fe2Var.f11189d))) {
                return iB;
            }
            fe2Var.h();
            fe2Var.f32097b = 4;
            this.f12585b = true;
            return -4;
        }
        zn2 zn2Var = di2Var.zzb;
        zn2Var.getClass();
        int i11 = zn2Var.f19352y;
        int i12 = zn2Var.f19351x;
        if (i12 != 0) {
            int i13 = jo2Var.f12951d == Long.MIN_VALUE ? i11 : 0;
            sm2 sm2Var = new sm2(zn2Var);
            sm2Var.f16499v = i12;
            sm2Var.f16500w = i13;
            di2Var.zzb = new zn2(sm2Var);
        } else if (i11 != 0) {
            i12 = 0;
            if (jo2Var.f12951d == Long.MIN_VALUE) {
            }
            sm2 sm2Var2 = new sm2(zn2Var);
            sm2Var2.f16499v = i12;
            sm2Var2.f16500w = i13;
            di2Var.zzb = new zn2(sm2Var2);
        }
        return -5;
    }

    @Override // com.google.android.gms.internal.ads.kq2
    public final boolean zzb() {
        return !this.f12586c.k() && this.f12584a.zzb();
    }

    @Override // com.google.android.gms.internal.ads.kq2
    public final void zzc() {
        this.f12584a.zzc();
    }
}
