// File: ps-george[P]ansi_c_compiler/src/lexer/lexer_main.cpp
// Function: escape_chars(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string escape_chars(const std::string &before){
    std::string after;
    after.reserve(before.length() + 4);
    for (std::string::size_type i = 0; i < before.length(); ++i) {
        switch (before[i]) {
            // Replace tab character with \t
            case '\t':
              after += '\\';
              after += 't';
              break;
            // Replace newline character with \n - not sure if I need this for ANSI C
            case '\n':
              after += '\\';
              after += 'n';
              break;
            case '\r':
              after += '\\';
              after += 'r';
              break;
            case '\v':
              after += '\\';
              after += 'v';
              break;
            case '\f':
              after += '\\';
              after += 'f';
              break;
            case '\\': // If the next character is an n or t
              if (i+1 < before.length() && (before[i+1]=='n' || before[i+1]=='t' || before[i+1]=='r' || before[i+1]=='v' || before[i+1]=='f')){
                after += before[i];
                break;
              }
            case '\"':
                after += '\\';
                // Fall through.
            default:
                after += before[i];
        }
    }
    return after;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x38(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x2290
movq -0x10(%rbp), %rdi
callq 0x22e0
movq -0x38(%rbp), %rdi
movq %rax, %rsi
addq $0x4, %rsi
callq 0x2300
jmp 0x270f
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22e0
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x297f
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2210
movsbl (%rax), %eax
movl %eax, -0x4c(%rbp)
subl $0x9, %eax
je 0x27c3
jmp 0x2752
movl -0x4c(%rbp), %eax
subl $0xa, %eax
je 0x27e8
jmp 0x2760
movl -0x4c(%rbp), %eax
subl $0xb, %eax
je 0x2832
jmp 0x276e
movl -0x4c(%rbp), %eax
subl $0xc, %eax
je 0x2857
jmp 0x277c
movl -0x4c(%rbp), %eax
subl $0xd, %eax
je 0x280d
jmp 0x278a
movl -0x4c(%rbp), %eax
subl $0x22, %eax
je 0x293d
jmp 0x2798
movl -0x4c(%rbp), %eax
subl $0x5c, %eax
je 0x287c
jmp 0x294f
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x23f8
jmp 0x299c
movq -0x38(%rbp), %rdi
movl $0x5c, %esi
callq 0x2120
jmp 0x27d3
movq -0x38(%rbp), %rdi
movl $0x74, %esi
callq 0x2120
jmp 0x27e3
jmp 0x296c
movq -0x38(%rbp), %rdi
movl $0x5c, %esi
callq 0x2120
jmp 0x27f8
movq -0x38(%rbp), %rdi
movl $0x6e, %esi
callq 0x2120
jmp 0x2808
jmp 0x296c
movq -0x38(%rbp), %rdi
movl $0x5c, %esi
callq 0x2120
jmp 0x281d
movq -0x38(%rbp), %rdi
movl $0x72, %esi
callq 0x2120
jmp 0x282d
jmp 0x296c
movq -0x38(%rbp), %rdi
movl $0x5c, %esi
callq 0x2120
jmp 0x2842
movq -0x38(%rbp), %rdi
movl $0x76, %esi
callq 0x2120
jmp 0x2852
jmp 0x296c
movq -0x38(%rbp), %rdi
movl $0x5c, %esi
callq 0x2120
jmp 0x2867
movq -0x38(%rbp), %rdi
movl $0x66, %esi
callq 0x2120
jmp 0x2877
jmp 0x296c
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x22e0
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jae 0x293b
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
callq 0x2210
movsbl (%rax), %eax
cmpl $0x6e, %eax
je 0x291e
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
callq 0x2210
movsbl (%rax), %eax
cmpl $0x74, %eax
je 0x291e
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
callq 0x2210
movsbl (%rax), %eax
cmpl $0x72, %eax
je 0x291e
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
callq 0x2210
movsbl (%rax), %eax
cmpl $0x76, %eax
je 0x291e
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
callq 0x2210
movsbl (%rax), %eax
cmpl $0x66, %eax
jne 0x293b
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2210
movq -0x38(%rbp), %rdi
movsbl (%rax), %esi
callq 0x2120
jmp 0x2939
jmp 0x296c
jmp 0x293d
movq -0x38(%rbp), %rdi
movl $0x5c, %esi
callq 0x2120
jmp 0x294d
jmp 0x294f
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2210
movq -0x38(%rbp), %rdi
movsbl (%rax), %esi
callq 0x2120
jmp 0x296a
jmp 0x296c
jmp 0x296e
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x2717
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x2992
movq -0x38(%rbp), %rdi
callq 0x23f8
movq -0x40(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x2350
nopw %cs:(%rax,%rax)