// File: /workspace/github_c_makefile_star2_O0/thiagok00[P]INF1715-Compilers/GeraCodigo.c
// Function: traduz_escapes_string
static char* traduz_escapes_string(const char * str, int *len) {

  //char *escapen = "\\0A";
  //char *escapet = "\\09";
  //char *escapecb = "\\5C";
  char *nvstr;
  int i,j, length;

  length = strlen(str);
  nvstr = (char*) malloc((length*3+1)*sizeof(char));
  if (nvstr == NULL) {printf("Falta de memoria\n");exit(1);}
  (*len) = 0;
  for (j = 0, i = 0; i < length; i++) {

    switch(str[i]) {
          case '\n':
            nvstr[j] = '\\';
            j++;
            nvstr[j] = '0';
            j++;
            nvstr[j] = 'A';
            j++;
            (*len)++;
            break;
          case '\t':
            nvstr[j] = '\\';
            j++;
            nvstr[j] = '0';
            j++;
            nvstr[j] = '9';
            j++;
            (*len)++;
            break;
          case '\\':
            nvstr[j] = '\\';
            j++;
            nvstr[j] = '5';
            j++;
            nvstr[j] = 'C';
            j++;
            (*len)++;
            break;
          default:
            nvstr[j] = str[i];
            j++;
            (*len)++;
        }
    }
  nvstr[j] = '\0';
  (*len)++;
  return nvstr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1090
movl %eax, -0x24(%rbp)
imull $0x3, -0x24(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x1130
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x8c72
leaq 0x1dac(%rip), %rdi      # 0xaa0d
movb $0x0, %al
callq 0x10a0
movl $0x1, %edi
callq 0x1190
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x8de8
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
subl $0x9, %eax
je 0x8d16
jmp 0x8cac
movl -0x28(%rbp), %eax
subl $0xa, %eax
je 0x8cc7
jmp 0x8cb6
movl -0x28(%rbp), %eax
subl $0x5c, %eax
je 0x8d62
jmp 0x8dae
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x5c, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x30, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x41, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x8dd8
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x5c, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x30, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x39, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x8dd8
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x5c, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x35, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x43, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x8dd8
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x8dda
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x8c8a
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)