package k1;

import e1.AbstractC0453a;
import e1.C0454b;
import java.net.InetAddress;
import java.util.Enumeration;
import java.util.Vector;

/* JADX INFO: loaded from: classes.dex */
public final class c0 {

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private static final String f4777l = AbstractC0453a.h("jcifs.smb.client.logonShare", null);

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    private static final int f4778m = AbstractC0453a.d("jcifs.netbios.lookupRespLimit", 3);

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    private static final String f4779n = AbstractC0453a.h("jcifs.smb.client.domain", null);

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    private static final String f4780o = AbstractC0453a.h("jcifs.smb.client.username", null);

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    private static final int f4781p = AbstractC0453a.d("jcifs.netbios.cachePolicy", 600) * 60;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    static i1.g[] f4782q = null;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    int f4784b;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private C0454b f4786d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private int f4787e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private int f4788f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private InetAddress f4789g;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    C0599q f4791i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    long f4792j;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    e0 f4790h = null;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    String f4793k = null;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    Vector f4785c = new Vector();

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    int f4783a = 0;

    c0(C0454b c0454b, int i2, InetAddress inetAddress, int i3, C0599q c0599q) {
        this.f4786d = c0454b;
        this.f4787e = i2;
        this.f4789g = inetAddress;
        this.f4788f = i3;
        this.f4791i = c0599q;
    }

    synchronized f0 a(String str, String str2) {
        if (str == null) {
            str = "IPC$";
        }
        try {
            Enumeration enumerationElements = this.f4785c.elements();
            while (enumerationElements.hasMoreElements()) {
                f0 f0Var = (f0) enumerationElements.nextElement();
                if (f0Var.a(str, str2)) {
                    return f0Var;
                }
            }
            f0 f0Var2 = new f0(this, str, str2);
            this.f4785c.addElement(f0Var2);
            return f0Var2;
        } catch (Throwable th) {
            throw th;
        }
    }

    void b(boolean z2) {
        synchronized (f()) {
            try {
                if (this.f4783a != 2) {
                    return;
                }
                this.f4783a = 3;
                this.f4793k = null;
                Enumeration enumerationElements = this.f4785c.elements();
                while (enumerationElements.hasMoreElements()) {
                    ((f0) enumerationElements.nextElement()).d(z2);
                }
                if (!z2 && this.f4790h.f4835k0.f4850g != 0) {
                    C0606x c0606x = new C0606x(null);
                    c0606x.f5007a0 = this.f4784b;
                    try {
                        this.f4790h.y(c0606x, null);
                    } catch (V unused) {
                    }
                    this.f4784b = 0;
                }
                this.f4783a = 0;
                this.f4790h.notifyAll();
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    boolean c(C0599q c0599q) {
        C0599q c0599q2 = this.f4791i;
        return c0599q2 == c0599q || c0599q2.equals(c0599q);
    }

    void d(AbstractC0600r abstractC0600r, AbstractC0600r abstractC0600r2) {
        synchronized (f()) {
            if (abstractC0600r2 != null) {
                try {
                    abstractC0600r2.f5012f0 = false;
                } catch (Throwable th) {
                    throw th;
                }
            }
            this.f4792j = System.currentTimeMillis() + ((long) U.f4700P);
            e(abstractC0600r, abstractC0600r2);
            if (abstractC0600r2 == null || !abstractC0600r2.f5012f0) {
                if (abstractC0600r instanceof C0576M) {
                    C0576M c0576m = (C0576M) abstractC0600r;
                    if (this.f4793k != null && c0576m.f4665y0.endsWith("\\IPC$")) {
                        c0576m.f4665y0 = "\\\\" + this.f4793k + "\\IPC$";
                    }
                }
                abstractC0600r.f5007a0 = this.f4784b;
                abstractC0600r.f5017k0 = this.f4791i;
                try {
                    this.f4790h.y(abstractC0600r, abstractC0600r2);
                } catch (V e2) {
                    if (abstractC0600r instanceof C0576M) {
                        b(true);
                    }
                    abstractC0600r.f5019m0 = null;
                    throw e2;
                }
            }
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:100:0x0189, code lost:
    
        r4 = true;
     */
    /* JADX WARN: Code restructure failed: missing block: B:101:0x018b, code lost:
    
        r10.f5019m0 = new k1.C0601s(r6.k(r16.f4790h.f4835k0.f4859p), false);
     */
    /* JADX WARN: Code restructure failed: missing block: B:102:0x019c, code lost:
    
        r10.f5017k0 = r16.f4791i;
     */
    /* JADX WARN: Code restructure failed: missing block: B:103:0x01a0, code lost:
    
        r16.f4790h.y(r10, r13);
     */
    /* JADX WARN: Code restructure failed: missing block: B:105:0x01a6, code lost:
    
        r0 = e;
     */
    /* JADX WARN: Code restructure failed: missing block: B:107:0x01a8, code lost:
    
        r0 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:132:0x01f1, code lost:
    
        throw r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:133:0x01f2, code lost:
    
        b(r4);
        r16.f4783a = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:134:0x01f7, code lost:
    
        throw r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:135:0x01f8, code lost:
    
        r16.f4790h.notifyAll();
     */
    /* JADX WARN: Code restructure failed: missing block: B:136:0x01fd, code lost:
    
        throw r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:22:0x002b, code lost:
    
        r4 = true;
        r16.f4783a = 1;
     */
    /* JADX WARN: Code restructure failed: missing block: B:23:0x002e, code lost:
    
        r16.f4790h.n();
        r6 = k1.e0.f4817t0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:24:0x0037, code lost:
    
        r7 = 4;
     */
    /* JADX WARN: Code restructure failed: missing block: B:25:0x0038, code lost:
    
        if (l1.C0622e.f5384g < 4) goto L32;
     */
    /* JADX WARN: Code restructure failed: missing block: B:26:0x003a, code lost:
    
        k1.e0.f4819v0.println("sessionSetup: accountName=" + r16.f4791i.f4994g + ",primaryDomain=" + r16.f4791i.f4993b);
     */
    /* JADX WARN: Code restructure failed: missing block: B:28:0x0061, code lost:
    
        r0 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:30:0x0064, code lost:
    
        r0 = e;
     */
    /* JADX WARN: Code restructure failed: missing block: B:32:0x0067, code lost:
    
        r16.f4784b = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:33:0x0069, code lost:
    
        r6 = 10;
        r9 = r0;
        r10 = 10;
        r0 = null;
        r11 = null;
     */
    /* JADX WARN: Code restructure failed: missing block: B:35:0x0075, code lost:
    
        if (r10 == r6) goto L87;
     */
    /* JADX WARN: Code restructure failed: missing block: B:36:0x0077, code lost:
    
        if (r10 != 20) goto L160;
     */
    /* JADX WARN: Code restructure failed: missing block: B:37:0x0079, code lost:
    
        if (r11 != null) goto L43;
     */
    /* JADX WARN: Code restructure failed: missing block: B:39:0x0080, code lost:
    
        if ((r16.f4790h.f4836l0 & r7) == 0) goto L41;
     */
    /* JADX WARN: Code restructure failed: missing block: B:40:0x0082, code lost:
    
        r11 = r4;
     */
    /* JADX WARN: Code restructure failed: missing block: B:41:0x0084, code lost:
    
        r11 = false;
     */
    /* JADX WARN: Code restructure failed: missing block: B:42:0x0085, code lost:
    
        r11 = new k1.C0598p(r16.f4791i, r11);
     */
    /* JADX WARN: Code restructure failed: missing block: B:43:0x008d, code lost:
    
        r13 = k1.e0.f4817t0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:44:0x0091, code lost:
    
        if (l1.C0622e.f5384g < r7) goto L46;
     */
    /* JADX WARN: Code restructure failed: missing block: B:45:0x0093, code lost:
    
        k1.e0.f4819v0.println(r11);
     */
    /* JADX WARN: Code restructure failed: missing block: B:47:0x009c, code lost:
    
        if (r11.d() == false) goto L145;
     */
    /* JADX WARN: Code restructure failed: missing block: B:48:0x009e, code lost:
    
        r16.f4793k = r11.a();
        r16.f4783a = 2;
     */
    /* JADX WARN: Code restructure failed: missing block: B:51:0x00ad, code lost:
    
        r9 = r11.c(r9, 0, r9.length);
     */
    /* JADX WARN: Code restructure failed: missing block: B:52:0x00b2, code lost:
    
        if (r9 == null) goto L78;
     */
    /* JADX WARN: Code restructure failed: missing block: B:53:0x00b4, code lost:
    
        r13 = new k1.C0572I(r16, null, r9);
        r9 = new k1.C0573J(null);
     */
    /* JADX WARN: Code restructure failed: missing block: B:54:0x00c6, code lost:
    
        if (r16.f4790h.v(r16.f4791i) == false) goto L58;
     */
    /* JADX WARN: Code restructure failed: missing block: B:55:0x00c8, code lost:
    
        r14 = r11.b();
     */
    /* JADX WARN: Code restructure failed: missing block: B:56:0x00cc, code lost:
    
        if (r14 == null) goto L58;
     */
    /* JADX WARN: Code restructure failed: missing block: B:57:0x00ce, code lost:
    
        r13.f5019m0 = new k1.C0601s(r14, r4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:58:0x00d5, code lost:
    
        r13.f5007a0 = r16.f4784b;
        r16.f4784b = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:59:0x00db, code lost:
    
        r16.f4790h.y(r13, r9);
     */
    /* JADX WARN: Code restructure failed: missing block: B:61:0x00e1, code lost:
    
        r0 = e;
     */
    /* JADX WARN: Code restructure failed: missing block: B:63:0x00e3, code lost:
    
        r0 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:65:0x00e5, code lost:
    
        r16.f4790h.b(r4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:80:0x0118, code lost:
    
        throw r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:81:0x0119, code lost:
    
        r0 = move-exception;
     */
    /* JADX WARN: Code restructure failed: missing block: B:82:0x011a, code lost:
    
        r16.f4790h.b(r4);
     */
    /* JADX WARN: Code restructure failed: missing block: B:83:0x011f, code lost:
    
        r16.f4784b = 0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:84:0x0121, code lost:
    
        throw r0;
     */
    /* JADX WARN: Code restructure failed: missing block: B:86:0x0138, code lost:
    
        throw new k1.V("Unexpected session setup state: " + r10);
     */
    /* JADX WARN: Code restructure failed: missing block: B:88:0x013d, code lost:
    
        if (r16.f4791i == k1.C0599q.f4986e0) goto L92;
     */
    /* JADX WARN: Code restructure failed: missing block: B:90:0x0147, code lost:
    
        if (r16.f4790h.u(Integer.MIN_VALUE) == false) goto L92;
     */
    /* JADX WARN: Code restructure failed: missing block: B:91:0x0149, code lost:
    
        r10 = 20;
     */
    /* JADX WARN: Code restructure failed: missing block: B:92:0x0150, code lost:
    
        r10 = new k1.C0572I(r16, r17, r16.f4791i);
        r13 = new k1.C0573J(r18);
     */
    /* JADX WARN: Code restructure failed: missing block: B:93:0x0168, code lost:
    
        if (r16.f4790h.v(r16.f4791i) == false) goto L102;
     */
    /* JADX WARN: Code restructure failed: missing block: B:94:0x016a, code lost:
    
        r6 = r16.f4791i;
     */
    /* JADX WARN: Code restructure failed: missing block: B:95:0x016e, code lost:
    
        if (r6.f4990H == false) goto L101;
     */
    /* JADX WARN: Code restructure failed: missing block: B:97:0x0174, code lost:
    
        if (k1.C0599q.f4985d0 == okhttp3.HttpUrl.FRAGMENT_ENCODE_SET) goto L101;
     */
    /* JADX WARN: Code restructure failed: missing block: B:98:0x0176, code lost:
    
        r16.f4790h.r(k1.C0599q.f4989h0).a(k1.c0.f4777l, null).c(null, null);
     */
    /* JADX WARN: Code restructure failed: missing block: B:99:0x0188, code lost:
    
        r0 = e;
     */
    /* JADX WARN: Removed duplicated region for block: B:130:0x01ea A[LOOP:1: B:34:0x0070->B:130:0x01ea, LOOP_END] */
    /* JADX WARN: Removed duplicated region for block: B:165:0x01e3 A[SYNTHETIC] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    void e(k1.AbstractC0600r r17, k1.AbstractC0600r r18) {
        /*
            Method dump skipped, instruction units count: 512
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: k1.c0.e(k1.r, k1.r):void");
    }

    synchronized e0 f() {
        try {
            if (this.f4790h == null) {
                this.f4790h = e0.t(this.f4786d, this.f4787e, this.f4789g, this.f4788f, null);
            }
        } catch (Throwable th) {
            throw th;
        }
        return this.f4790h;
    }

    public String toString() {
        return "SmbSession[accountName=" + this.f4791i.f4994g + ",primaryDomain=" + this.f4791i.f4993b + ",uid=" + this.f4784b + ",connectionState=" + this.f4783a + "]";
    }
}
