user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  mov    0x8(%rsi),%rdx
  test   %rdx,%rdx
  je     L146
  mov    %rsi,%rbx
  lea    0x20(%rsp),%rdi
  lea    D41(%rip),%rsi
  call   <sprintf@plt>
  mov    0x8(%rbx),%rdi
  lea    D40(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L91
  lea    0x20(%rsp),%rdi
  lea    D58(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L91
  lea    D24(%rip),%r13
L117:
  lea    0x40(%rsp),%rdi
  mov    %rbp,%rdx
  mov    $0x64,%esi
  call   <fgets@plt>
  test   %rax,%rax
  je     L32
  cmpb   $0x3a,0x48(%rsp)
  jne    L117
  cmpb   $0x20,0x49(%rsp)
  jne    L117
  lea    0x10(%rsp),%rdi
  mov    $0x10,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    $0x0,%r14d
  lea    0x40(%rsp),%rdi
  jmp    L25
L146:
  lea    D19(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L21
L91:
  lea    D12(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L21
L136:
  mov    %rbx,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  cltq
  lea    (%rbx,%rax,1),%rdi
L25:
  mov    %r13,%rsi
  call   <strtok@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L140
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x3,%eax
  jg     L136
  movzbl (%rbx),%eax
  mov    %al,0xe(%rsp)
  movzbl 0x1(%rbx),%eax
  mov    %al,0xf(%rsp)
  lea    0xe(%rsp),%rdi
  call   <AtoH@plt>
  lea    0x1(%r14),%r15d
  movslq %r14d,%r14
  mov    %al,0x10(%rsp,%r14,1)
  mov    %rbx,%rdi
  call   <strlen@plt>
  add    $0x1,%eax
  cltq
  lea    (%rbx,%rax,1),%rdi
  mov    %r15d,%r14d
  jmp    L25
L140:
  cmpb   $0x0,0x10(%rsp)
  je     L117
  lea    0x10(%rsp),%rdi
  mov    %r12,%rcx
  mov    $0x10,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  jmp    L117
L32:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L21:
  mov    0xa8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L5
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D41
type_guessed: string
name: disassemble_data
arguments: data_tag: D40
type_guessed: string
name: disassemble_data
arguments: data_tag: D58
type_guessed: string
name: disassemble_data
arguments: data_tag: D24
type_guessed: string
name: disassemble_data
arguments: data_tag: D19
type_guessed: string
name: disassemble_data
arguments: data_tag: D12
type_guessed: string

tool: D41: %s_v.bin

tool: D40: r

tool: D58: w+

tool: D24: 
 

tool: D19: no src file


tool: D12: open src/dst fail


assistant: ```c
int main(int argc, char *argv[]) {
  char dst_file[20], line[100], *p, xb[2];
  FILE *fp_s, *fp_d;
  unsigned char x, x6[16];
  int i = 0;
  int j = 0;
  if (!argv[1]) {
    printf("no src file\n");
    return -1;
  } else {
    sprintf(dst_file, "%s_v.bin", argv[1]);
  }
  if (((fp_s = fopen(argv[1], "r")) == NULL) || ((fp_d = fopen(dst_file, "w+")) == NULL)) {
    printf("open src/dst fail\n");
    return -1;
  }
  while (fgets(line, sizeof(line), fp_s) != (char *)0) {
    if (line[8] == ':' && line[9] == ' ') {
      p = line;
      i = 0;
      memset(x6, 0, sizeof(x6));
      while (p) {
        p = strtok(p, "\r\n ");
        if (p == NULL)
          break;
        if (strlen(p) > 3) {
          p += strlen(p) + 1;
          continue;
        }
        xb[0] = *p;
        xb[1] = *(p + 1);
        x = AtoH(xb);
        x6[i++] = x;
        p += strlen(p) + 1;
      }
      if (*x6)
        fwrite(x6, 1, sizeof(x6), fp_d);
    }
  }
  fclose(fp_s);
  fclose(fp_d);
  return 0;
}
```