user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc18(%rsp)
  xor    %eax,%eax
  mov    $0x1,%eax
  cmp    $0x2,%edi
  je     L31
L39:
  mov    0xc18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L24
  add    $0xc28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L31:
  mov    0x8(%rsi),%rdx
  lea    0x10(%rsp),%r13
  xor    %eax,%eax
  mov    %rsi,%r12
  mov    %r13,%rdi
  lea    D21(%rip),%rsi
  call   <sprintf@plt>
  mov    %r13,%rdi
  call   <system@plt>
  lea    D60(%rip),%rdi
  lea    D55(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rdi
  mov    %rax,%r14
  call   <feof@plt>
  test   %rax,%rax
  jne    L67
L86:
  mov    0x8(%r12),%rdx
  lea    D36(%rip),%rsi
  mov    %r13,%rdi
  xor    %eax,%eax
  lea    0x410(%rsp),%rbx
  lea    D52(%rip),%r15
  call   <sprintf@plt>
  mov    %r13,%rdi
  lea    0x810(%rsp),%rbp
  call   <system@plt>
  xor    %edx,%edx
  mov    $0x7e,%ecx
  movabs $0x5f5f5f5f5f5f,%rax
  mov    %rax,0x810(%rsp)
  lea    0x820(%rsp),%rdi
  xor    %eax,%eax
  rep stos %rax,%es:(%rdi)
  mov    %rdx,0x818(%rsp)
  mov    %r12,0x8(%rsp)
  jmp    L2
  nopl   0x0(%rax)
L55:
  mov    %rbx,%rdi
  call   <strlen@plt>
  lea    D63(%rip),%rdi
  lea    -0x4(%rax),%esi
  movslq %esi,%rsi
  lea    (%rbx,%rsi,1),%r12
  mov    %r12,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L64
  mov    %r12,%rsi
  lea    D12(%rip),%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L44
L64:
  mov    0x8(%rsp),%rax
  mov    %r13,%rdi
  mov    %rbx,%r9
  mov    %rbx,%rcx
  lea    D44(%rip),%rsi
  mov    0x8(%rax),%rdx
  xor    %eax,%eax
  mov    %rdx,%r8
  call   <sprintf@plt>
  mov    %r13,%rdi
  call   <system@plt>
L44:
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
L2:
  mov    %r15,%rsi
  mov    %r14,%rdi
  mov    %rbx,%rdx
  call   <fscanf@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L55
  xor    %eax,%eax
  jmp    L39
L67:
  lea    D31(%rip),%rdi
  call   <printf@plt>
  jmp    L86
L24:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D21
type: string
name: extract_symbolic_data
arguments: tag: D60
type: string
name: extract_symbolic_data
arguments: tag: D55
type: string
name: extract_symbolic_data
arguments: tag: D36
type: string
name: extract_symbolic_data
arguments: tag: D52
type: string
name: extract_symbolic_data
arguments: tag: D63
type: string
name: extract_symbolic_data
arguments: tag: D12
type: string
name: extract_symbolic_data
arguments: tag: D44
type: string
name: extract_symbolic_data
arguments: tag: D31
type: string

tool: D21: ls $HOME/%s>lsresult.txt

tool: D60: lsresult.txt

tool: D55: r

tool: D36: mkdir "$HOME/%s Sorted"

tool: D52:  %[^
]s

tool: D63: .txt

tool: D12: .dat

tool: D44: sort -n "$HOME/%s/%s" -o "$HOME/%s Sorted/%s"

tool: D31: something's bad


assistant: ```c
int main(int argv, char *args[]) {
  if (argv != 2) {
    return 1;
  }
  char cmd[1024];
  sprintf(cmd, "ls $HOME/%s>lsresult.txt", args[1]);
  system(cmd);
  FILE *fp = fopen("lsresult.txt", "r");
  if (feof(fp))
    printf("something\'s bad\n");
  sprintf(cmd, "mkdir \"$HOME/%s Sorted\"", args[1]);
  system(cmd);
  char filename[1024], f1[1024] = "______";
  while (1) {
    fscanf(fp, " %[^\n]s", filename);
    if (strcmp(f1, filename) == 0)
      break;
    int ext = strlen(filename) - 4;
    if (strcmp(".txt", filename + ext) == 0 || strcmp(".dat", filename + ext) == 0) {
      sprintf(cmd, "sort -n \"$HOME/%s/%s\" -o \"$HOME/%s Sorted/%s\"", args[1], filename, args[1], filename);
      system(cmd);
    }
    strcpy(f1, filename);
  }
  return 0;
}
```