// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movabsq $-0x800000000000, %r15  # imm = 0xFFFF800000000000
andq %rdi, %r15
movabsq $-0x5000000000000, %rax # imm = 0xFFFB000000000000
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
cmpq %rax, %r15
jne 0x25703
movq %r14, %rdi
callq 0x4b1f1
movq %rax, %r14
leaq 0x32e6d(%rip), %rsi     # 0x5820f
movq %rax, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x2572b
leaq 0x32e5b(%rip), %rsi     # 0x58214
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x25788
leaq 0x32e49(%rip), %rsi     # 0x58219
movq %r14, %rdi
callq 0x44ca9
pushq $0x2
popq %r15
testl %eax, %eax
je 0x2578c
leaq 0x36c2f(%rip), %rsi     # 0x5c01a
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x2578c
leaq 0x2989b(%rip), %rsi     # 0x4ec9d
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257d0
leaq 0x32e04(%rip), %rsi     # 0x5821d
movq %r14, %rdi
callq 0x44ca9
pushq $0x4
popq %r15
testl %eax, %eax
je 0x2578c
leaq 0x32def(%rip), %rsi     # 0x58223
movq %r14, %rdi
callq 0x44ca9
pushq $0x5
popq %r12
testl %eax, %eax
je 0x257d4
leaq 0x32ddc(%rip), %rsi     # 0x5822b
movq %r14, %rdi
callq 0x44ca9
pushq $0x6
popq %r13
testl %eax, %eax
je 0x257e4
leaq 0x32dc0(%rip), %rsi     # 0x5822a
movq %r14, %rdi
callq 0x44ca9
pushq $0x7
popq %rcx
testl %eax, %eax
je 0x257dc
leaq 0x2982d(%rip), %rsi     # 0x4ecb1
movq %r14, %rdi
callq 0x44ca9
pushq $0x8
popq %rcx
testl %eax, %eax
je 0x257dc
leaq 0x29812(%rip), %rsi     # 0x4ecb0
movq %r14, %rdi
callq 0x44ca9
pushq $0x9
popq %rcx
testl %eax, %eax
je 0x257dc
leaq 0x2980c(%rip), %rsi     # 0x4ecc4
movq %r14, %rdi
callq 0x44ca9
pushq $0xa
popq %rcx
testl %eax, %eax
je 0x257dc
leaq 0x297f1(%rip), %rsi     # 0x4ecc3
movq %r14, %rdi
callq 0x44ca9
pushq $0xb
popq %rcx
testl %eax, %eax
je 0x257dc
leaq 0x297eb(%rip), %rsi     # 0x4ecd7
movq %r14, %rdi
callq 0x44ca9
pushq $0xc
popq %rcx
testl %eax, %eax
je 0x257dc
leaq 0x297d0(%rip), %rsi     # 0x4ecd6
movq %r14, %rdi
callq 0x44ca9
pushq $0xd
popq %rcx
testl %eax, %eax
je 0x257dc
leaq 0x31370(%rip), %rsi     # 0x56890
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x256fc
leaq 0x32cf9(%rip), %rsi     # 0x58230
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257ec
leaq 0x32ce8(%rip), %rsi     # 0x58236
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x2578c
leaq 0x32cd5(%rip), %rsi     # 0x5823a
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257d4
leaq 0x32cc2(%rip), %rsi     # 0x5823e
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257e4
leaq 0x32cae(%rip), %rsi     # 0x58241
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257f6
leaq 0x32c9a(%rip), %rsi     # 0x58244
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x25800
leaq 0x32c87(%rip), %rsi     # 0x58248
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x2580a
leaq 0x32c74(%rip), %rsi     # 0x5824c
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x25814
leaq 0x32c61(%rip), %rsi     # 0x58250
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x2581e
leaq 0x347cf(%rip), %rsi     # 0x59dd5
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257ec
leaq 0x347c1(%rip), %rsi     # 0x59dde
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x256fc
leaq 0x32c21(%rip), %rsi     # 0x58255
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257e4
leaq 0x32c10(%rip), %rsi     # 0x5825b
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x25800
leaq 0x36b4b(%rip), %rsi     # 0x5c1ad
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x25814
leaq 0x3f740(%rip), %rsi     # 0x64db9
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257ec
leaq 0x295eb(%rip), %rsi     # 0x4ec7b
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257f6
leaq 0x32bad(%rip), %rsi     # 0x58254
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x257f6
leaq 0x32b9c(%rip), %rsi     # 0x5825a
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x2580a
leaq 0x32b8c(%rip), %rsi     # 0x58261
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
je 0x2581e
leaq 0x32b7a(%rip), %rsi     # 0x58266
movq %r14, %rdi
callq 0x44ca9
testl %eax, %eax
jne 0x25842
xorl %r14d, %r14d
pushq $0xd
jmp 0x25724
leaq 0x568a6(%rip), %rsi     # 0x7bfb0
movq %r14, %rdi
callq 0x17f51
testq %rax, %rax
je 0x25736
movq %r14, %rdi
callq 0x4b1f1
movq %rax, %r14
pushq $0xe
popq %r15
jmp 0x257b8
xorl %r14d, %r14d
xorl %r15d, %r15d
jmp 0x257b8
leaq -0x38(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
movq %r14, %rdi
callq 0x45c58
testl %eax, %eax
je 0x25828
movabsq $-0x4800000000000, %rax # imm = 0xFFFB800000000000
movl -0x2c(%rbp), %edi
cmpq %rax, %r15
jne 0x25791
addl $-0x3, %edi
cmpl $-0x3, %edi
jbe 0x25831
movq -0x38(%rbp), %rax
movq (%rax), %rdi
callq 0x25352
movq %rax, %r14
movq %rdx, %r15
cmpl $0x1, -0x2c(%rbp)
jne 0x257a3
xorl %ebx, %ebx
jmp 0x257b5
pushq $0x1
popq %r15
xorl %r14d, %r14d
jmp 0x257b8
movq -0x38(%rbp), %rsi
callq 0x25076
movq %rax, %r14
pushq $0xe
popq %r15
jmp 0x257b5
movq -0x38(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x17f10
movl %eax, %ebx
shlq $0x20, %rbx
movl %r15d, %r15d
orq %rbx, %r15
movq %r14, %rax
movq %r15, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x3
jmp 0x2578a
xorl %r14d, %r14d
movq %r12, %r15
jmp 0x257b8
xorl %r14d, %r14d
movq %rcx, %r15
jmp 0x257b8
xorl %r14d, %r14d
movq %r13, %r15
jmp 0x257b8
xorl %r14d, %r14d
pushq $0xc
jmp 0x25724
xorl %r14d, %r14d
pushq $0x7
jmp 0x25724
xorl %r14d, %r14d
pushq $0x8
jmp 0x25724
xorl %r14d, %r14d
pushq $0x9
jmp 0x25724
xorl %r14d, %r14d
pushq $0xa
jmp 0x25724
xorl %r14d, %r14d
pushq $0xb
jmp 0x25724
leaq 0x329cd(%rip), %rdi     # 0x581fc
jmp 0x25838
leaq 0x32993(%rip), %rdi     # 0x581cb
movq %r14, %rsi
xorl %eax, %eax
callq 0x176c9
leaq 0x32a23(%rip), %rdi     # 0x5826c
jmp 0x25838