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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,0x14(%rsp)
  mov    %rsi,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    $0x800,%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    0x8(%r15),%rdi
  mov    %rax,%rsi
  call   <realpath@plt>
  mov    %rbp,%rdi
  call   <parent_dir@plt>
  mov    %rax,0x18(%rsp)
  lea    D16(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rax,%r13
  movq   $0x0,0x28(%rsp)
  movq   $0x0,0x30(%rsp)
  mov    $0x1,%r12d
  lea    D38(%rip),%rax
  mov    %rax,0x8(%rsp)
  mov    $0x0,%ebp
  lea    0x30(%rsp),%r14
  jmp    L49
L63:
  mov    $0x0,%r12d
L49:
  lea    0x28(%rsp),%rdi
  mov    %r13,%rdx
  mov    %r14,%rsi
  call   <getline@plt>
  cmp    $0xffffffff,%eax
  je     L71
  test   %r12d,%r12d
  jne    L63
  mov    %ebp,%edi
  add    0x30(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    0x8(%rsp),%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    0x28(%rsp),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  add    0x30(%rsp),%ebp
  mov    %rbx,0x8(%rsp)
  jmp    L49
L71:
  mov    $0xff,%edi
  call   <malloc@plt>
  mov    %rax,%rsi
  lea    D39(%rip),%rax
  mov    %rax,(%rsi)
  lea    D35(%rip),%rax
  mov    %rax,0x8(%rsi)
  mov    %rbx,0x10(%rsi)
  mov    0x18(%rsp),%rax
  mov    %rax,0x18(%rsi)
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  jle    L22
  mov    %eax,%ecx
  mov    $0x0,%edx
L41:
  mov    0x10(%r15,%rdx,8),%rax
  mov    %rax,0x20(%rsi,%rdx,8)
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L41
  mov    0x14(%rsp),%eax
  add    $0x4,%eax
L33:
  cltq
  movq   $0x0,(%rsi,%rax,8)
  lea    D20(%rip),%rdi
  call   <execv@plt>
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L79
  mov    $0x0,%eax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L22:
  mov    $0x4,%eax
  jmp    L33
L79:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D16
type: string
name: extract_symbolic_data
arguments: tag: D38
type: string
name: extract_symbolic_data
arguments: tag: D39
type: string
name: extract_symbolic_data
arguments: tag: D35
type: string
name: extract_symbolic_data
arguments: tag: D20
type: string

tool: D16: r

tool: 

tool: D39: bash

tool: D35: -c

tool: D20: /bin/bash

assistant: ```c
int main(int argc, char **argv) {
  char *script = malloc(2048);
  realpath(argv[1], script);
  char *script_parent = parent_dir(script);
  FILE *script_fp = fopen(script, "r");
  char *line = NULL;
  size_t line_len = 0;
  char *accum;
  int accum_len = 0;
  char *prev_accum = "";
  int is_first_line = 1;
  while (getline(&line, &line_len, script_fp) != -1) {
    if (!is_first_line) {
      accum = malloc(accum_len + line_len);
      strcpy(accum, prev_accum);
      strcat(accum, line);
      accum_len += line_len;
      prev_accum = accum;
    } else {
      is_first_line = 0;
    }
  }
  char *script_src = accum;
  char **script_args = malloc(255);
  script_args[0] = "bash";
  script_args[1] = "-c";
  script_args[2] = script_src;
  script_args[3] = script_parent;
  int script_arg_count = 4;
  for (int i = 0; i < argc; i++) {
    script_args[i + 4] = argv[i + 2];
    script_arg_count += 1;
  }
  script_args[script_arg_count] = (char *)NULL;
  execv("/bin/bash", script_args);
}
```