user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movw   $0x920,0x1d(%rsp)
  movb   $0x0,0x1f(%rsp)
  mov    $0x100,%edi
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  movl   $0x100,0xc(%rsp)
  mov    $0x100,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  lea    D4(%rip),%rdx
  lea    D31(%rip),%rsi
  mov    0x10(%rsp),%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  lea    D89(%rip),%rsi
  mov    0x10(%rsp),%rdi
  call   <fopen@plt>
  test   %rax,%rax
  je     L8
  mov    %rax,%r12
  lea    D76(%rip),%rsi
  lea    D19(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r13
  lea    D108(%rip),%r14
  test   %rax,%rax
  jne    L74
  lea    D79(%rip),%rdi
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L87
L8:
  lea    D132(%rip),%rdi
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
  jmp    L87
L99:
  lea    0x20(%rsp),%rbp
  mov    $0x14,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    %rbp,%rdx
  mov    %r14,%rsi
  mov    0x10(%rsp),%rdi
  call   <sscanf@plt>
  lea    D9(%rip),%rsi
  mov    %rbp,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L149
  mov    %rbp,%rdi
  lea    D94(%rip),%rsi
  call   <strstr@plt>
  test   %rax,%rax
  je     L88
L149:
  mov    %r13,%rsi
  mov    0x10(%rsp),%rdi
  call   <fputs@plt>
L74:
  mov    $0x100,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  lea    0xc(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  mov    %r12,%rdx
  call   <getline@plt>
  test   %rax,%rax
  js     L76
  mov    0x10(%rsp),%rbp
  mov    $0x23,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  je     L99
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <fputs@plt>
  jmp    L74
L88:
  mov    $0x1,%ebp
  lea    0x1d(%rsp),%r15
  jmp    L89
L11:
  mov    %r15,%rsi
  mov    0x10(%rsp),%rdi
  call   <strtok@plt>
  mov    %rax,%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L92:
  add    $0x1,%ebp
L89:
  cmp    $0x1,%ebp
  je     L11
  mov    %r15,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rcx
  test   %rax,%rax
  je     L74
  mov    %rbx,%rdx
  lea    D133(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  cmp    $0xa,%ebp
  jle    L92
  mov    %r13,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  jmp    L74
L76:
  mov    %r13,%rdi
  call   <fclose@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  lea    D4(%rip),%rdx
  lea    D135(%rip),%rsi
  mov    0x10(%rsp),%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    0x10(%rsp),%rdi
  call   <system@plt>
  lea    D101(%rip),%rdi
  call   <system@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    %rbx,%rdi
  call   <free@plt>
L87:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L20
  mov    $0x0,%eax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L20:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D4
datatype: string
name: extract_symbolic_data
arguments: data_tag: D31
datatype: string
name: extract_symbolic_data
arguments: data_tag: D89
datatype: string
name: extract_symbolic_data
arguments: data_tag: D76
datatype: string
name: extract_symbolic_data
arguments: data_tag: D19
datatype: string
name: extract_symbolic_data
arguments: data_tag: D108
datatype: string
name: extract_symbolic_data
arguments: data_tag: D79
datatype: string
name: extract_symbolic_data
arguments: data_tag: D132
datatype: string
name: extract_symbolic_data
arguments: data_tag: D9
datatype: string
name: extract_symbolic_data
arguments: data_tag: D94
datatype: string
name: extract_symbolic_data
arguments: data_tag: D133
datatype: string
name: extract_symbolic_data
arguments: data_tag: D135
datatype: string
name: extract_symbolic_data
arguments: data_tag: D101
datatype: string

tool: D4: /usr/lib/npreal2/driver

tool: D31: %s/npreal2d.cf

tool: D89: r

tool: D76: w

tool: D19: /tmp/npr_tmpfile3

tool: D108: %s

tool: D79: file open error2


tool: D132: file open error1


tool: D9: ttymajor

tool: D94: calloutmajor

tool: D133: %s	%s

tool: D135: cp -f /tmp/npr_tmpfile3 %s/npreal2d.cf

tool: D101: rm -f /tmp/npr_tmpfile3

assistant: ```c
int main(int arg, char *argv[]) {
  int i, j, len, flag;
  char *tmpstr, *token, *minor_token, *chk;
  char delim[] = " \t";
  char major[20];
  FILE *f, *ft;
  tmpstr = (char *)malloc(256);
  len = 256;
  token = (char *)malloc(256);
  sprintf(tmpstr, "%s/npreal2d.cf", "/usr/lib/npreal2/driver");
  f = fopen(tmpstr, "r");
  if (f == NULL) {
    printf("file open error1\n");
    free(tmpstr);
    free(token);
    return (0);
  }
  ft = fopen("/tmp/npr_tmpfile3", "w");
  if (ft == NULL) {
    printf("file open error2\n");
    free(tmpstr);
    free(token);
    return (0);
  }
  for (;;) {
    flag = 0;
    memset(token, '\0', 256);
    if (getline(&tmpstr, (size_t *)&len, f) < 0) {
      break;
    }
    if (strstr(tmpstr, "#") != NULL) {
      fputs(tmpstr, ft);
      continue;
    }
    memset(major, '\0', 20);
    sscanf(tmpstr, "%s", major);
    if (strstr(major, "ttymajor") != NULL || strstr(major, "calloutmajor") != NULL) {
      fputs(tmpstr, ft);
      continue;
    }
    for (i = 0; i < 11; i++) {
      if (i == 0) {
        minor_token = strtok(tmpstr, delim);
        sprintf(token, "%s", minor_token);
      } else {
        chk = strtok(NULL, delim);
        if (chk == NULL) {
          flag = 1;
          break;
        }
        sprintf(token, "%s\t%s", token, chk);
      }
    }
    if (flag == 1) {
      continue;
    }
    fputs(token, ft);
  }
  fclose(ft);
  fclose(f);
  sprintf(tmpstr, "cp -f /tmp/npr_tmpfile3 %s/npreal2d.cf", "/usr/lib/npreal2/driver");
  system(tmpstr);
  system("rm -f /tmp/npr_tmpfile3");
  free(tmpstr);
  free(token);
  return 0;
}
```