// File: /workspace/github_c_makefile_star2_O3/janet-lang[P]janet/src/core/pp.c
// Function: janet_escape_string_impl
static void janet_escape_string_impl(JanetBuffer *buffer, const uint8_t *str, int32_t len) {
    janet_buffer_push_u8(buffer, '"');
    for (int32_t i = 0; i < len; ++i) {
        uint8_t c = str[i];
        switch (c) {
            case '"':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\\"", 2);
                break;
            case '\n':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\n", 2);
                break;
            case '\r':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\r", 2);
                break;
            case '\0':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\0", 2);
                break;
            case '\f':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\f", 2);
                break;
            case '\v':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\v", 2);
                break;
            case '\a':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\a", 2);
                break;
            case '\b':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\b", 2);
                break;
            case 27:
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\e", 2);
                break;
            case '\\':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\\\", 2);
                break;
            case '\t':
                janet_buffer_push_bytes(buffer, (const uint8_t *)"\\t", 2);
                break;
            default:
                if (c < 32 || c > 126) {
                    uint8_t buf[4];
                    buf[0] = '\\';
                    buf[1] = 'x';
                    buf[2] = janet_base64[(c >> 4) & 0xF];
                    buf[3] = janet_base64[c & 0xF];
                    janet_buffer_push_bytes(buffer, buf, 4);
                } else {
                    janet_buffer_push_u8(buffer, c);
                }
                break;
        }
    }
    janet_buffer_push_u8(buffer, '"');
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
movl $0x22, %esi
callq 0x17947
testl %r15d, %r15d
jle 0x3fc74
movl %r15d, %r13d
xorl %r15d, %r15d
leaq 0x28963(%rip), %r12     # 0x684c8
movzbl (%r14,%r15), %esi
cmpl $0x1a, %esi
jg 0x3fb92
cmpl $0xd, %esi
ja 0x3fc33
movl %esi, %eax
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq %rbx, %rdi
leaq 0x28ad2(%rip), %rsi     # 0x6865f
jmp 0x3fc1b
cmpl $0x1b, %esi
je 0x3fc05
cmpl $0x5c, %esi
je 0x3fc11
cmpl $0x22, %esi
jne 0x3fc33
movq %rbx, %rdi
leaq 0x28aa7(%rip), %rsi     # 0x68656
jmp 0x3fc1b
movq %rbx, %rdi
leaq 0x28a9e(%rip), %rsi     # 0x68659
jmp 0x3fc1b
movq %rbx, %rdi
leaq 0x28a9b(%rip), %rsi     # 0x68662
jmp 0x3fc1b
movq %rbx, %rdi
leaq 0x28a98(%rip), %rsi     # 0x6866b
jmp 0x3fc1b
movq %rbx, %rdi
leaq 0x28a89(%rip), %rsi     # 0x68668
jmp 0x3fc1b
movq %rbx, %rdi
leaq 0x28a89(%rip), %rsi     # 0x68674
jmp 0x3fc1b
movq %rbx, %rdi
leaq 0x28a65(%rip), %rsi     # 0x6865c
jmp 0x3fc1b
movq %rbx, %rdi
leaq 0x28a62(%rip), %rsi     # 0x68665
jmp 0x3fc1b
movq %rbx, %rdi
leaq 0x28a5f(%rip), %rsi     # 0x6866e
jmp 0x3fc1b
movq %rbx, %rdi
leaq 0x28a56(%rip), %rsi     # 0x68671
movl $0x2, %edx
callq 0x178c5
incq %r15
cmpq %r15, %r13
jne 0x3fb65
jmp 0x3fc74
movl %esi, %eax
addb $-0x7f, %al
cmpb $-0x60, %al
ja 0x3fc6a
movw $0x785c, -0x2c(%rbp)    # imm = 0x785C
movl %esi, %eax
shrl $0x4, %eax
leaq 0x2b953(%rip), %rcx     # 0x6b5a0
movb (%rcx,%rax), %al
movb %al, -0x2a(%rbp)
andl $0xf, %esi
movb (%rcx,%rsi), %al
movb %al, -0x29(%rbp)
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
movl $0x4, %edx
jmp 0x3fc20
movq %rbx, %rdi
callq 0x17947
jmp 0x3fc25
movq %rbx, %rdi
movl $0x22, %esi
callq 0x17947
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq