// File: /workspace/github_cpp_makefile_star2_O1/skeeto[P]elisp-ffi/ffi-glue.cc
// Function: operator<<(std::ostream&, Value const&)
std::ostream &operator<<(std::ostream &out, const Value &v) {
    if (v.type == &ffi_type_uint8) {
        out << static_cast<unsigned int>(v.value.u8);
    } else if (v.type == &ffi_type_uint16) {
        out << v.value.u16;
    } else if (v.type == &ffi_type_uint32) {
        out << v.value.u32;
    } else if (v.type == &ffi_type_uint64) {
        out << v.value.u64;
    } else if (v.type == &ffi_type_sint8) {
        out << static_cast<int>(v.value.s8);
    } else if (v.type == &ffi_type_sint16) {
        out << v.value.s16;
    } else if (v.type == &ffi_type_sint32) {
        out << v.value.s32;
    } else if (v.type == &ffi_type_sint64) {
        out << v.value.s64;
    } else if (v.type == &ffi_type_float) {
        float value = v.value.f;
        if(std::isnan(value)) {
            out << "0.0e+NaN";
        } else if(std::isinf(value)) {
            if(value < 0) {
                out << "-1.0e+INF";
            } else {
                out << "1.0e+INF";
            }
        } else {
            out << value;
        }
    } else if (v.type == &ffi_type_double) {
        double value = v.value.d;
        if(std::isnan(value)) {
            out << "0.0e+NaN";
        } else if(std::isinf(value)) {
            if(value < 0) {
                out << "-1.0e+INF";
            } else {
                out << "1.0e+INF";
            }
        } else {
            out << value;
        }
    } else if (v.type == &ffi_type_pointer) {
        out << "\\" << v.value.ptr;
    } else if (v.type == &ffi_type_void) {
        out << ":void";
    }
    out << "\n$";
    return out;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rsi), %rax
cmpq 0x3ba0(%rip), %rax      # 0x5fb0
je 0x24b2
cmpq 0x3b3b(%rip), %rax      # 0x5f58
je 0x24b9
cmpq 0x3ba6(%rip), %rax      # 0x5fd0
je 0x24c0
cmpq 0x3b59(%rip), %rax      # 0x5f90
je 0x24c6
cmpq 0x3b7c(%rip), %rax      # 0x5fc0
je 0x24f1
cmpq 0x3b27(%rip), %rax      # 0x5f78
je 0x24f8
cmpq 0x3b22(%rip), %rax      # 0x5f80
je 0x2507
cmpq 0x3b05(%rip), %rax      # 0x5f70
je 0x2515
cmpq 0x3b10(%rip), %rax      # 0x5f88
je 0x2523
cmpq 0x3adb(%rip), %rax      # 0x5f60
je 0x2558
cmpq 0x3b46(%rip), %rax      # 0x5fd8
je 0x25b1
cmpq 0x3b09(%rip), %rax      # 0x5fa8
jne 0x24d2
leaq 0x1d11(%rip), %rsi      # 0x41b9
movl $0x5, %edx
jmp 0x2593
movzbl 0x8(%r14), %esi
jmp 0x24ca
movzwl 0x8(%r14), %esi
jmp 0x24ca
movl 0x8(%r14), %esi
jmp 0x24ca
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x20e0
leaq 0x1d46(%rip), %rsi      # 0x421f
movl $0x2, %edx
movq %rbx, %rdi
callq 0x21b0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movsbl 0x8(%r14), %esi
jmp 0x250b
movswl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x2140
jmp 0x24d2
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x2250
jmp 0x24d2
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x2160
jmp 0x24d2
movss 0x8(%r14), %xmm0
ucomiss %xmm0, %xmm0
jp 0x25d6
movd %xmm0, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x7f800000, %eax       # imm = 0x7F800000
jne 0x25a0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2587
leaq 0x1c5c(%rip), %rsi      # 0x41ad
movl $0x9, %edx
jmp 0x2593
movsd 0x8(%r14), %xmm0
ucomisd %xmm0, %xmm0
jp 0x25d6
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jne 0x25a4
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x254a
leaq 0x1c20(%rip), %rsi      # 0x41ae
movl $0x8, %edx
movq %rbx, %rdi
callq 0x21b0
jmp 0x24d2
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x2230
jmp 0x24d2
leaq 0x1bff(%rip), %rsi      # 0x41b7
movl $0x1, %edx
movq %rbx, %rdi
callq 0x21b0
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x2100
jmp 0x24d2
leaq 0x1bc7(%rip), %rsi      # 0x41a4
jmp 0x258e