package com.apiguard3.internal;

import com.bytedance.covode.number.Covode;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.Charset;

public final class Config {
    public static char AGRequest = 25416;
    public static int AGRequest$Builder = 1;
    public static int getBody;
    public static char getHeaders = 14937;
    public static char getMethod = 18473;
    public static char getUrl = 29217;

    static {
        Covode.recordClassIndex(2413);
    }

    public static byte[] getHeaders(ByteBuffer byteBuffer) {
        char c;
        int i = getBody + 69;
        AGRequest$Builder = i % 128;
        int i2 = i % 2;
        byte[] bArr = new byte[byteBuffer.limit()];
        byteBuffer.get(bArr);
        int i3 = AGRequest$Builder + 45;
        getBody = i3 % 128;
        if (i3 % 2 == 0) {
            c = 'F';
        } else {
            c = 'P';
        }
        if (c == 'F') {
            return bArr;
        }
        throw new NullPointerException("hashCode");
    }

    public static String getMethod(byte... bArr) {
        boolean z;
        char[] AGRequest2 = AGRequest(bArr);
        boolean z2 = false;
        if (AGRequest2 != null) {
            z = true;
        } else {
            z = false;
        }
        if (z) {
            return new String(AGRequest2);
        }
        int i = AGRequest$Builder;
        int i2 = i + 75;
        getBody = i2 % 128;
        int i3 = i2 % 2;
        int i4 = i + 79;
        getBody = i4 % 128;
        if (i4 % 2 != 0) {
            z2 = true;
        }
        if (!z2) {
            return null;
        }
        throw new NullPointerException("hashCode");
    }

    public static char[] AGRequest(byte... bArr) {
        boolean z;
        char c;
        int i = AGRequest$Builder + 43;
        getBody = i % 128;
        int i2 = i % 2;
        boolean z2 = true;
        if (i2 == 0) {
            z = false;
        } else {
            z = true;
        }
        if (z) {
            throw new NullPointerException("hashCode");
        }
        if (bArr == null) {
            z2 = false;
        }
        if (z2) {
            if (bArr.length != 0) {
                c = '*';
            } else {
                c = 'R';
            }
            if (c != '*') {
                return new char[0];
            }
            CharBuffer decode = Charset.forName(getMethod("䤇䥹礉錆鷇窳").intern()).decode(ByteBuffer.wrap(bArr));
            char[] cArr = new char[decode.length()];
            decode.get(cArr);
            int i3 = getBody + 9;
            AGRequest$Builder = i3 % 128;
            int i4 = i3 % 2;
            return cArr;
        }
        int i5 = AGRequest$Builder + 21;
        getBody = i5 % 128;
        int i6 = i5 % 2;
        return null;
    }

    public static byte[] getHeaders(char... cArr) {
        boolean z;
        char c;
        int i = getBody;
        int i2 = i + 113;
        AGRequest$Builder = i2 % 128;
        int i3 = i2 % 2;
        if (cArr != null) {
            z = true;
        } else {
            z = false;
        }
        if (!z) {
            int i4 = i + 77;
            int i5 = i4 % 128;
            AGRequest$Builder = i5;
            int i6 = i4 % 2;
            int i7 = i5 + 5;
            getBody = i7 % 128;
            if (i7 % 2 == 0) {
                c = '0';
            } else {
                c = 'b';
            }
            if (c == '0') {
                return null;
            }
            throw new NullPointerException("hashCode");
        } else if (cArr.length == 0) {
            byte[] bArr = new byte[0];
            int i8 = i + 27;
            AGRequest$Builder = i8 % 128;
            if (i8 % 2 != 0) {
                return bArr;
            }
            throw new NullPointerException("hashCode");
        } else {
            byte[] headers = getHeaders(Charset.forName(getMethod("䤇䥹礉錆鷇窳").intern()).encode(CharBuffer.wrap(cArr)));
            int i9 = getBody + 85;
            AGRequest$Builder = i9 % 128;
            int i10 = i9 % 2;
            return headers;
        }
    }

    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r11v1, resolved type: char[]} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r11v2, resolved type: java.lang.String} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r11v4, resolved type: java.lang.String} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r11v5, resolved type: java.lang.String} */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static java.lang.String getMethod(java.lang.String r11) {
        /*
            int r0 = AGRequest$Builder
            int r1 = r0 + 119
            int r0 = r1 % 128
            getBody = r0
            r9 = 2
            int r1 = r1 % r9
            r10 = 0
            r8 = 1
            if (r11 != 0) goto L_0x004c
        L_0x000e:
            char[] r11 = (char[]) r11
            int r0 = r11.length
            char[] r7 = new char[r0]
            char[] r6 = new char[r9]
            r5 = 0
        L_0x0016:
            int r1 = r11.length
            r0 = 41
            if (r5 < r1) goto L_0x0023
            char r1 = r7[r10]
            java.lang.String r0 = new java.lang.String
            r0.<init>(r7, r8, r1)
            return r0
        L_0x0023:
            int r0 = AGRequest$Builder
            int r1 = r0 + 21
            int r0 = r1 % 128
            getBody = r0
            int r1 = r1 % r9
            char r0 = r11[r5]
            r6[r10] = r0
            int r4 = r5 + 1
            char r0 = r11[r4]
            r6[r8] = r0
            char r3 = getHeaders
            char r2 = AGRequest
            char r1 = getMethod
            char r0 = getUrl
            com.apiguard3.internal.setOnApplyWindowInsetsListener.AGRequest(r6, r3, r2, r1, r0)
            char r0 = r6[r10]
            r7[r5] = r0
            char r0 = r6[r8]
            r7[r4] = r0
            int r5 = r5 + 2
            goto L_0x0016
        L_0x004c:
            char[] r11 = r11.toCharArray()
            goto L_0x000e
        */
        throw new UnsupportedOperationException("Method not decompiled: com.apiguard3.internal.Config.getMethod(java.lang.String):java.lang.String");
    }

    public static byte[] getUrl(String str) {
        char c;
        int i = getBody;
        int i2 = i + 69;
        AGRequest$Builder = i2 % 128;
        int i3 = i2 % 2;
        boolean z = false;
        if (str != null) {
            if (!str.isEmpty()) {
                c = '\"';
            } else {
                c = 27;
            }
            if (c != 27) {
                return getHeaders(Charset.forName(getMethod("䤇䥹礉錆鷇窳").intern()).encode(str));
            }
            return new byte[0];
        }
        int i4 = i + 23;
        AGRequest$Builder = i4 % 128;
        if (i4 % 2 == 0) {
            z = true;
        }
        if (!z) {
            return null;
        }
        throw new NullPointerException("hashCode");
    }
}
