// File: /workspace/github_c_makefile_star2_O2/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, %r14d
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x22
popq %rsi
callq 0x161be
xorl %r12d, %r12d
testl %r14d, %r14d
cmovlel %r12d, %r14d
leaq 0x27f29(%rip), %r13     # 0x644e8
cmpq %r12, %r14
je 0x3c6cd
movzbl (%r15,%r12), %esi
cmpl $0xd, %esi
ja 0x3c5eb
movslq (%r13,%rsi,4), %rax
addq %r13, %rax
jmpq *%rax
movq %rbx, %rdi
leaq 0x28099(%rip), %rsi     # 0x6467f
jmp 0x3c6b3
cmpl $0x1b, %esi
je 0x3c69d
cmpl $0x5c, %esi
je 0x3c6a9
cmpl $0x22, %esi
jne 0x3c611
movq %rbx, %rdi
leaq 0x2806a(%rip), %rsi     # 0x64676
jmp 0x3c6b3
movl %esi, %eax
addb $-0x7f, %al
cmpb $-0x60, %al
ja 0x3c6c3
movw $0x785c, -0x2c(%rbp)    # imm = 0x785C
movl %esi, %eax
shrl $0x4, %eax
leaq 0x2af91(%rip), %rcx     # 0x675c0
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
pushq $0x4
jmp 0x3c6b5
movq %rbx, %rdi
leaq 0x28026(%rip), %rsi     # 0x64679
jmp 0x3c6b3
movq %rbx, %rdi
leaq 0x28029(%rip), %rsi     # 0x64688
jmp 0x3c6b3
movq %rbx, %rdi
leaq 0x28011(%rip), %rsi     # 0x6467c
jmp 0x3c6b3
movq %rbx, %rdi
leaq 0x2800e(%rip), %rsi     # 0x64685
jmp 0x3c6b3
movq %rbx, %rdi
leaq 0x28008(%rip), %rsi     # 0x6468b
jmp 0x3c6b3
movq %rbx, %rdi
leaq 0x28005(%rip), %rsi     # 0x64694
jmp 0x3c6b3
movq %rbx, %rdi
leaq 0x27fe7(%rip), %rsi     # 0x64682
jmp 0x3c6b3
movq %rbx, %rdi
leaq 0x27fe7(%rip), %rsi     # 0x6468e
jmp 0x3c6b3
movq %rbx, %rdi
leaq 0x27fde(%rip), %rsi     # 0x64691
pushq $0x2
popq %rdx
callq 0x16172
incq %r12
jmp 0x3c5bf
movq %rbx, %rdi
callq 0x161be
jmp 0x3c6bb
pushq $0x22
popq %rsi
movq %rbx, %rdi
callq 0x161be
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq