package defpackage;

import com.hierynomus.mssmb2.SMBApiException;
import com.hierynomus.protocol.transport.TransportException;
import com.hierynomus.smbj.common.SMBRuntimeException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicBoolean;

/* JADX INFO: renamed from: ˉᵮᵸ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC1250 implements AutoCloseable {

    /* JADX INFO: renamed from: ˀᵭ, reason: contains not printable characters */
    public static final C5314 f5269;

    /* JADX INFO: renamed from: ˁˌᵩ, reason: contains not printable characters */
    public static final ˑᵤʽˏ f5270;

    /* JADX INFO: renamed from: ʿٴˇ, reason: contains not printable characters */
    public final long f5271;

    /* JADX INFO: renamed from: ˈᵲᵢ, reason: contains not printable characters */
    public final long f5272;

    /* JADX INFO: renamed from: ˉᵵᵜ, reason: contains not printable characters */
    public final AtomicBoolean f5273 = new AtomicBoolean(false);

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final C0974 f5274;

    /* JADX INFO: renamed from: ˌᵨʠᵫ, reason: contains not printable characters */
    public final int f5275;

    /* JADX INFO: renamed from: ˑˊᵲ, reason: contains not printable characters */
    public final int f5276;

    /* JADX INFO: renamed from: ᵔᵖᵹᵫ, reason: contains not printable characters */
    public final long f5277;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public final C5227 f5278;

    /* JADX INFO: renamed from: ᵠˏˏ, reason: contains not printable characters */
    public final long f5279;

    /* JADX INFO: renamed from: ᵨᵼⁱ, reason: contains not printable characters */
    public final C5022 f5280;

    /* JADX INFO: renamed from: ᵯᵷʽ, reason: contains not printable characters */
    public final EnumC3519 f5281;

    /* JADX INFO: renamed from: ᵶˇᵱ, reason: contains not printable characters */
    public final int f5282;

    /* JADX INFO: renamed from: ᵸˆˁ, reason: contains not printable characters */
    public final long f5283;

    static {
        new C3714(new byte[]{-1, -1, -1, -1, -1, -1, -1, -1}, 20, new byte[]{-1, -1, -1, -1, -1, -1, -1, -1});
        f5270 = new ˑᵤʽˏ(7);
        f5269 = new C5314(8);
    }

    public AbstractC1250(C0974 c0974, C5227 c5227) {
        this.f5274 = c0974;
        this.f5278 = c5227;
        C5022 c5022 = (C5022) c5227.f19714;
        this.f5280 = c5022;
        C5179 c5179 = (C5179) c5227.f19715;
        C4349 c4349 = (C4349) c5179.f19498.f19206;
        this.f5281 = (EnumC3519) c4349.f16540;
        C3963 c3963 = c5179.f19496;
        this.f5282 = Math.min(c3963.f15152, c4349.f16539);
        this.f5272 = c3963.f15165;
        this.f5275 = Math.min(c3963.f15160, c4349.f16542);
        this.f5283 = c3963.f15163;
        this.f5276 = Math.min(c3963.f15159, c4349.f16538);
        this.f5271 = c3963.f15153;
        this.f5279 = c5022.f19032;
        this.f5277 = c5227.f19713;
    }

    /* JADX WARN: Removed duplicated region for block: B:23:0x0089 A[Catch: all -> 0x007a, TryCatch #1 {all -> 0x007a, blocks: (B:5:0x001a, B:6:0x003b, B:7:0x0041, B:11:0x005e, B:12:0x0079, B:21:0x0085, B:23:0x0089, B:25:0x0092, B:24:0x008c, B:26:0x0093, B:27:0x009f), top: B:31:0x001a, inners: #4, #3 }] */
    /* JADX WARN: Removed duplicated region for block: B:24:0x008c A[Catch: all -> 0x007a, TryCatch #1 {all -> 0x007a, blocks: (B:5:0x001a, B:6:0x003b, B:7:0x0041, B:11:0x005e, B:12:0x0079, B:21:0x0085, B:23:0x0089, B:25:0x0092, B:24:0x008c, B:26:0x0093, B:27:0x009f), top: B:31:0x001a, inners: #4, #3 }] */
    @Override // java.lang.AutoCloseable
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void close() throws TransportException {
        Throwable th;
        if (this.f5273.getAndSet(true)) {
            return;
        }
        C5227 c5227 = this.f5278;
        C3250 c3250 = (C3250) c5227.f19716;
        C5179 c5179 = (C5179) c5227.f19715;
        C5022 c5022 = (C5022) c5227.f19714;
        try {
            try {
                AbstractC1899 abstractC1899 = (AbstractC1899) c5022.m10362(new C4863(4, (EnumC3519) ((C4349) c5179.f19498.f19206).f16540, EnumC4635.f17627, c5022.f19032, c5227.f19713)).f17089.get(c5179.f19496.f15153, TimeUnit.MILLISECONDS);
                if (EnumC0878.m3076(((C2964) abstractC1899.ᵮᵣᵗˈ()).f11408)) {
                    c3250.f12363.ˈⁱᵡ(new C4195(c5022.f19032));
                } else {
                    throw new SMBApiException((C2964) abstractC1899.ᵮᵣᵗˈ(), "Error closing connection to " + ((C0974) c5227.f19712));
                }
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
                throw new TransportException(e);
            } catch (ExecutionException e2) {
                e = e2;
                th = e;
                if (!(th instanceof TransportException)) {
                    throw ((TransportException) th);
                }
                throw new TransportException(th);
            } catch (TimeoutException e3) {
                e = e3;
                th = e;
                if (!(th instanceof TransportException)) {
                }
            }
        } catch (Throwable th2) {
            c3250.f12363.ˈⁱᵡ(new C4195(c5022.f19032));
            throw th2;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:12:0x001c A[Catch: TransportException -> 0x006b, TryCatch #3 {TransportException -> 0x006b, blocks: (B:4:0x000a, B:5:0x000c, B:6:0x0012, B:10:0x0018, B:12:0x001c, B:14:0x0025, B:13:0x001f, B:16:0x0027, B:17:0x0033, B:18:0x0034, B:19:0x003a, B:28:0x006e, B:29:0x0073, B:31:0x0075, B:32:0x0081), top: B:35:0x0008, inners: #6, #5, #4 }] */
    /* JADX WARN: Removed duplicated region for block: B:13:0x001f A[Catch: TransportException -> 0x006b, TryCatch #3 {TransportException -> 0x006b, blocks: (B:4:0x000a, B:5:0x000c, B:6:0x0012, B:10:0x0018, B:12:0x001c, B:14:0x0025, B:13:0x001f, B:16:0x0027, B:17:0x0033, B:18:0x0034, B:19:0x003a, B:28:0x006e, B:29:0x0073, B:31:0x0075, B:32:0x0081), top: B:35:0x0008, inners: #6, #5, #4 }] */
    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final AbstractC1899 m3747(AbstractC1899 abstractC1899, String str, Object obj, InterfaceC4637 interfaceC4637, long j) {
        AbstractC1899 abstractC18992;
        C4479 c4479M3748 = m3748(abstractC1899);
        try {
            if (j > 0) {
                try {
                    abstractC18992 = (AbstractC1899) c4479M3748.f17089.get(j, TimeUnit.MILLISECONDS);
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                    throw new TransportException(e);
                } catch (ExecutionException e2) {
                    e = e2;
                    if (e instanceof TransportException) {
                        throw new TransportException(e);
                    }
                    throw ((TransportException) e);
                } catch (TimeoutException e3) {
                    e = e3;
                    if (e instanceof TransportException) {
                    }
                }
            } else {
                try {
                    abstractC18992 = (AbstractC1899) c4479M3748.f17089.get();
                } catch (InterruptedException e4) {
                    Thread.currentThread().interrupt();
                    throw new TransportException(e4);
                } catch (ExecutionException e5) {
                    throw new TransportException(e5);
                }
            }
            if (interfaceC4637.mo8519(((C2964) abstractC18992.ᵮᵣᵗˈ()).f11408)) {
                return abstractC18992;
            }
            throw new SMBApiException((C2964) abstractC18992.ᵮᵣᵗˈ(), str + " failed for " + obj);
        } catch (TransportException e6) {
            throw new SMBRuntimeException(e6);
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C4479 m3748(AbstractC1899 abstractC1899) {
        if (this.f5273.get()) {
            throw new SMBRuntimeException(getClass().getSimpleName().concat(" has already been closed"));
        }
        try {
            return this.f5280.m10362(abstractC1899);
        } catch (TransportException e) {
            throw new SMBRuntimeException(e);
        }
    }
}
