// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x18820
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x5c781
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
movq %rax, -0x28(%rbp)
subq $0x5c, %rax
ja 0x5c703
movq -0x28(%rbp), %rax
leaq 0x39271(%rip), %rcx     # 0x95850
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
leaq 0x394e7(%rip), %rsi     # 0x95ada
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x394d0(%rip), %rsi     # 0x95add
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x394b9(%rip), %rsi     # 0x95ae0
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x394a2(%rip), %rsi     # 0x95ae3
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x3948b(%rip), %rsi     # 0x95ae6
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x39474(%rip), %rsi     # 0x95ae9
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x3945d(%rip), %rsi     # 0x95aec
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x39446(%rip), %rsi     # 0x95aef
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x3942f(%rip), %rsi     # 0x95af2
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x39418(%rip), %rsi     # 0x95af5
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movq -0x8(%rbp), %rdi
leaq 0x39401(%rip), %rsi     # 0x95af8
movl $0x2, %edx
callq 0x18790
jmp 0x5c771
movzbl -0x19(%rbp), %eax
cmpl $0x20, %eax
jl 0x5c715
movzbl -0x19(%rbp), %eax
cmpl $0x7e, %eax
jle 0x5c762
movb $0x5c, -0x1d(%rbp)
movb $0x78, -0x1c(%rbp)
movzbl -0x19(%rbp), %eax
sarl $0x4, %eax
andl $0xf, %eax
movslq %eax, %rcx
leaq 0x3c25f(%rip), %rax     # 0x98990
movb (%rax,%rcx), %al
movb %al, -0x1b(%rbp)
movzbl -0x19(%rbp), %eax
andl $0xf, %eax
movslq %eax, %rcx
leaq 0x3c248(%rip), %rax     # 0x98990
movb (%rax,%rcx), %al
movb %al, -0x1a(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x1d(%rbp), %rsi
movl $0x4, %edx
callq 0x18790
jmp 0x5c76f
movq -0x8(%rbp), %rdi
movzbl -0x19(%rbp), %esi
callq 0x18820
jmp 0x5c771
jmp 0x5c773
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5c5a8
movq -0x8(%rbp), %rdi
movl $0x22, %esi
callq 0x18820
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)