// File: /workspace/github_cpp_makefile_star2_O2/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 0x4b90(%rip), %rax      # 0x6fb0
je 0x24bd
cmpq 0x4b2b(%rip), %rax      # 0x6f58
je 0x24c4
cmpq 0x4b96(%rip), %rax      # 0x6fd0
je 0x24d3
cmpq 0x4b49(%rip), %rax      # 0x6f90
je 0x24d9
cmpq 0x4b6c(%rip), %rax      # 0x6fc0
je 0x24ff
cmpq 0x4b17(%rip), %rax      # 0x6f78
je 0x2506
cmpq 0x4b12(%rip), %rax      # 0x6f80
je 0x2515
cmpq 0x4af5(%rip), %rax      # 0x6f70
je 0x2523
cmpq 0x4b00(%rip), %rax      # 0x6f88
je 0x2531
cmpq 0x4acb(%rip), %rax      # 0x6f60
je 0x2561
cmpq 0x4b36(%rip), %rax      # 0x6fd8
je 0x25b1
cmpq 0x4af9(%rip), %rax      # 0x6fa8
jne 0x24e5
leaq 0x1cfd(%rip), %rsi      # 0x41b5
jmp 0x2597
movzbl 0x8(%r14), %esi
jmp 0x24dd
movzwl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x2280
jmp 0x24e5
movl 0x8(%r14), %esi
jmp 0x24dd
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x2100
leaq 0x1d2f(%rip), %rsi      # 0x421b
movq %rbx, %rdi
callq 0x21a0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movsbl 0x8(%r14), %esi
jmp 0x2519
movswl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x2170
jmp 0x24e5
movl 0x8(%r14), %esi
movq %rbx, %rdi
callq 0x2290
jmp 0x24e5
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x2190
jmp 0x24e5
movss 0x8(%r14), %xmm0
ucomiss %xmm0, %xmm0
jp 0x25de
movd %xmm0, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x7f800000, %eax       # imm = 0x7F800000
jne 0x25a4
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2590
leaq 0x1c4a(%rip), %rsi      # 0x41a9
jmp 0x2597
movsd 0x8(%r14), %xmm0
ucomisd %xmm0, %xmm0
jp 0x25de
movq %xmm0, %rax
btrq $0x3f, %rax
movabsq $0x7ff0000000000000, %rcx # imm = 0x7FF0000000000000
cmpq %rcx, %rax
jne 0x25d1
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x2558
leaq 0x1c13(%rip), %rsi      # 0x41aa
movq %rbx, %rdi
callq 0x21a0
jmp 0x24e5
movq %rbx, %rdi
callq 0x2120
jmp 0x24e5
leaq 0x1bfb(%rip), %rsi      # 0x41b3
movq %rbx, %rdi
callq 0x21a0
movq 0x8(%r14), %rsi
movq %rax, %rdi
callq 0x2130
jmp 0x24e5
movq %rbx, %rdi
callq 0x2260
jmp 0x24e5
leaq 0x1bbb(%rip), %rsi      # 0x41a0
jmp 0x2597