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

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D72(%rip),%rsi
  lea    D66(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbx
  movl   $0x0,0x4(%rsp)
  lea    0x4(%rsp),%rbp
L102:
  mov    %rbx,%rcx
  mov    $0x1,%edx
  mov    $0x1,%esi
  mov    %rbp,%rdi
  call   <fwrite@plt>
  mov    0x4(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x4(%rsp)
  cmp    $0xff,%eax
  jle    L102
  mov    %rbx,%rdi
  call   <fclose@plt>
  lea    D96(%rip),%rdi
  call   <system@plt>
  lea    D68(%rip),%rdi
  call   <puts@plt>
  lea    D82(%rip),%rdi
  call   <puts@plt>
  lea    D13(%rip),%rsi
  lea    D57(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbx
  movl   $0x0,0x4(%rsp)
  lea    D125(%rip),%rbp
  jmp    L96
L64:
  mov    $0x2c,%edi
  call   <putchar@plt>
  mov    0x4(%rsp),%eax
  and    $0x7,%eax
  cmp    $0x7,%eax
  je     L50
L27:
  mov    0x4(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x4(%rsp)
  cmp    $0xff,%eax
  jg     L119
L96:
  lea    0x2(%rsp),%rdi
  mov    %rbx,%rcx
  mov    $0x1,%edx
  mov    $0x2,%esi
  call   <fread@plt>
  movswl 0x2(%rsp),%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0xff,0x4(%rsp)
  jne    L64
L50:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L27
L119:
  mov    %rbx,%rdi
  call   <fclose@plt>
  lea    D43(%rip),%rdi
  call   <puts@plt>
  lea    D114(%rip),%rdi
  call   <system@plt>
  lea    D73(%rip),%rdi
  call   <puts@plt>
  lea    D13(%rip),%rsi
  lea    D57(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%rbx
  movl   $0x0,0x4(%rsp)
  lea    D125(%rip),%rbp
  jmp    L23
L107:
  mov    $0x2c,%edi
  call   <putchar@plt>
  mov    0x4(%rsp),%eax
  and    $0x7,%eax
  cmp    $0x7,%eax
  je     L28
L105:
  mov    0x4(%rsp),%eax
  add    $0x1,%eax
  mov    %eax,0x4(%rsp)
  cmp    $0xff,%eax
  jg     L97
L23:
  lea    0x2(%rsp),%rdi
  mov    %rbx,%rcx
  mov    $0x1,%edx
  mov    $0x2,%esi
  call   <fread@plt>
  movswl 0x2(%rsp),%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0xff,0x4(%rsp)
  jne    L107
L28:
  mov    $0xa,%edi
  call   <putchar@plt>
  jmp    L105
L97:
  mov    %rbx,%rdi
  call   <fclose@plt>
  lea    D43(%rip),%rdi
  call   <puts@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L95
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L95:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D72
type_infered: string
name: parse_data
arguments: tag: D66
type_infered: string
name: parse_data
arguments: tag: D96
type_infered: string
name: parse_data
arguments: tag: D68
type_infered: string
name: parse_data
arguments: tag: D82
type_infered: string
name: parse_data
arguments: tag: D13
type_infered: string
name: parse_data
arguments: tag: D57
type_infered: string
name: parse_data
arguments: tag: D125
type_infered: string
name: parse_data
arguments: tag: D43
type_infered: string
name: parse_data
arguments: tag: D114
type_infered: string
name: parse_data
arguments: tag: D73
type_infered: string

tool: D72: wb

tool: D66: alaw.dat

tool: D96: sox -t raw -A -r 8000 -b alaw.dat -t sw alaw.out

tool: D68: // Generated by TOOLS/alaw-gen.c

tool: D82: 
short alaw2short[]={

tool: D13: rb

tool: D57: alaw.out

tool: D125: %6d

tool: D43: };

tool: D114: sox -t raw -U -r 8000 -b alaw.dat -t sw alaw.out

tool: D73: 
short ulaw2short[]={

assistant: ```c
int main(void) {
  int i;
  FILE *f;
  f = fopen("alaw.dat", "wb");
  for (i = 0; i < 256; i++)
    fwrite(&i, 1, 1, f);
  fclose(f);
  system("sox -t raw -A -r 8000 -b alaw.dat -t sw alaw.out");
  printf("// Generated by TOOLS/alaw-gen.c\n");
  printf("\nshort alaw2short[]={\n");
  f = fopen("alaw.out", "rb");
  for (i = 0; i < 256; i++) {
    signed short x;
    fread(&x, 2, 1, f);
    printf("%6d", x);
    if (i != 255)
      putchar(',');
    if ((i & 7) == 7)
      printf("\n");
  }
  fclose(f);
  printf("};\n");
  system("sox -t raw -U -r 8000 -b alaw.dat -t sw alaw.out");
  printf("\nshort ulaw2short[]={\n");
  f = fopen("alaw.out", "rb");
  for (i = 0; i < 256; i++) {
    signed short x;
    fread(&x, 2, 1, f);
    printf("%6d", x);
    if (i != 255)
      putchar(',');
    if ((i & 7) == 7)
      printf("\n");
  }
  fclose(f);
  printf("};\n");
  return 0;
}
```