package p402.p405;

import java.io.Serializable;
import kotlin.TypeCastException;
import p138.p139.p143.p144.C2803;
import p138.p176.p177.p242.p246.p251.C4303;
import p402.InterfaceC6540;
import p402.p405.InterfaceC6578;
import p402.p411.p412.InterfaceC6618;
import p402.p411.p413.AbstractC6636;
import p402.p411.p413.C6635;

/* JADX INFO: renamed from: ގ.ތ.ހ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6540
public final class C6573 implements InterfaceC6578, Serializable {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public final InterfaceC6578 f19350;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public final InterfaceC6578.InterfaceC6579 f19351;

    /* JADX INFO: renamed from: ގ.ތ.ހ$֏, reason: contains not printable characters */
    public static final class C6574 extends AbstractC6636 implements InterfaceC6618<String, InterfaceC6578.InterfaceC6579, String> {

        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public static final C6574 f19352 = new C6574();

        public C6574() {
            super(2);
        }

        @Override // p402.p411.p412.InterfaceC6618
        /* JADX INFO: renamed from: ؠ */
        public String mo838(String str, InterfaceC6578.InterfaceC6579 interfaceC6579) {
            String str2 = str;
            InterfaceC6578.InterfaceC6579 interfaceC65792 = interfaceC6579;
            if (str2 == null) {
                C6635.m9824("acc");
                throw null;
            }
            if (interfaceC65792 == null) {
                C6635.m9824("element");
                throw null;
            }
            if (str2.length() == 0) {
                return interfaceC65792.toString();
            }
            return str2 + ", " + interfaceC65792;
        }
    }

    public C6573(InterfaceC6578 interfaceC6578, InterfaceC6578.InterfaceC6579 interfaceC6579) {
        if (interfaceC6578 == null) {
            C6635.m9824("left");
            throw null;
        }
        if (interfaceC6579 == null) {
            C6635.m9824("element");
            throw null;
        }
        this.f19350 = interfaceC6578;
        this.f19351 = interfaceC6579;
    }

    /* JADX WARN: Code restructure failed: missing block: B:18:0x0041, code lost:
    
        if (r5 == false) goto L30;
     */
    /* JADX WARN: Code restructure failed: missing block: B:30:?, code lost:
    
        return false;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public boolean equals(Object obj) {
        boolean zM9825;
        if (this != obj) {
            if (!(obj instanceof C6573)) {
                return false;
            }
            C6573 c6573 = (C6573) obj;
            if (c6573.m9800() != m9800()) {
                return false;
            }
            if (c6573 == null) {
                throw null;
            }
            C6573 c65732 = this;
            while (true) {
                InterfaceC6578.InterfaceC6579 interfaceC6579 = c65732.f19351;
                if (!C6635.m9825(c6573.get(interfaceC6579.getKey()), interfaceC6579)) {
                    zM9825 = false;
                    break;
                }
                InterfaceC6578 interfaceC6578 = c65732.f19350;
                if (interfaceC6578 instanceof C6573) {
                    c65732 = (C6573) interfaceC6578;
                } else {
                    if (interfaceC6578 == null) {
                        throw new TypeCastException("null cannot be cast to non-null type kotlin.coroutines.CoroutineContext.Element");
                    }
                    InterfaceC6578.InterfaceC6579 interfaceC65792 = (InterfaceC6578.InterfaceC6579) interfaceC6578;
                    zM9825 = C6635.m9825(c6573.get(interfaceC65792.getKey()), interfaceC65792);
                }
            }
        }
        return true;
    }

    @Override // p402.p405.InterfaceC6578
    public <R> R fold(R r, InterfaceC6618<? super R, ? super InterfaceC6578.InterfaceC6579, ? extends R> interfaceC6618) {
        if (interfaceC6618 != null) {
            return interfaceC6618.mo838((Object) this.f19350.fold(r, interfaceC6618), this.f19351);
        }
        C6635.m9824("operation");
        throw null;
    }

    @Override // p402.p405.InterfaceC6578
    public <E extends InterfaceC6578.InterfaceC6579> E get(InterfaceC6578.InterfaceC6581<E> interfaceC6581) {
        if (interfaceC6581 == null) {
            C6635.m9824("key");
            throw null;
        }
        C6573 c6573 = this;
        while (true) {
            E e = (E) c6573.f19351.get(interfaceC6581);
            if (e != null) {
                return e;
            }
            InterfaceC6578 interfaceC6578 = c6573.f19350;
            if (!(interfaceC6578 instanceof C6573)) {
                return (E) interfaceC6578.get(interfaceC6581);
            }
            c6573 = (C6573) interfaceC6578;
        }
    }

    public int hashCode() {
        return this.f19351.hashCode() + this.f19350.hashCode();
    }

    @Override // p402.p405.InterfaceC6578
    public InterfaceC6578 minusKey(InterfaceC6578.InterfaceC6581<?> interfaceC6581) {
        if (interfaceC6581 == null) {
            C6635.m9824("key");
            throw null;
        }
        if (this.f19351.get(interfaceC6581) != null) {
            return this.f19350;
        }
        InterfaceC6578 interfaceC6578MinusKey = this.f19350.minusKey(interfaceC6581);
        return interfaceC6578MinusKey == this.f19350 ? this : interfaceC6578MinusKey == C6583.f19356 ? this.f19351 : new C6573(interfaceC6578MinusKey, this.f19351);
    }

    @Override // p402.p405.InterfaceC6578
    public InterfaceC6578 plus(InterfaceC6578 interfaceC6578) {
        if (interfaceC6578 != null) {
            return C4303.m7068((InterfaceC6578) this, interfaceC6578);
        }
        C6635.m9824("context");
        throw null;
    }

    public String toString() {
        return C2803.m4884(C2803.m4889("["), (String) fold("", C6574.f19352), "]");
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final int m9800() {
        int i = 2;
        C6573 c6573 = this;
        while (true) {
            InterfaceC6578 interfaceC6578 = c6573.f19350;
            if (!(interfaceC6578 instanceof C6573)) {
                interfaceC6578 = null;
            }
            c6573 = (C6573) interfaceC6578;
            if (c6573 == null) {
                return i;
            }
            i++;
        }
    }
}
