package defpackage;

import androidx.media3.container.NalUnitUtil;
import java.nio.charset.Charset;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(k = 3, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
@vx8
public final class i45<T> implements l43 {
    public final /* synthetic */ l43 a;
    public final /* synthetic */ Charset b;
    public final /* synthetic */ fz9 c;
    public final /* synthetic */ bn0 d;

    public i45(l43 l43Var, Charset charset, fz9 fz9Var, bn0 bn0Var) {
        this.a = l43Var;
        this.b = charset;
        this.c = fz9Var;
        this.d = bn0Var;
    }

    /* JADX WARN: Code restructure failed: missing block: B:21:0x005c, code lost:
    
        if (r8.emit(r9, r0) == r1) goto L22;
     */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    @Override // defpackage.l43
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object emit(Object obj, Continuation continuation) {
        h45 h45Var;
        l43 l43Var;
        if (continuation instanceof h45) {
            h45Var = (h45) continuation;
            int i = h45Var.b;
            if ((i & Integer.MIN_VALUE) != 0) {
                h45Var.b = i - Integer.MIN_VALUE;
            } else {
                h45Var = new h45(this, continuation);
            }
        }
        Object obj2 = h45Var.a;
        ck1 ck1Var = ck1.a;
        int i2 = h45Var.b;
        if (i2 == 0) {
            s38.b(obj2);
            l43 l43Var2 = this.a;
            h45Var.c = l43Var2;
            h45Var.b = 1;
            Object objA = ((t45) obj).a(this.b, this.c, this.d, h45Var);
            if (objA != ck1Var) {
                obj2 = objA;
                l43Var = l43Var2;
            }
            return ck1Var;
        }
        if (i2 != 1) {
            if (i2 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj2);
            return e6a.a;
        }
        l43Var = h45Var.c;
        s38.b(obj2);
        h45Var.c = null;
        h45Var.b = 2;
    }
}
