// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/pp.c
// Function: janet_to_string_b
void janet_to_string_b(JanetBuffer *buffer, Janet x) {
    switch (janet_type(x)) {
        case JANET_NIL:
            janet_buffer_push_cstring(buffer, "");
            break;
        case JANET_BOOLEAN:
            janet_buffer_push_cstring(buffer,
                                      janet_unwrap_boolean(x) ? "true" : "false");
            break;
        case JANET_NUMBER:
            number_to_string_b(buffer, janet_unwrap_number(x));
            break;
        case JANET_STRING:
        case JANET_SYMBOL:
        case JANET_KEYWORD:
            janet_buffer_push_bytes(buffer,
                                    janet_unwrap_string(x),
                                    janet_string_length(janet_unwrap_string(x)));
            break;
        case JANET_BUFFER: {
            JanetBuffer *to = janet_unwrap_buffer(x);
            /* Prevent resizing buffer while appending */
            if (buffer == to) janet_buffer_extra(buffer, to->count);
            janet_buffer_push_bytes(buffer, to->data, to->count);
            break;
        }
        case JANET_ABSTRACT: {
            JanetAbstract p = janet_unwrap_abstract(x);
            const JanetAbstractType *t = janet_abstract_type(p);
            if (t->tostring != NULL) {
                t->tostring(p, buffer);
            } else {
                string_description_b(buffer, t->name, p);
            }
        }
        return;
        case JANET_CFUNCTION: {
            JanetCFunRegistry *reg = janet_registry_get(janet_unwrap_cfunction(x));
            if (NULL != reg) {
                janet_buffer_push_cstring(buffer, "<cfunction ");
                if (NULL != reg->name_prefix) {
                    janet_buffer_push_cstring(buffer, reg->name_prefix);
                    janet_buffer_push_u8(buffer, '/');
                }
                janet_buffer_push_cstring(buffer, reg->name);
                janet_buffer_push_u8(buffer, '>');
                break;
            }
            goto fallthrough;
        }
        case JANET_FUNCTION: {
            JanetFunction *fun = janet_unwrap_function(x);
            JanetFuncDef *def = fun->def;
            if (def == NULL) {
                janet_buffer_push_cstring(buffer, "<incomplete function>");
                break;
            }
            if (def->name) {
                const uint8_t *n = def->name;
                janet_buffer_push_cstring(buffer, "<function ");
                janet_buffer_push_bytes(buffer, n, janet_string_length(n));
                janet_buffer_push_u8(buffer, '>');
                break;
            }
            goto fallthrough;
        }
    fallthrough:
        default:
            string_description_b(buffer, janet_type_names[janet_type(x)], janet_unwrap_pointer(x));
            break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rsi, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movsd -0x8(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x5a425
jmp 0x5a436
movq -0x8(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
movl %eax, -0x4c(%rbp)
jmp 0x5a43d
xorl %eax, %eax
movl %eax, -0x4c(%rbp)
jmp 0x5a43d
movl -0x4c(%rbp), %eax
movl %eax, %ecx
movq %rcx, -0x58(%rbp)
subl $0xe, %eax
ja 0x5a684
movq -0x58(%rbp), %rax
leaq 0x3b1c2(%rip), %rcx     # 0x9561c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
leaq 0x3f017(%rip), %rsi     # 0x99485
callq 0x18750
jmp 0x5a6e5
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rcx
andq $0x1, %rcx
leaq 0x3bb51(%rip), %rsi     # 0x95fdc
leaq 0x3bb42(%rip), %rax     # 0x95fd4
cmpq $0x0, %rcx
cmovneq %rax, %rsi
callq 0x18750
jmp 0x5a6e5
movq -0x10(%rbp), %rdi
movsd -0x8(%rbp), %xmm0
callq 0x5a6f0
jmp 0x5a6e5
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7b260
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movl -0x8(%rax), %edx
callq 0x18790
jmp 0x5a6e5
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x5a511
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x18650
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x18790
jmp 0x5a6e5
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x5a566
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
jmp 0x5a57a
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x5a800
jmp 0x5a6e5
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, %rdi
callq 0x6b9c0
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpq -0x30(%rbp), %rax
je 0x5a5fb
movq -0x10(%rbp), %rdi
leaq 0x3b459(%rip), %rsi     # 0x95a00
callq 0x18750
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq 0x10(%rcx), %rax
je 0x5a5d7
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x18750
movq -0x10(%rbp), %rdi
movl $0x2f, %esi
callq 0x18820
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x18750
movq -0x10(%rbp), %rdi
movl $0x3e, %esi
callq 0x18820
jmp 0x5a6e5
jmp 0x5a682
movq -0x8(%rbp), %rdi
callq 0x7b260
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x5a635
movq -0x10(%rbp), %rdi
leaq 0x3b3e1(%rip), %rsi     # 0x95a0c
callq 0x18750
jmp 0x5a6e5
movq -0x40(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x5a680
movq -0x40(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x3b3cb(%rip), %rsi     # 0x95a22
callq 0x18750
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x48(%rbp), %rax
movl -0x8(%rax), %edx
callq 0x18790
movq -0x10(%rbp), %rdi
movl $0x3e, %esi
callq 0x18820
jmp 0x5a6e5
jmp 0x5a682
jmp 0x5a684
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movsd -0x8(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x5a69e
jmp 0x5a6af
movq -0x8(%rbp), %rax
shrq $0x2f, %rax
andq $0xf, %rax
movl %eax, -0x74(%rbp)
jmp 0x5a6b6
xorl %eax, %eax
movl %eax, -0x74(%rbp)
jmp 0x5a6b6
movl -0x74(%rbp), %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x5556c(%rip), %rax     # 0xafc30
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
callq 0x7b260
movq -0x70(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq %rax, %rdx
callq 0x5a800
addq $0x80, %rsp
popq %rbp
retq
nop