// File: /workspace/github_c_makefile_star2_O3/voithos[P]awl/src/print.c
// Function: awlval_write_sb
static void awlval_write_sb(stringbuilder_t* sb, const awlval* v) {
    switch (v->type) {
        case AWLVAL_ERR:
            stringbuilder_write(sb, "Error: %s", v->err);
            break;

        case AWLVAL_INT:
            stringbuilder_write(sb, "%li", v->lng);
            break;

        case AWLVAL_FLOAT:
            stringbuilder_write(sb, "%f", v->dbl);
            break;

        case AWLVAL_SYM:
            stringbuilder_write(sb, "%s", v->sym);
            break;

        case AWLVAL_QSYM:
            stringbuilder_write(sb, ":'%s'", v->sym);
            break;

        case AWLVAL_STR:
            awlval_print_str(sb, v);
            break;

        case AWLVAL_BOOL:
            if (v->bln) {
                stringbuilder_write(sb, "true");
            } else {
                stringbuilder_write(sb, "false");
            }
            break;

        case AWLVAL_BUILTIN:
            stringbuilder_write(sb, "<builtin %s>", v->builtin_name);
            break;

        case AWLVAL_FN:
            stringbuilder_write(sb, "(fn ");
            awlval_write_sb(sb, v->formals);
            stringbuilder_write(sb, " ");
            awlval_write_sb(sb, v->body);
            stringbuilder_write(sb, ")");
            break;

        case AWLVAL_MACRO:
            stringbuilder_write(sb, "(macro ");
            awlval_write_sb(sb, v->formals);
            stringbuilder_write(sb, " ");
            awlval_write_sb(sb, v->body);
            stringbuilder_write(sb, ")");
            break;

        case AWLVAL_DICT:
            awlval_dict_print(sb, v->d);
            break;

        case AWLVAL_SEXPR:
            awlval_expr_print(sb, v, "(", ")");
            break;

        case AWLVAL_QEXPR:
            awlval_expr_print(sb, v, "{", "}");
            break;

        case AWLVAL_EEXPR:
            awlval_expr_print(sb, v, "\\", "");
            break;

        case AWLVAL_CEXPR:
            awlval_expr_print(sb, v, "@", "");
            break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rsi), %eax
cmpq $0xe, %rax
ja 0xf820
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x3dd6(%rip), %rcx      # 0x13588
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%r14), %rdx
leaq 0x3e08(%rip), %rsi      # 0x135ce
jmp 0xf847
leaq 0x3d8d(%rip), %rdx      # 0x1355c
jmp 0xf8ec
leaq 0x3588(%rip), %rdx      # 0x12d63
leaq 0x3583(%rip), %rcx      # 0x12d65
jmp 0xf8f3
movq 0x18(%r14), %rdx
leaq 0x3de3(%rip), %rsi      # 0x135d5
jmp 0xf847
leaq 0x356c(%rip), %rdx      # 0x12d67
leaq 0x3764(%rip), %rcx      # 0x12f66
jmp 0xf8f3
leaq 0x3de5(%rip), %rsi      # 0x135f3
jmp 0xf9d9
movq 0x18(%r14), %rdx
leaq 0x3da6(%rip), %rsi      # 0x135c4
jmp 0xf847
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x18(%r14), %rdx
leaq 0x2d0f(%rip), %rsi      # 0x12549
jmp 0xf847
movq 0x20(%r14), %rdx
leaq 0x3d9a(%rip), %rsi      # 0x135e1
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1151e
movsd 0x18(%r14), %xmm0
leaq 0x3d66(%rip), %rsi      # 0x135d2
movq %rbx, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1151e
movq 0x18(%r14), %r14
movq %r14, %rdi
callq 0x2110
leaq 0x1(%rax), %rdi
callq 0x2290
testq %rax, %rax
je 0xfa34
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x2080
movq %r15, %rdi
callq 0xbb28
movq %rax, %r14
leaq 0x3336(%rip), %rsi      # 0x12bf8
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1151e
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x23f0
leaq 0x3620(%rip), %rdx      # 0x12f0c
leaq 0x35fa(%rip), %rcx      # 0x12eed
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xfa39
cmpb $0x1, 0x18(%r14)
jne 0xfa2b
leaq 0x3c65(%rip), %rsi      # 0x13583
jmp 0xfa13
movq 0x18(%r14), %r15
leaq 0x343b(%rip), %rsi      # 0x12d69
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1151e
movq %r15, %rdi
callq 0x5b3d
movl %eax, %r12d
movq %r15, %rdi
callq 0x5b41
movq %rax, %r14
movq %r15, %rdi
callq 0x5b88
movq %rax, %r15
testl %r12d, %r12d
jle 0xf9b9
leal -0x1(%r12), %ebp
movl %r12d, %r12d
xorl %r13d, %r13d
movq (%r14,%r13,8), %rdx
movq %rbx, %rdi
leaq 0x3c5e(%rip), %rsi      # 0x135d5
xorl %eax, %eax
callq 0x1151e
movq %rbx, %rdi
leaq 0x3bca(%rip), %rsi      # 0x13552
xorl %eax, %eax
callq 0x1151e
movq (%r15,%r13,8), %rsi
movq %rbx, %rdi
callq 0xf792
cmpq %r13, %rbp
je 0xf9b1
movq %rbx, %rdi
leaq 0x3ba8(%rip), %rsi      # 0x13552
xorl %eax, %eax
callq 0x1151e
incq %r13
cmpq %r13, %r12
jne 0xf969
movq %r14, %rdi
callq 0x23f0
movq %r15, %rdi
callq 0x23f0
leaq 0x3586(%rip), %rsi      # 0x12f56
jmp 0xfa13
leaq 0x3c15(%rip), %rsi      # 0x135ee
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1151e
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0xf792
leaq 0x3b5c(%rip), %rsi      # 0x13552
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1151e
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0xf792
leaq 0x3352(%rip), %rsi      # 0x12d65
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1151e
leaq 0x3ba9(%rip), %rsi      # 0x135db
jmp 0xfa13
callq 0x2650