package 㴹.K.㑃;

import 㴹.K.Ԕ.ᨨ.C2454;
import 㴹.K.Ԕ.ῲ.C2456;
import 㴹.K.Ԕ.K.AbstractC2486;

/* renamed from: 㴹.K.㑃.K  reason: contains not printable characters */
/* compiled from: CompositeDisposable */
public final class C2515 implements AbstractC2514, AbstractC2486 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public volatile boolean f8515;

    /* renamed from: ῲ  reason: contains not printable characters */
    public C2454<AbstractC2514> f8516;

    /* JADX WARNING: Code restructure failed: missing block: B:11:0x0015, code lost:
        if (r1 != null) goto L_0x0018;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:12:0x0018, code lost:
        r1 = r1.f8403;
        r3 = r1.length;
        r5 = null;
        r2 = 0;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:13:0x001e, code lost:
        if (r2 >= r3) goto L_0x003d;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:14:0x0020, code lost:
        r6 = r1[r2];
     */
    /* JADX WARNING: Code restructure failed: missing block: B:15:0x0024, code lost:
        if ((r6 instanceof 㴹.K.㑃.AbstractC2514) == false) goto L_0x003a;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:17:?, code lost:
        r6.dispose();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:0x002c, code lost:
        r6 = move-exception;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:19:0x002d, code lost:
        ඓ.ⁱ.K.ඓ.C1252.m3329(r6);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:20:0x0030, code lost:
        if (r5 == null) goto L_0x0032;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:21:0x0032, code lost:
        r5 = new java.util.ArrayList();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:22:0x0037, code lost:
        r5.add(r6);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:24:0x003d, code lost:
        if (r5 == null) goto L_?;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:26:0x0043, code lost:
        if (r5.size() != 1) goto L_0x0050;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:28:0x004f, code lost:
        throw io.reactivex.internal.util.ExceptionHelper.m1955((java.lang.Throwable) r5.get(0));
     */
    /* JADX WARNING: Code restructure failed: missing block: B:30:0x0055, code lost:
        throw new io.reactivex.exceptions.CompositeException(r5);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:38:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:39:?, code lost:
        return;
     */
    @Override // 㴹.K.㑃.AbstractC2514
    public void dispose() {
        if (!this.f8515) {
            synchronized (this) {
                if (!this.f8515) {
                    this.f8515 = true;
                    C2454<AbstractC2514> r1 = this.f8516;
                    this.f8516 = null;
                } else {
                    return;
                }
            }
        } else {
            return;
        }
        int i = i + 1;
    }

    @Override // 㴹.K.㑃.AbstractC2514
    public boolean isDisposed() {
        return this.f8515;
    }

    @Override // 㴹.K.Ԕ.K.AbstractC2486
    /* renamed from: ʬ  reason: contains not printable characters */
    public boolean m6564(AbstractC2514 r2) {
        C2456.m6500(r2, "d is null");
        if (!this.f8515) {
            synchronized (this) {
                if (!this.f8515) {
                    C2454<AbstractC2514> r0 = this.f8516;
                    if (r0 == null) {
                        r0 = new C2454<>();
                        this.f8516 = r0;
                    }
                    r0.m6497(r2);
                    return true;
                }
            }
        }
        r2.dispose();
        return false;
    }

    @Override // 㴹.K.Ԕ.K.AbstractC2486
    /* renamed from: ῲ  reason: contains not printable characters */
    public boolean m6565(AbstractC2514 r2) {
        if (!m6566(r2)) {
            return false;
        }
        r2.dispose();
        return true;
    }

    /* JADX WARNING: Removed duplicated region for block: B:25:0x0048  */
    /* JADX WARNING: Removed duplicated region for block: B:26:0x0049 A[DONT_GENERATE] */
    @Override // 㴹.K.Ԕ.K.AbstractC2486
    /* renamed from: K  reason: contains not printable characters */
    public boolean m6566(AbstractC2514 r8) {
        boolean z;
        T t;
        C2456.m6500(r8, "Disposable item is null");
        if (this.f8515) {
            return false;
        }
        synchronized (this) {
            if (this.f8515) {
                return false;
            }
            C2454<AbstractC2514> r0 = this.f8516;
            if (r0 != null) {
                T[] tArr = r0.f8403;
                int i = r0.f8404;
                int r4 = C2454.m6495(r8.hashCode()) & i;
                T t2 = tArr[r4];
                if (t2 != null) {
                    if (t2.equals(r8)) {
                        r0.m6496(r4, tArr, i);
                    } else {
                        do {
                            r4 = (r4 + 1) & i;
                            t = tArr[r4];
                            if (t == null) {
                            }
                        } while (!t.equals(r8));
                        r0.m6496(r4, tArr, i);
                    }
                    z = true;
                    if (!z) {
                        return true;
                    }
                }
                z = false;
                if (!z) {
                }
            }
            return false;
        }
    }
}
