// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x18(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x330e4
jmp 0x3310a
movsd -0x18(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x330f6
jmp 0x33127
movq -0x18(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x33127
jmp 0x3314c
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0x18(%rbp), %rax
movabsq $-0x5000000000000, %rcx # imm = 0xFFFB000000000000
cmpq %rcx, %rax
jne 0x3314c
movq -0x18(%rbp), %rdi
callq 0x7b260
movq %rax, %rdi
callq 0x355c0
movl %eax, %edi
callq 0x35590
movq %rax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x3327c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0xe, -0x8(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x7966b(%rip), %rsi     # 0xac7d0
callq 0x1c640
cmpq $0x0, %rax
je 0x33182
movq -0x18(%rbp), %rdi
callq 0x7b260
movq %rax, -0x10(%rbp)
jmp 0x3327c
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
callq 0x6d0d0
cmpl $0x0, %eax
je 0x3326a
xorl %eax, %eax
testb $0x1, %al
jne 0x331a4
jmp 0x331cd
movsd -0x18(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x331b6
jmp 0x331ea
movq -0x18(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x331ea
jmp 0x33258
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq -0x18(%rbp), %rax
movabsq $-0x4800000000000, %rcx # imm = 0xFFFB800000000000
cmpq %rcx, %rax
jne 0x33258
cmpl $0x2, -0x1c(%rbp)
je 0x33208
cmpl $0x1, -0x1c(%rbp)
je 0x33208
movq -0x18(%rbp), %rsi
leaq 0x55ffa(%rip), %rdi     # 0x891fb
movb $0x0, %al
callq 0x1ac40
movq -0x28(%rbp), %rax
movq (%rax), %rdi
callq 0x330d0
movq %rax, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x33239
xorl %eax, %eax
movl %eax, -0x40(%rbp)
jmp 0x3324a
movq -0x28(%rbp), %rdi
movl $0x1, %esi
callq 0x1c5e0
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x33268
movl -0x1c(%rbp), %edi
movq -0x28(%rbp), %rsi
callq 0x32c90
movq %rax, -0x10(%rbp)
jmp 0x3327c
movq -0x18(%rbp), %rsi
leaq 0x55fb7(%rip), %rdi     # 0x8922c
movb $0x0, %al
callq 0x1ac40
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)