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

```asm
<enc>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x4a8,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x498(%rsp)
  xor    %eax,%eax
  mov    0x10(%rsi),%rdi
  lea    D40(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r12
  mov    0x18(%rbx),%rdi
  lea    D56(%rip),%rsi
  call   <fopen@plt>
  test   %r12,%r12
  je     L52
  mov    %rax,%r14
  test   %rax,%rax
  je     L104
  lea    0x490(%rsp),%rbp
  lea    0x110(%rsp),%r13
L71:
  mov    %r12,%rdi
  call   <feof@plt>
  mov    %eax,0xc(%rsp)
  test   %eax,%eax
  jne    L72
  lea    0x410(%rsp),%r15
  mov    %r15,%rbx
L65:
  mov    %r12,%rdi
  call   <fgetc@plt>
  mov    %al,(%rbx)
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L65
  lea    0x110(%rsp),%rdx
L11:
  movzbl (%r15),%esi
  movzbl 0x1(%r15),%ecx
  mov    %ecx,%eax
  and    $0x7f,%eax
  shl    $0x8,%eax
  add    %esi,%eax
  lea    -0x8000(%rax),%esi
  test   %cl,%cl
  cmovs  %esi,%eax
  mov    %eax,(%rdx)
  movzbl 0x3(%r15),%ecx
  mov    %ecx,%eax
  and    $0x7f,%eax
  shl    $0x8,%eax
  movzbl 0x2(%r15),%esi
  or     %esi,%eax
  lea    -0x8000(%rax),%esi
  test   %cl,%cl
  cmovs  %esi,%eax
  mov    %eax,0x80(%rdx)
  add    $0x4,%r15
  add    $0x4,%rdx
  cmp    %rbp,%r15
  jne    L11
  mov    $0x0,%eax
L118:
  pxor   %xmm0,%xmm0
  cvtsi2ssl (%rax,%r13,1),%xmm0
  mulss  D0(%rip),%xmm0
  movss  %xmm0,0x210(%rsp,%rax,1)
  add    $0x4,%rax
  cmp    $0x100,%rax
  jne    L118
  lea    0x10(%rsp),%rsi
  lea    0x210(%rsp),%rdi
  call   <edct@plt>
  lea    0x90(%rsp),%rsi
  lea    0x290(%rsp),%rdi
  call   <edct@plt>
  mov    $0x0,%eax
L10:
  movss  0x10(%rsp,%rax,1),%xmm0
  mulss  D52(%rip),%xmm0
  cvttss2si %xmm0,%edx
  mov    %edx,0x310(%rsp,%rax,2)
  movss  0x90(%rsp,%rax,1),%xmm0
  mulss  D52(%rip),%xmm0
  cvttss2si %xmm0,%edx
  mov    %edx,0x314(%rsp,%rax,2)
  add    $0x4,%rax
  cmp    $0x80,%rax
  jne    L10
  lea    0x330(%rsp),%r15
  jmp    L25
L52:
  lea    D47(%rip),%rdi
  call   <error@plt>
  jmp    L40
L104:
  lea    D2(%rip),%rdi
  call   <error@plt>
  jmp    L40
L22:
  add    $0x4,%rbx
  cmp    %r15,%rbx
  je     L58
L2:
  movzbl (%rbx),%edi
  test   %edi,%edi
  je     L22
  mov    %r14,%rsi
  call   <fputc@plt>
  jmp    L22
L58:
  addl   $0x8,0xc(%rsp)
  mov    0xc(%rsp),%eax
  add    $0x20,%r15
  cmp    $0x40,%eax
  je     L71
L25:
  cmpb   $0x0,-0x20(%r15)
  setne  %dil
  shl    $0x7,%edi
  mov    %edi,%eax
  or     $0x40,%eax
  cmpb   $0x0,-0x1c(%r15)
  cmovne %eax,%edi
  mov    %edi,%eax
  or     $0x20,%eax
  cmpb   $0x0,-0x18(%r15)
  cmovne %eax,%edi
  mov    %edi,%eax
  or     $0x10,%eax
  cmpb   $0x0,-0x14(%r15)
  cmovne %eax,%edi
  mov    %edi,%eax
  or     $0x8,%eax
  cmpb   $0x0,-0x10(%r15)
  cmovne %eax,%edi
  mov    %edi,%eax
  or     $0x4,%eax
  cmpb   $0x0,-0xc(%r15)
  cmovne %eax,%edi
  mov    %edi,%eax
  or     $0x2,%eax
  cmpb   $0x0,-0x8(%r15)
  cmovne %eax,%edi
  mov    %edi,%eax
  or     $0x1,%eax
  cmpb   $0x0,-0x4(%r15)
  cmovne %eax,%edi
  movsbl %dil,%edi
  mov    %r14,%rsi
  call   <fputc@plt>
  lea    -0x20(%r15),%rbx
  jmp    L2
L72:
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %r14,%rdi
  call   <fclose@plt>
L40:
  mov    0x498(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L154
  add    $0x4a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L154:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D40
data_type: string
name: read_data
arguments: data_tag: D56
data_type: string
name: read_data
arguments: data_tag: D0
data_type: byte[4]
name: read_data
arguments: data_tag: D52
data_type: byte[4]
name: read_data
arguments: data_tag: D47
data_type: string
name: read_data
arguments: data_tag: D2
data_type: string

tool: D40: r

tool: D56: w

tool: {"D0": [0x00,0x00,0x00,0x38]}

tool: {"D52": [0x00,0x00,0x80,0x41]}

tool: D47: Could not open input file

tool: D2: Could not open output file

assistant: ```c
int enc(int argc, char *argv[]) {
  FILE *in;
  FILE *out;
  in = fopen(argv[2], "r");
  out = fopen(argv[3], "w");
  if (in == NULL)
    return error("Could not open input file");
  if (out == NULL)
    return error("Could not open output file");
  unsigned char buf[32 * 4];
  int iarr[32 * 2];
  float darr[32 * 2];
  float doutl[32];
  float doutr[32];
  int iout[32 * 2];
  while (!feof(in)) {
    for (int i = 0; i < 32 * 4; ++i) {
      buf[i] = fgetc(in);
    }
    for (int i = 0; i < 32; ++i) {
      int l = buf[i * 4];
      l += (buf[i * 4 + 1] & 0x7F) * 256;
      if (buf[i * 4 + 1] & 0x80)
        l = (0x8000 - l) * -1;
      iarr[i] = l;
      int r;
      r = 0;
      r |= buf[i * 4 + 2];
      r |= (buf[i * 4 + 3] & 0x7F) * 256;
      if (buf[i * 4 + 3] & 0x80) {
        r = (0x8000 - r) * -1;
      }
      iarr[i + 32] = r;
    }
    for (int i = 0; i < 32 * 2; ++i) {
      darr[i] = ((float)iarr[i]) / 32768.;
    }
    edct(darr, doutl);
    float *darrr = darr + 32;
    edct(darrr, doutr);
    for (int i = 0; i < 32; ++i) {
      iout[i * 2] = doutl[i] * 16;
      iout[i * 2 + 1] = doutr[i] * 16;
    }
    for (int i = 0; i < 32 * 2; i += 8) {
      char control = 0;
      if (iout[i] & 0xFF)
        control |= 128;
      if (iout[i + 1] & 0xFF)
        control |= 64;
      if (iout[i + 2] & 0xFF)
        control |= 32;
      if (iout[i + 3] & 0xFF)
        control |= 16;
      if (iout[i + 4] & 0xFF)
        control |= 8;
      if (iout[i + 5] & 0xFF)
        control |= 4;
      if (iout[i + 6] & 0xFF)
        control |= 2;
      if (iout[i + 7] & 0xFF)
        control |= 1;
      fputc(control, out);
      for (int j = 0; j < 8; ++j) {
        if (iout[i + j] & 0xFF)
          fputc(iout[i + j] & 0xFF, out);
      }
    }
  }
  fclose(in);
  fclose(out);
}
```