// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/ffi.c
// Function: decode_ffi_type
static JanetFFIType decode_ffi_type(Janet x) {
    if (janet_checktype(x, JANET_KEYWORD)) {
        return prim_type(decode_ffi_prim(janet_unwrap_keyword(x)));
    }
    JanetFFIType ret;
    ret.array_count = -1;
    ret.prim = JANET_FFI_TYPE_STRUCT;
    if (janet_checkabstract(x, &janet_struct_type)) {
        ret.st = janet_unwrap_abstract(x);
        return ret;
    }
    int32_t len;
    const Janet *els;
    if (janet_indexed_view(x, &els, &len)) {
        if (janet_checktype(x, JANET_ARRAY)) {
            if (len != 2 && len != 1) janet_panicf("array type must be of form @[type count], got %v", x);
            ret = decode_ffi_type(els[0]);
            int32_t array_count = len == 1 ? 0 : janet_getnat(els, 1);
            ret.array_count = array_count;
        } else {
            ret.st = build_struct_type(len, els);
        }
        return ret;
    } else {
        janet_panicf("bad native type %v", x);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movabsq $-0x800000000000, %rbx  # imm = 0xFFFF800000000000
andq %rdi, %rbx
movabsq $-0x5000000000000, %rax # imm = 0xFFFB000000000000
cmpq %rax, %rbx
jne 0x278c8
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
movq %r14, %rdi
callq 0x4ebc4
movq %rax, %r14
leaq 0x34c96(%rip), %rsi     # 0x5c20f
movq %rax, %rdi
callq 0x4872e
testl %eax, %eax
je 0x278fc
leaq 0x34c84(%rip), %rsi     # 0x5c214
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x27959
leaq 0x34c72(%rip), %rsi     # 0x5c219
movq %r14, %rdi
callq 0x4872e
movl $0x2, %r15d
testl %eax, %eax
je 0x2795f
leaq 0x38a56(%rip), %rsi     # 0x6001a
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x2795f
leaq 0x2b6c2(%rip), %rsi     # 0x52c9d
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279ad
leaq 0x34c2b(%rip), %rsi     # 0x5c21d
movq %r14, %rdi
callq 0x4872e
movl $0x4, %r15d
testl %eax, %eax
je 0x2795f
leaq 0x34c14(%rip), %rsi     # 0x5c223
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279b5
leaq 0x34c05(%rip), %rsi     # 0x5c22b
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279c0
leaq 0x34bed(%rip), %rsi     # 0x5c22a
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279cb
leaq 0x2b65d(%rip), %rsi     # 0x52cb1
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279d6
leaq 0x2b645(%rip), %rsi     # 0x52cb0
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279e1
leaq 0x2b642(%rip), %rsi     # 0x52cc4
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279ec
leaq 0x2b62a(%rip), %rsi     # 0x52cc3
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279f7
leaq 0x2b627(%rip), %rsi     # 0x52cd7
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x27a02
leaq 0x2b60f(%rip), %rsi     # 0x52cd6
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x278ba
leaq 0x331b2(%rip), %rsi     # 0x5a890
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x278ba
leaq 0x34b3b(%rip), %rsi     # 0x5c230
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x27a02
leaq 0x34b2a(%rip), %rsi     # 0x5c236
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x2795f
leaq 0x34b17(%rip), %rsi     # 0x5c23a
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279b5
leaq 0x34b04(%rip), %rsi     # 0x5c23e
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279c0
leaq 0x34af0(%rip), %rsi     # 0x5c241
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279cb
leaq 0x34adc(%rip), %rsi     # 0x5c244
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279d6
leaq 0x34ac9(%rip), %rsi     # 0x5c248
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279e1
leaq 0x34ab6(%rip), %rsi     # 0x5c24c
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279ec
leaq 0x34aa3(%rip), %rsi     # 0x5c250
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279f7
leaq 0x36611(%rip), %rsi     # 0x5ddd5
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x27a02
leaq 0x36603(%rip), %rsi     # 0x5ddde
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x278ba
leaq 0x34a63(%rip), %rsi     # 0x5c255
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279c0
leaq 0x34a52(%rip), %rsi     # 0x5c25b
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279d6
leaq 0x3897d(%rip), %rsi     # 0x6019d
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279ec
leaq 0x41562(%rip), %rsi     # 0x68d99
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x27a02
leaq 0x2b42d(%rip), %rsi     # 0x52c7b
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279cb
leaq 0x349ef(%rip), %rsi     # 0x5c254
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279cb
leaq 0x349de(%rip), %rsi     # 0x5c25a
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279e1
leaq 0x349ce(%rip), %rsi     # 0x5c261
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
je 0x279f7
leaq 0x349bc(%rip), %rsi     # 0x5c266
movq %r14, %rdi
callq 0x4872e
testl %eax, %eax
jne 0x27a27
xorl %r14d, %r14d
movl $0xd, %r15d
jmp 0x27999
leaq 0x596e1(%rip), %rsi     # 0x80fb0
movq %r14, %rdi
callq 0x199b8
testq %rax, %rax
je 0x27907
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
movq %r14, %rdi
callq 0x4ebc4
movq %rax, %r14
movl $0xe, %r15d
jmp 0x27999
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x27999
leaq -0x28(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
movq %r14, %rdi
callq 0x49726
testl %eax, %eax
je 0x27a0d
movabsq $-0x4800000000000, %rax # imm = 0xFFFB800000000000
movl -0x1c(%rbp), %edi
cmpq %rax, %rbx
jne 0x27964
addl $-0x3, %edi
cmpl $-0x3, %edi
jbe 0x27a16
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x2752d
movq %rax, %r14
movq %rdx, %r15
cmpl $0x1, -0x1c(%rbp)
jne 0x27982
xorl %ebx, %ebx
jmp 0x27996
movl $0x1, %r15d
xorl %r14d, %r14d
jmp 0x27999
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
movq -0x28(%rbp), %rsi
callq 0x2723e
movq %rax, %r14
movl $0xe, %r15d
jmp 0x27996
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x19977
movl %eax, %ebx
shlq $0x20, %rbx
movl %r15d, %r15d
orq %rbx, %r15
movq %r14, %rax
movq %r15, %rdx
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x3, %r15d
jmp 0x2795f
xorl %r14d, %r14d
movl $0x5, %r15d
jmp 0x27999
xorl %r14d, %r14d
movl $0x6, %r15d
jmp 0x27999
xorl %r14d, %r14d
movl $0x7, %r15d
jmp 0x27999
xorl %r14d, %r14d
movl $0x8, %r15d
jmp 0x27999
xorl %r14d, %r14d
movl $0x9, %r15d
jmp 0x27999
xorl %r14d, %r14d
movl $0xa, %r15d
jmp 0x27999
xorl %r14d, %r14d
movl $0xb, %r15d
jmp 0x27999
xorl %r14d, %r14d
movl $0xc, %r15d
jmp 0x27999
leaq 0x347e8(%rip), %rdi     # 0x5c1fc
jmp 0x27a1d
leaq 0x347ae(%rip), %rdi     # 0x5c1cb
movq %r14, %rsi
xorl %eax, %eax
callq 0x190bb
leaq 0x3483e(%rip), %rdi     # 0x5c26c
jmp 0x27a1d