// File: /workspace/github_c_makefile_star2_O1/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 0x27d8c
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
movq %r14, %rdi
callq 0x4f838
movq %rax, %r14
leaq 0x357d2(%rip), %rsi     # 0x5d20f
movq %rax, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27dc0
leaq 0x357c0(%rip), %rsi     # 0x5d214
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e1d
leaq 0x357ae(%rip), %rsi     # 0x5d219
movq %r14, %rdi
callq 0x4920e
movl $0x2, %r15d
testl %eax, %eax
je 0x27e23
leaq 0x39592(%rip), %rsi     # 0x6101a
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e23
leaq 0x2c1fe(%rip), %rsi     # 0x53c9d
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e71
leaq 0x35767(%rip), %rsi     # 0x5d21d
movq %r14, %rdi
callq 0x4920e
movl $0x4, %r15d
testl %eax, %eax
je 0x27e23
leaq 0x35750(%rip), %rsi     # 0x5d223
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e79
leaq 0x35741(%rip), %rsi     # 0x5d22b
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e84
leaq 0x35729(%rip), %rsi     # 0x5d22a
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e8f
leaq 0x2c199(%rip), %rsi     # 0x53cb1
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e9a
leaq 0x2c181(%rip), %rsi     # 0x53cb0
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ea5
leaq 0x2c17e(%rip), %rsi     # 0x53cc4
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27eb0
leaq 0x2c166(%rip), %rsi     # 0x53cc3
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ebb
leaq 0x2c163(%rip), %rsi     # 0x53cd7
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ec6
leaq 0x2c14b(%rip), %rsi     # 0x53cd6
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27d7e
leaq 0x33cee(%rip), %rsi     # 0x5b890
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27d7e
leaq 0x35677(%rip), %rsi     # 0x5d230
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ec6
leaq 0x35666(%rip), %rsi     # 0x5d236
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e23
leaq 0x35653(%rip), %rsi     # 0x5d23a
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e79
leaq 0x35640(%rip), %rsi     # 0x5d23e
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e84
leaq 0x3562c(%rip), %rsi     # 0x5d241
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e8f
leaq 0x35618(%rip), %rsi     # 0x5d244
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e9a
leaq 0x35605(%rip), %rsi     # 0x5d248
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ea5
leaq 0x355f2(%rip), %rsi     # 0x5d24c
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27eb0
leaq 0x355df(%rip), %rsi     # 0x5d250
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ebb
leaq 0x3714d(%rip), %rsi     # 0x5edd5
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ec6
leaq 0x3713f(%rip), %rsi     # 0x5edde
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27d7e
leaq 0x3559f(%rip), %rsi     # 0x5d255
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e84
leaq 0x3558e(%rip), %rsi     # 0x5d25b
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e9a
leaq 0x394c9(%rip), %rsi     # 0x611ad
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27eb0
leaq 0x420be(%rip), %rsi     # 0x69db9
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ec6
leaq 0x2bf69(%rip), %rsi     # 0x53c7b
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e8f
leaq 0x3552b(%rip), %rsi     # 0x5d254
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27e8f
leaq 0x3551a(%rip), %rsi     # 0x5d25a
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ea5
leaq 0x3550a(%rip), %rsi     # 0x5d261
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
je 0x27ebb
leaq 0x354f8(%rip), %rsi     # 0x5d266
movq %r14, %rdi
callq 0x4920e
testl %eax, %eax
jne 0x27eeb
xorl %r14d, %r14d
movl $0xd, %r15d
jmp 0x27e5d
leaq 0x5a21d(%rip), %rsi     # 0x81fb0
movq %r14, %rdi
callq 0x19a7e
testq %rax, %rax
je 0x27dcb
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
movq %r14, %rdi
callq 0x4f838
movq %rax, %r14
movl $0xe, %r15d
jmp 0x27e5d
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x27e5d
leaq -0x28(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
movq %r14, %rdi
callq 0x4a23e
testl %eax, %eax
je 0x27ed1
movabsq $-0x4800000000000, %rax # imm = 0xFFFB800000000000
movl -0x1c(%rbp), %edi
cmpq %rax, %rbx
jne 0x27e28
addl $-0x3, %edi
cmpl $-0x3, %edi
jbe 0x27eda
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x279f1
movq %rax, %r14
movq %rdx, %r15
cmpl $0x1, -0x1c(%rbp)
jne 0x27e46
xorl %ebx, %ebx
jmp 0x27e5a
movl $0x1, %r15d
xorl %r14d, %r14d
jmp 0x27e5d
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
movq -0x28(%rbp), %rsi
callq 0x276c8
movq %rax, %r14
movl $0xe, %r15d
jmp 0x27e5a
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x19a3d
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 0x27e23
xorl %r14d, %r14d
movl $0x5, %r15d
jmp 0x27e5d
xorl %r14d, %r14d
movl $0x6, %r15d
jmp 0x27e5d
xorl %r14d, %r14d
movl $0x7, %r15d
jmp 0x27e5d
xorl %r14d, %r14d
movl $0x8, %r15d
jmp 0x27e5d
xorl %r14d, %r14d
movl $0x9, %r15d
jmp 0x27e5d
xorl %r14d, %r14d
movl $0xa, %r15d
jmp 0x27e5d
xorl %r14d, %r14d
movl $0xb, %r15d
jmp 0x27e5d
xorl %r14d, %r14d
movl $0xc, %r15d
jmp 0x27e5d
leaq 0x35324(%rip), %rdi     # 0x5d1fc
jmp 0x27ee1
leaq 0x352ea(%rip), %rdi     # 0x5d1cb
movq %r14, %rsi
xorl %eax, %eax
callq 0x1917b
leaq 0x3537a(%rip), %rdi     # 0x5d26c
jmp 0x27ee1