user: 这段汇编代码用C语言表示是什么样的?

```asm
<write_wav>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%r12
  mov    %rdx,%r13
  mov    %ecx,%ebx
  test   %ecx,%ecx
  mov    $0xac44,%eax
  cmovle %eax,%ebx
  lea    D39(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <assert@plt>
  mov    %rbp,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D40(%rip),%rdi
  call   <fwrite@plt>
  lea    (%r12,%r12,1),%r14d
  lea    0x24(%r14),%edi
  mov    %rbp,%rdx
  mov    $0x4,%esi
  call   <write_little_endian@plt>
  mov    %rbp,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D21(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D23(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdx
  mov    $0x4,%esi
  mov    $0x10,%edi
  call   <write_little_endian@plt>
  mov    %rbp,%rdx
  mov    $0x2,%esi
  mov    $0x1,%edi
  call   <write_little_endian@plt>
  mov    %rbp,%rdx
  mov    $0x2,%esi
  mov    $0x1,%edi
  call   <write_little_endian@plt>
  mov    %rbp,%rdx
  mov    $0x4,%esi
  mov    %ebx,%edi
  call   <write_little_endian@plt>
  lea    (%rbx,%rbx,1),%edi
  mov    %rbp,%rdx
  mov    $0x4,%esi
  call   <write_little_endian@plt>
  mov    %rbp,%rdx
  mov    $0x2,%esi
  mov    $0x2,%edi
  call   <write_little_endian@plt>
  mov    %rbp,%rdx
  mov    $0x2,%esi
  mov    $0x10,%edi
  call   <write_little_endian@plt>
  mov    %rbp,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D33(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdx
  mov    $0x4,%esi
  mov    %r14d,%edi
  call   <write_little_endian@plt>
  test   %r12,%r12
  je     L15
  mov    $0x0,%ebx
L1:
  movswl 0x0(%r13,%rbx,2),%edi
  mov    %rbp,%rdx
  mov    $0x2,%esi
  call   <write_little_endian@plt>
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jne    L1
L15:
  mov    %rbp,%rdi
  call   <fclose@plt>
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D39
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D40
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D21
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D23
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D33
type_infered: string

tool: D39: w

tool: D40: RIFF

tool: D21: WAVE

tool: D23: fmt 

tool: D33: data

assistant: ```c
void write_wav(char *filename, unsigned long num_samples, short int *data, int s_rate) {
  FILE *wav_file;
  unsigned int sample_rate;
  unsigned int num_channels;
  unsigned int bytes_per_sample;
  unsigned int byte_rate;
  unsigned long i;
  num_channels = 1;
  bytes_per_sample = 2;
  if (s_rate <= 0)
    sample_rate = 44100;
  else
    sample_rate = (unsigned int)s_rate;
  byte_rate = sample_rate * num_channels * bytes_per_sample;
  wav_file = fopen(filename, "w");
  assert(wav_file);
  fwrite("RIFF", 1, 4, wav_file);
  write_little_endian(36 + bytes_per_sample * num_samples * num_channels, 4, wav_file);
  fwrite("WAVE", 1, 4, wav_file);
  fwrite("fmt ", 1, 4, wav_file);
  write_little_endian(16, 4, wav_file);
  write_little_endian(1, 2, wav_file);
  write_little_endian(num_channels, 2, wav_file);
  write_little_endian(sample_rate, 4, wav_file);
  write_little_endian(byte_rate, 4, wav_file);
  write_little_endian(num_channels * bytes_per_sample, 2, wav_file);
  write_little_endian(8 * bytes_per_sample, 2, wav_file);
  fwrite("data", 1, 4, wav_file);
  write_little_endian(bytes_per_sample * num_samples * num_channels, 4, wav_file);
  for (i = 0; i < num_samples; i++) {
    write_little_endian((unsigned int)(data[i]), bytes_per_sample, wav_file);
  }
  fclose(wav_file);
}
```