user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %r15
  mov    $0x100,%esi
  mov    $0xd,%edi
  push   %r14
  push   %r13
  lea    D86(%rip),%r13
  push   %r12
  lea    D20(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x438,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x428(%rsp)
  xor    %eax,%eax
  call   <long2d@plt>
  mov    $0x100,%esi
  mov    $0xd,%edi
  mov    %rax,0x8(%rsp)
  call   <long2d@plt>
  mov    %r13,%rsi
  mov    %r12,%rdi
  mov    %rax,0x10(%rsp)
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L141
L181:
  lea    0x20(%rsp),%r14
  mov    $0x80,%ecx
  xor    %eax,%eax
  xor    %ebx,%ebx
  mov    %r14,%rdi
  mov    $0x1,%r13d
  rep stos %rax,%es:(%rdi)
L127:
  lea    0x3(%rbx),%ecx
  mov    %r13d,%r12d
  mov    $0xffff8000,%r15d
  shl    %cl,%r12d
  xchg   %ax,%ax
L250:
  mov    %r15d,%edi
  add    %r12d,%r15d
  call   <Slinear2ulaw@plt>
  mov    %ebx,0x20(%rsp,%rax,4)
  cmp    $0x7fff,%r15d
  jle    L250
  add    $0x1,%ebx
  cmp    $0xd,%ebx
  jne    L127
  mov    $0x100,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    %r14,%r13
  lea    D106(%rip),%rsi
  lea    0x41c(%rsp),%r12
  call   <fprintf@plt>
  lea    D129(%rip),%rbx
  nopl   0x0(%rax,%rax,1)
L194:
  mov    0x0(%r13),%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  add    $0x4,%r13
  call   <fprintf@plt>
  cmp    %r13,%r12
  jne    L194
  mov    0x41c(%rsp),%edx
  mov    %rbp,%rdi
  lea    D133(%rip),%rsi
  xor    %eax,%eax
  call   <fprintf@plt>
  xor    %edi,%edi
L219:
  mov    0x8(%rsp),%rax
  xor    %esi,%esi
  mov    %edi,%ecx
  mov    (%rax,%rdi,8),%rdx
  mov    $0x3fc,%eax
  cs nopw 0x0(%rax,%rax,1)
L255:
  cmp    %edi,(%r14,%rax,1)
  jl     L139
  mov    %esi,(%rdx,%rax,1)
  add    $0x1,%esi
L139:
  sub    $0x4,%rax
  cmp    $0x1fc,%rax
  jne    L255
  mov    $0x3fc,%eax
  nopl   (%rax)
L68:
  cmp    %ecx,(%r14,%rax,1)
  jge    L140
  mov    %esi,(%rdx,%rax,1)
  add    $0x1,%esi
L140:
  sub    $0x4,%rax
  cmp    $0x1fc,%rax
  jne    L68
  mov    $0x1f8,%eax
  mov    $0xffffffff,%esi
  nopw   0x0(%rax,%rax,1)
L13:
  cmp    %ecx,(%r14,%rax,1)
  jl     L32
  mov    %esi,(%rdx,%rax,1)
  sub    $0x1,%esi
L32:
  sub    $0x4,%rax
  cmp    $0xfffffffffffffffc,%rax
  jne    L13
  mov    %esi,0x1fc(%rdx)
  lea    -0x1(%rsi),%r8d
  mov    $0x1f8,%eax
  nopl   (%rax)
L176:
  cmp    %ecx,(%r14,%rax,1)
  jge    L203
  mov    %r8d,(%rdx,%rax,1)
  sub    $0x1,%r8d
L203:
  sub    $0x4,%rax
  cmp    $0xfffffffffffffffc,%rax
  jne    L176
  mov    0x10(%rsp),%rax
  mov    (%rax,%rdi,8),%rsi
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L102:
  movslq (%rdx,%rax,4),%rcx
  mov    %eax,0x200(%rsi,%rcx,4)
  add    $0x1,%rax
  cmp    $0x100,%rax
  jne    L102
  add    $0x1,%rdi
  cmp    $0xd,%rdi
  jne    L219
  mov    0x8(%rsp),%r15
  mov    0x10(%rsp),%r14
  movl   $0x0,(%rsp)
  mov    %r15,%r12
  mov    %r14,%rbx
L148:
  xor    %r13d,%r13d
  nopw   0x0(%rax,%rax,1)
L24:
  mov    (%r14),%rax
  mov    (%r15),%rcx
  mov    %r13d,%edx
  movslq (%rax,%r13,4),%rsi
  lea    -0x80(%r13),%eax
  cmp    %eax,(%rcx,%rsi,4)
  je     L36
  mov    (%rsp),%esi
  lea    D93(%rip),%rdi
  call   <error_exit@plt>
L36:
  add    $0x1,%r13
  cmp    $0x100,%r13
  jne    L24
  addl   $0x1,(%rsp)
  mov    (%rsp),%eax
  add    $0x8,%r15
  add    $0x8,%r14
  cmp    $0xd,%eax
  jne    L148
  mov    %rbp,%rdi
  mov    $0x100,%ecx
  mov    $0xd,%edx
  xor    %eax,%eax
  lea    D138(%rip),%rsi
  lea    D31(%rip),%r13
  call   <fprintf@plt>
  mov    0x8(%rsp),%rax
  lea    D25(%rip),%r14
  lea    0x68(%rax),%rdi
  add    $0x60,%rax
  mov    %rdi,0x18(%rsp)
  mov    %rax,(%rsp)
L195:
  mov    %rbp,%rsi
  mov    $0x7b,%edi
  xor    %r15d,%r15d
  call   <fputc@plt>
  nopl   (%rax)
L65:
  mov    (%r12),%rax
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    (%rax,%r15,1),%edx
  xor    %eax,%eax
  add    $0x4,%r15
  call   <fprintf@plt>
  cmp    $0x3fc,%r15
  jne    L65
  cmp    %r12,(%rsp)
  je     L264
  mov    (%r12),%rax
  mov    %r14,%rsi
  mov    %rbp,%rdi
  add    $0x8,%r12
  mov    0x3fc(%rax),%edx
  xor    %eax,%eax
  call   <fprintf@plt>
  cmp    %r12,0x18(%rsp)
  jne    L195
  jmp    L59
  nopl   0x0(%rax)
L264:
  mov    0x8(%rsp),%rax
  lea    D75(%rip),%rsi
  mov    %rbp,%rdi
  mov    0x60(%rax),%rax
  mov    0x3fc(%rax),%edx
  xor    %eax,%eax
  call   <fprintf@plt>
L59:
  mov    %rbp,%rsi
  mov    $0xa,%edi
  lea    D25(%rip),%r14
  call   <fputc@plt>
  mov    %rbp,%rdi
  mov    $0x100,%ecx
  xor    %eax,%eax
  mov    $0xd,%edx
  lea    D3(%rip),%rsi
  call   <fprintf@plt>
  mov    0x10(%rsp),%rax
  lea    0x68(%rax),%rdi
  lea    0x60(%rax),%r12
  mov    %rdi,(%rsp)
L120:
  mov    %rbp,%rsi
  mov    $0x7b,%edi
  xor    %r15d,%r15d
  call   <fputc@plt>
  nopl   0x0(%rax,%rax,1)
L171:
  mov    (%rbx),%rax
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    (%rax,%r15,1),%edx
  xor    %eax,%eax
  add    $0x4,%r15
  call   <fprintf@plt>
  cmp    $0x3fc,%r15
  jne    L171
  cmp    %rbx,%r12
  je     L103
  mov    (%rbx),%rax
  mov    %r14,%rsi
  mov    %rbp,%rdi
  add    $0x8,%rbx
  mov    0x3fc(%rax),%edx
  xor    %eax,%eax
  call   <fprintf@plt>
  cmp    (%rsp),%rbx
  jne    L120
  jmp    L90
  nopl   0x0(%rax,%rax,1)
L103:
  mov    0x10(%rsp),%rax
  lea    D75(%rip),%rsi
  mov    %rbp,%rdi
  mov    0x60(%rax),%rax
  mov    0x3fc(%rax),%edx
  xor    %eax,%eax
  call   <fprintf@plt>
L90:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x428(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L230
  add    $0x438,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L141:
  mov    %r13,%rdx
  mov    %r12,%rsi
  lea    D54(%rip),%rdi
  call   <perror_exit@plt>
  jmp    L181
L230:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D86
type_infered: string
name: read_data
arguments: data_tag: D20
type_infered: string
name: read_data
arguments: data_tag: D106
type_infered: string
name: read_data
arguments: data_tag: D129
type_infered: string
name: read_data
arguments: data_tag: D133
type_infered: string
name: read_data
arguments: data_tag: D93
type_infered: string
name: read_data
arguments: data_tag: D138
type_infered: string
name: read_data
arguments: data_tag: D31
type_infered: string
name: read_data
arguments: data_tag: D25
type_infered: string
name: read_data
arguments: data_tag: D75
type_infered: string
name: read_data
arguments: data_tag: D3
type_infered: string
name: read_data
arguments: data_tag: D54
type_infered: string

tool: D86: w

tool: D20: bitshift.h

tool: D106: char ulaw_maxshift[%d] = {

tool: D129: %d,

tool: D133: %d};



tool: D93: identity maping failed for shift: %d	index: %d


tool: D138: schar ulaw_inward[%d][%d] = {


tool: D31: %ld,

tool: D25: %ld},


tool: D75: %ld}
};


tool: D3: uchar ulaw_outward[%d][%d] = {


tool: D54: fopen("%s", "%s")

assistant: ```c
int main() {
  FILE *fout;
  char *filename = "bitshift.h", *writemode = "w";
  int shift, i;
  int tab[256];
  int sample;
  int **forwardmap = long2d((unsigned int)13, (unsigned int)256);
  int **reversemap = long2d((unsigned int)13, (unsigned int)256);
  fout = fopen(filename, writemode);
  if (fout == NULL)
    perror_exit("fopen(\"%s\", \"%s\")", filename, writemode);
  for (i = 0; i < 256; i++)
    tab[i] = 0;
  for (shift = 0; shift < 13; shift++)
    for (sample = -(1L << 15); sample < (1L << 15); sample += 1 << (shift + 3))
      tab[Slinear2ulaw(sample)] = shift;
  fprintf(fout, "char ulaw_maxshift[%d] = {", 256);
  for (i = 0; i < 256 - 1; i++)
    fprintf(fout, "%d,", tab[i]);
  fprintf(fout, "%d};\n\n", tab[256 - 1]);
  for (shift = 0; shift < 13; shift++) {
    int nused;
    nused = 0;
    for (i = 255; i >= 128; i--)
      if (tab[i] >= shift)
        forwardmap[shift][i] = nused++;
    for (i = 255; i >= 128; i--)
      if (tab[i] < shift)
        forwardmap[shift][i] = nused++;
    nused = -1;
    for (i = 126; i >= 0; i--)
      if (tab[i] >= shift)
        forwardmap[shift][i] = nused--;
    forwardmap[shift][127] = nused--;
    for (i = 126; i >= 0; i--)
      if (tab[i] < shift)
        forwardmap[shift][i] = nused--;
    for (i = 0; i < 256; i++)
      reversemap[shift][forwardmap[shift][i] + 128] = i;
  }
  for (shift = 0; shift < 13; shift++)
    for (i = 0; i < 256; i++)
      if (forwardmap[shift][reversemap[shift][i]] != i - 128)
        error_exit("identity maping failed for shift: %d\tindex: %d\n", shift, i);
  fprintf(fout, "schar ulaw_inward[%d][%d] = {\n", 13, 256);
  for (shift = 0; shift < 13; shift++) {
    fprintf(fout, "{");
    for (i = 0; i < 256 - 1; i++)
      fprintf(fout, "%ld,", forwardmap[shift][i]);
    if (shift != 13 - 1)
      fprintf(fout, "%ld},\n", forwardmap[shift][256 - 1]);
    else
      fprintf(fout, "%ld}\n};\n", forwardmap[shift][256 - 1]);
  }
  fprintf(fout, "\n");
  fprintf(fout, "uchar ulaw_outward[%d][%d] = {\n", 13, 256);
  for (shift = 0; shift < 13; shift++) {
    fprintf(fout, "{");
    for (i = 0; i < 256 - 1; i++)
      fprintf(fout, "%ld,", reversemap[shift][i]);
    if (shift != 13 - 1)
      fprintf(fout, "%ld},\n", reversemap[shift][256 - 1]);
    else
      fprintf(fout, "%ld}\n};\n", reversemap[shift][256 - 1]);
  }
  fclose(fout);
  return (0);
}
```