package 㿎.ሽ.㴹;

import java.util.List;
import java.util.regex.Pattern;
import 㿎.AbstractC2669;
import 㿎.C2531;
import 㿎.C2646;
import 㿎.C2667;
import 㿎.C2671;

/* renamed from: 㿎.ሽ.㴹.ඓ  reason: contains not printable characters */
/* compiled from: HttpHeaders */
public final class C2577 {
    static {
        Pattern.compile(" +([^ \"=]*)=(:?\"([^\"]*)\"|([^ \"=]*)) *(:?,|$)");
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static boolean m6780(C2671 r8) {
        if (r8.f9087.f8984.equals("HEAD")) {
            return false;
        }
        int i = r8.f9092;
        if (((i >= 100 && i < 200) || i == 204 || i == 304) && m6783(r8) == -1) {
            String r82 = r8.f9088.m6996("Transfer-Encoding");
            if (r82 == null) {
                r82 = null;
            }
            if ("chunked".equalsIgnoreCase(r82)) {
                return true;
            }
            return false;
        }
        return true;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static long m6783(C2671 r2) {
        String r22 = r2.f9088.m6996("Content-Length");
        if (r22 == null) {
            return -1;
        }
        try {
            return Long.parseLong(r22);
        } catch (NumberFormatException unused) {
            return -1;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static void m6784(AbstractC2669 r1, C2531 r2, C2667 r3) {
        if (r1 != AbstractC2669.f9082) {
            List<C2646> r32 = C2646.m6973(r2, r3);
            if (!r32.isEmpty()) {
                ((AbstractC2669.C2670) r1).m7005(r2, r32);
            }
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6782(String str, int i, String str2) {
        while (i < str.length() && str2.indexOf(str.charAt(i)) == -1) {
            i++;
        }
        return i;
    }

    /* renamed from: K  reason: contains not printable characters */
    public static int m6781(String str, int i) {
        try {
            long parseLong = Long.parseLong(str);
            if (parseLong > 2147483647L) {
                return Integer.MAX_VALUE;
            }
            if (parseLong < 0) {
                return 0;
            }
            return (int) parseLong;
        } catch (NumberFormatException unused) {
            return i;
        }
    }
}
