user: Converte this assembly snippet into its equivalent C code:

```asm
<text2code>:
  endbr64
  push   %r15
  mov    %rdi,%r8
  mov    $0x10,%ecx
  mov    %rdx,%r15
  push   %r14
  xor    %r14d,%r14d
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  lea    D51(%rip),%rsi
  push   %rbx
  lea    D40(%rip),%rbx
  sub    $0xa8,%rsp
  mov    %rdx,(%rsp)
  lea    0x10(%rsp),%r13
  mov    %r13,%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  rep stos %rax,%es:(%rdi)
  mov    %r8,%rdi
  call   <fopen@plt>
  lea    D46(%rip),%rsi
  mov    %rbp,%rdi
  mov    %rax,%r12
  call   <fopen@plt>
  mov    %r15,%rdi
  mov    %rax,%rbp
  call   <count_lines@plt>
  lea    D26(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,0xc(%rsp)
  mov    %eax,%edx
  xor    %eax,%eax
  call   <fprintf@plt>
  jmp    L17
  nopl   0x0(%rax)
L33:
  mov    %r15,%rcx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
L104:
  cmp    $0x7f,%r14
  je     L110
L84:
  add    $0x1,%r14
  sub    $0xffffffffffffff80,%r15
L17:
  cmpb   $0x0,(%r15)
  je     L104
  movsbl %r14b,%edx
  cmp    $0x20,%r14
  je     L6
  cmp    $0xa,%r14b
  jne    L33
  mov    %r15,%rdx
  lea    D31(%rip),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  jmp    L104
  cs nopw 0x0(%rax,%rax,1)
L114:
  mov    %r12,%rdi
  call   <fgetc@plt>
  test   %al,%al
  js     L20
  mov    (%rsp),%rdi
  movsbl %al,%edx
  mov    %r13,%rsi
  call   <codetext@plt>
L20:
  mov    %r13,%rdi
  call   <strlen@plt>
  cmp    $0x7,%eax
  jg     L120
L110:
  mov    %r12,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L114
  mov    %r13,%rdi
  call   <strlen@plt>
  movslq %eax,%r14
  test   %r14,%r14
  jne    L112
L107:
  xor    %edx,%edx
  xor    %esi,%esi
  mov    %rbp,%rdi
  call   <fseek@plt>
  mov    0xc(%rsp),%ecx
  mov    %r14,%rdx
  mov    %rbp,%rdi
  lea    D16(%rip),%rsi
  xor    %eax,%eax
  call   <fprintf@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L111
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L6:
  mov    %r15,%rdx
  lea    D29(%rip),%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <fprintf@plt>
  jmp    L84
L120:
  mov    %r13,%rdi
  call   <bin2dec@plt>
  mov    %rbp,%rsi
  movzbl %al,%edi
  call   <fputc@plt>
  mov    %r13,%rdi
  call   <move_code@plt>
  jmp    L110
L112:
  mov    %r13,%rdi
  call   <final_num@plt>
  mov    %rbp,%rsi
  movzbl %al,%edi
  call   <fputc@plt>
  jmp    L107
L111:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D51
type: string
name: extract_symbolic_data
arguments: tag: D40
type: string
name: extract_symbolic_data
arguments: tag: D46
type: string
name: extract_symbolic_data
arguments: tag: D26
type: string
name: extract_symbolic_data
arguments: tag: D31
type: string
name: extract_symbolic_data
arguments: tag: D16
type: string
name: extract_symbolic_data
arguments: tag: D29
type: string

tool: D51: r

tool: D40: %c - %s


tool: D46: w

tool: D26: %d

 

tool: D31: '\n' - %s


tool: D16: %lu
%d


tool: D29: ' ' - %s


assistant: ```c
void text2code(const char *input_name, const char *output_name, char code_arr[128][128]) {
  char code[128];
  for (int i = 0; i < 128; i++)
    code[i] = '\0';
  FILE *input;
  input = fopen(input_name, "r");
  FILE *output;
  output = fopen(output_name, "w");
  int lines = count_lines(code_arr);
  fprintf(output, "%d\n\n ", lines);
  for (int i = 0; i < 128; i++)
    if (code_arr[i][0] != '\0') {
      if ((char)i == ' ') {
        fprintf(output, "' ' - %s\n", code_arr[i]);
        continue;
      }
      if ((char)i == '\n') {
        fprintf(output, "'\\n' - %s\n", code_arr[i]);
        continue;
      }
      fprintf(output, "%c - %s\n", (char)i, code_arr[i]);
    }
  char sign;
  while (!feof(input)) {
    sign = fgetc(input);
    if ((int)sign >= 0)
      codetext(code_arr, code, sign);
    if (strlen(code) >= 8) {
      int coded = bin2dec(code);
      unsigned char out_sign = coded;
      fprintf(output, "%c", out_sign);
      move_code(code);
    }
  }
  unsigned long int while_eof = strlen(code);
  if (while_eof > 0) {
    int coded = final_num(code);
    unsigned char out_sign = coded;
    fprintf(output, "%c", out_sign);
  }
  fseek(output, 0, 0);
  fprintf(output, "%lu\n%d\n", while_eof, lines);
  fclose(input);
  fclose(output);
}
```