// File: /workspace/github_c_makefile_star2_O0/gaultier[P]lox-c/value.c
// Function: value_to_str
const char* value_to_str(Value v) {
    static char str[UINT8_MAX + 1] = "";
    memset(str, 0, UINT8_MAX + 1);

    switch (v.type) {
        case VAL_BOOL:
            snprintf(str, UINT8_MAX, "%s", v.as.boolean ? "true" : "false");
            break;
        case VAL_NIL:
            snprintf(str, UINT8_MAX, "nil");
            break;
        case VAL_NUMBER:
            snprintf(str, UINT8_MAX, "%g", v.as.number);
            break;
        case VAL_OBJ:
            switch (AS_OBJ(v)->type) {
                case OBJ_STRING:
                    snprintf(str, UINT8_MAX, "%.*s", (int)AS_STRING(v)->len,
                             AS_CSTRING(v));
                    break;
                case OBJ_FUNCTION:
                    snprintf(str, UINT8_MAX, "fn@%.*s", (int)AS_FN(v)->name_len,
                             AS_FN(v)->name);
                    break;
                case OBJ_NATIVE:
                    snprintf(str, UINT8_MAX, "fn@<native>");
                    break;
            }
            break;
    }
    return str;
}

// Assembly:
subq $0x38, %rsp
movl %edi, 0x28(%rsp)
movq %rsi, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x9a04(%rip)     # 0x10310
movaps %xmm0, 0x99ed(%rip)     # 0x10300
movaps %xmm0, 0x99d6(%rip)     # 0x102f0
movaps %xmm0, 0x99bf(%rip)     # 0x102e0
movaps %xmm0, 0x99a8(%rip)     # 0x102d0
movaps %xmm0, 0x9991(%rip)     # 0x102c0
movaps %xmm0, 0x997a(%rip)     # 0x102b0
movaps %xmm0, 0x9963(%rip)     # 0x102a0
movaps %xmm0, 0x994c(%rip)     # 0x10290
movaps %xmm0, 0x9935(%rip)     # 0x10280
movaps %xmm0, 0x991e(%rip)     # 0x10270
movaps %xmm0, 0x9907(%rip)     # 0x10260
movaps %xmm0, 0x98f0(%rip)     # 0x10250
movaps %xmm0, 0x98d9(%rip)     # 0x10240
movaps %xmm0, 0x98c2(%rip)     # 0x10230
movaps %xmm0, 0x98ab(%rip)     # 0x10220
movl 0x28(%rsp), %eax
movq %rax, 0x20(%rsp)
subq $0x3, %rax
ja 0x6abc
movq 0x20(%rsp), %rax
leaq 0x54bc(%rip), %rcx      # 0xbe50
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb 0x30(%rsp), %dl
leaq 0x54f3(%rip), %rcx      # 0xbe9b
leaq 0x54e7(%rip), %rax      # 0xbe96
testb $0x1, %dl
cmovneq %rax, %rcx
leaq 0x9863(%rip), %rdi      # 0x10220
movl $0xff, %esi
leaq 0x54ca(%rip), %rdx      # 0xbe93
movb $0x0, %al
callq 0x10c0
jmp 0x6abc
leaq 0x9844(%rip), %rdi      # 0x10220
movl $0xff, %esi
leaq 0x54b9(%rip), %rdx      # 0xbea1
movb $0x0, %al
callq 0x10c0
jmp 0x6abc
movsd 0x30(%rsp), %xmm0
leaq 0x981f(%rip), %rdi      # 0x10220
movl $0xff, %esi
leaq 0x5498(%rip), %rdx      # 0xbea5
movb $0x1, %al
callq 0x10c0
jmp 0x6abc
movq 0x30(%rsp), %rax
movl (%rax), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x6a40
jmp 0x6a2a
movl 0xc(%rsp), %eax
subl $0x1, %eax
je 0x6a70
jmp 0x6a35
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x6aa0
jmp 0x6aba
movq 0x30(%rsp), %rax
movq 0x10(%rax), %rax
movl %eax, %ecx
movq 0x30(%rsp), %r8
addq $0x18, %r8
leaq 0x97c5(%rip), %rdi      # 0x10220
movl $0xff, %esi
leaq 0x5444(%rip), %rdx      # 0xbeab
movb $0x0, %al
callq 0x10c0
jmp 0x6aba
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rax
movl %eax, %ecx
movq 0x30(%rsp), %r8
addq $0x38, %r8
leaq 0x9795(%rip), %rdi      # 0x10220
movl $0xff, %esi
leaq 0x5411(%rip), %rdx      # 0xbea8
movb $0x0, %al
callq 0x10c0
jmp 0x6aba
leaq 0x9779(%rip), %rdi      # 0x10220
movl $0xff, %esi
leaq 0x53fd(%rip), %rdx      # 0xbeb0
movb $0x0, %al
callq 0x10c0
jmp 0x6abc
leaq 0x975d(%rip), %rax      # 0x10220
addq $0x38, %rsp
retq
nopl (%rax,%rax)