// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: str_trace_
void str_trace_(VAL v, int fd) {
    STR* str = VSTR(v);
    ASSERT(str->size <= SIZE_MAX);
    write(fd, "\"", 1);
    USIZE i0 = 0;
    char xb[4]={'\\','x'};
    USIZE i;
    for (i = 0; i < str->size; i++) {
        const char* c = NULL; size_t n=0;
        uint8_t v=str->data[i];
        switch(v) {
            case '\n': c="\\n"; n=2; break;
            case '\r': c="\\r"; n=2; break;
            case '\t': c="\\t"; n=2; break;
            case '\\': c="\\\\"; n=2; break;
            case '\"': c="\\\""; n=2; break;
            default:
                if (!((' ' <= v) && (v < 0x7F))) {
                    xb[2] = '0' + (v&15) + ('A'-'9'-1)*((v&15) > 9);
                    xb[3] = '0' + (v/16) + ('A'-'9'-1)*((v/16) > 9);
                    c=xb; n=4;
                }
        }
        if ((n > 0) && (i0 < i)) {
            write(fd, str->data+i0, (size_t)(i-i0));
            i0=i+1;
        }
        write(fd, c, n);
    }
    if (i0 < i) write(fd, str->data+i0, (size_t)(i-i0));
    write(fd, "\"", 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %eax
movq %rdi, %r12
leaq 0xa96d(%rip), %rsi      # 0xec620
movl $0x1, %edx
movl %eax, -0x2c(%rbp)
movl %eax, %edi
callq 0x5060
movl $0x785c, -0x30(%rbp)    # imm = 0x785C
cmpq $0x0, 0x10(%r12)
je 0xe1de2
leaq 0x18(%r12), %rax
movq %rax, -0x38(%rbp)
xorl %r14d, %r14d
xorl %r15d, %r15d
movq %r12, -0x40(%rbp)
movq -0x38(%rbp), %rax
movb (%rax,%r15), %cl
movzbl %cl, %edx
movl $0x2, %r12d
movb $0x1, %al
cmpl $0xc, %edx
jle 0xe1d18
cmpl $0x5c, %edx
je 0xe1d2b
cmpl $0x22, %edx
je 0xe1d34
cmpl $0xd, %edx
jne 0xe1d46
leaq 0x1b0b3(%rip), %r13     # 0xfcdc9
jmp 0xe1d97
cmpl $0x9, %edx
je 0xe1d3d
cmpl $0xa, %edx
jne 0xe1d46
leaq 0x1b09d(%rip), %r13     # 0xfcdc6
jmp 0xe1d97
leaq 0xa8f0(%rip), %r13      # 0xec622
jmp 0xe1d97
leaq 0xa8e4(%rip), %r13      # 0xec61f
jmp 0xe1d97
leaq 0x1b07f(%rip), %r13     # 0xfcdc3
jmp 0xe1d97
leal -0x20(%rcx), %edx
xorl %r13d, %r13d
cmpb $0x5f, %dl
jae 0xe1d58
xorl %eax, %eax
xorl %r12d, %r12d
jmp 0xe1d97
movl %ecx, %esi
andb $0xf, %sil
movl $0x7, %edx
movl $0x7, %edi
cmpb $0xa, %sil
jae 0xe1d70
xorl %edi, %edi
addb %sil, %dil
addb $0x30, %dil
movb %dil, -0x2e(%rbp)
cmpb $-0x60, %cl
jae 0xe1d82
xorl %edx, %edx
shrb $0x4, %cl
addb %cl, %dl
addb $0x30, %dl
movb %dl, -0x2d(%rbp)
movl $0x4, %r12d
leaq -0x30(%rbp), %r13
testb %al, %al
je 0xe1dbe
cmpq %r15, %r14
jae 0xe1dbe
movq -0x38(%rbp), %rax
leaq (%rax,%r14), %rsi
movq %r15, %rdx
subq %r14, %rdx
movl -0x2c(%rbp), %ebx
movl %ebx, %edi
callq 0x5060
leaq 0x1(%r15), %r14
jmp 0xe1dc1
movl -0x2c(%rbp), %ebx
movl %ebx, %edi
movq %r13, %rsi
movq %r12, %rdx
callq 0x5060
incq %r15
movq -0x40(%rbp), %r12
cmpq 0x10(%r12), %r15
jb 0xe1ce8
jmp 0xe1de8
xorl %r15d, %r15d
xorl %r14d, %r14d
subq %r14, %r15
movl -0x2c(%rbp), %ebx
jbe 0xe1e02
leaq (%r12,%r14), %rsi
addq $0x18, %rsi
movl %ebx, %edi
movq %r15, %rdx
callq 0x5060
leaq 0xa817(%rip), %rsi      # 0xec620
movl $0x1, %edx
movl %ebx, %edi
callq 0x5060
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq