user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<encode_file>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x10000(%rsp),%r11
L226:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L226
  sub    $0x70,%rsp
  mov    %rdi,-0x10048(%rbp)
  mov    %esi,-0x1004c(%rbp)
  mov    %rdx,-0x10058(%rbp)
  mov    %rcx,-0x10060(%rbp)
  mov    %r8d,%eax
  mov    %r9,-0x10068(%rbp)
  mov    %ax,-0x10050(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x10038(%rbp)
  mov    -0x10068(%rbp),%rax
  mov    %rax,-0x10028(%rbp)
  cmpq   $0x0,-0x10068(%rbp)
  je     L116
  lea    D0(%rip),%rax
  jmp    L347
L116:
  lea    D17(%rip),%rax
L347:
  mov    -0x10060(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fputs@plt>
  mov    -0x1004c(%rbp),%eax
  mov    %al,-0x1003b(%rbp)
  mov    -0x1004c(%rbp),%eax
  sar    $0x8,%eax
  mov    %al,-0x1003a(%rbp)
  cmpq   $0x0,-0x10068(%rbp)
  je     L217
  movb   $0x0,-0x10039(%rbp)
  jmp    L187
L354:
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x10039(%rbp),%eax
  xor    %edx,%eax
  mov    %al,-0x10039(%rbp)
  addq   $0x1,-0x10028(%rbp)
L187:
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L354
  movzbl -0x10039(%rbp),%eax
  mov    -0x10060(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fputc@plt>
  mov    -0x10068(%rbp),%rax
  mov    %rax,-0x10028(%rbp)
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x1003a(%rbp),%eax
  xor    %edx,%eax
  mov    %al,-0x1003a(%rbp)
  addq   $0x1,-0x10028(%rbp)
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L232
  mov    -0x10068(%rbp),%rax
  mov    %rax,-0x10028(%rbp)
L232:
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x1003b(%rbp),%eax
  xor    %edx,%eax
  mov    %al,-0x1003b(%rbp)
L217:
  movzbl -0x1003b(%rbp),%ecx
  movzbl -0x1003a(%rbp),%edx
  mov    -0x10060(%rbp),%rax
  lea    D21(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movl   $0x0,-0x10034(%rbp)
  jmp    L17
L259:
  mov    -0x10034(%rbp),%eax
  cltq
  movb   $0x0,-0x10010(%rbp,%rax,1)
  addl   $0x1,-0x10034(%rbp)
L17:
  cmpl   $0xffff,-0x10034(%rbp)
  jle    L259
  movl   $0x0,-0x10034(%rbp)
  jmp    L317
L102:
  mov    -0x10034(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10048(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L2
  mov    -0x10034(%rbp),%eax
  mov    %ax,-0x1001a(%rbp)
  cmpl   $0x10000,-0x10034(%rbp)
  jne    L9
  movzwl -0x10050(%rbp),%eax
  mov    %ax,-0x1001a(%rbp)
L9:
  cmpq   $0x0,-0x10068(%rbp)
  je     L165
  addq   $0x1,-0x10028(%rbp)
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L95
  mov    -0x10068(%rbp),%rax
  mov    %rax,-0x10028(%rbp)
L95:
  movzbl -0x1001a(%rbp),%edx
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%eax
  xor    %edx,%eax
  mov    %al,-0x1001a(%rbp)
  addq   $0x1,-0x10028(%rbp)
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L285
  mov    -0x10068(%rbp),%rax
  mov    %rax,-0x10028(%rbp)
L285:
  movzbl -0x10019(%rbp),%edx
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%eax
  xor    %edx,%eax
  mov    %al,-0x10019(%rbp)
L165:
  movzbl -0x10019(%rbp),%eax
  movsbl %al,%ecx
  movzbl -0x1001a(%rbp),%eax
  movsbl %al,%edx
  mov    -0x10060(%rbp),%rax
  lea    D21(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movl   $0x0,-0x10038(%rbp)
  mov    -0x10034(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10048(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  lea    -0x10038(%rbp),%rdx
  lea    -0x10010(%rbp),%rsi
  mov    -0x10060(%rbp),%rax
  mov    %rax,%rdi
  call   <write_bits@plt>
  test   %rax,%rax
  je     L362
  mov    $0x1,%eax
  jmp    L196
L362:
  cmpq   $0x0,-0x10068(%rbp)
  je     L359
  addq   $0x1,-0x10028(%rbp)
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L30
  mov    -0x10068(%rbp),%rax
  mov    %rax,-0x10028(%rbp)
L30:
  mov    -0x10038(%rbp),%eax
  movzbl %al,%edx
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  xor    %eax,%edx
  mov    -0x10060(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <fputc@plt>
  movb   $0x0,-0x1003b(%rbp)
  jmp    L325
L117:
  addq   $0x1,-0x10028(%rbp)
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L13
  mov    -0x10068(%rbp),%rax
  mov    %rax,-0x10028(%rbp)
L13:
  movzbl -0x1003b(%rbp),%eax
  cltq
  movzbl -0x10010(%rbp,%rax,1),%ecx
  mov    -0x10028(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x1003b(%rbp),%eax
  xor    %ecx,%edx
  cltq
  mov    %dl,-0x10010(%rbp,%rax,1)
  movzbl -0x1003b(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x1003b(%rbp)
L325:
  movzbl -0x1003b(%rbp),%edx
  mov    -0x10038(%rbp),%eax
  lea    0x7(%rax),%ecx
  test   %eax,%eax
  cmovs  %ecx,%eax
  sar    $0x3,%eax
  cmp    %eax,%edx
  jle    L117
  jmp    L147
L359:
  mov    -0x10038(%rbp),%eax
  movzbl %al,%eax
  mov    -0x10060(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fputc@plt>
L147:
  mov    -0x10038(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  add    $0x1,%eax
  mov    %eax,-0x1002c(%rbp)
  mov    -0x10038(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  lea    0x1(%rax),%esi
  mov    -0x10060(%rbp),%rdx
  lea    -0x10010(%rbp),%rax
  mov    %rdx,%rcx
  mov    %esi,%edx
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  cmp    %eax,-0x1002c(%rbp)
  je     L2
  mov    $0x1,%eax
  jmp    L196
L2:
  addl   $0x1,-0x10034(%rbp)
L317:
  cmpl   $0x10000,-0x10034(%rbp)
  jle    L102
  movl   $0x0,-0x10038(%rbp)
  jmp    L319
L210:
  mov    -0x10018(%rbp),%eax
  mov    %al,-0x1001a(%rbp)
  mov    -0x10014(%rbp),%eax
  mov    %al,-0x10019(%rbp)
  movzwl -0x1001a(%rbp),%eax
  movzwl %ax,%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x10048(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  lea    -0x10038(%rbp),%rdx
  lea    -0x10010(%rbp),%rsi
  mov    -0x10060(%rbp),%rax
  mov    %rax,%rdi
  call   <write_bits@plt>
  test   %rax,%rax
  je     L319
  mov    $0x1,%eax
  jmp    L196
L319:
  mov    -0x10058(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0x10018(%rbp)
  mov    -0x10018(%rbp),%eax
  cmp    $0xffffffff,%eax
  je     L307
  mov    -0x10058(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0x10014(%rbp)
  mov    -0x10014(%rbp),%eax
  cmp    $0xffffffff,%eax
  jne    L210
L307:
  mov    -0x10048(%rbp),%rax
  add    $0x80000,%rax
  mov    (%rax),%rcx
  lea    -0x10038(%rbp),%rdx
  lea    -0x10010(%rbp),%rsi
  mov    -0x10060(%rbp),%rax
  mov    %rax,%rdi
  call   <write_bits@plt>
  test   %rax,%rax
  je     L310
  mov    $0x1,%eax
  jmp    L196
L310:
  mov    -0x10038(%rbp),%eax
  test   %eax,%eax
  jle    L300
  mov    -0x10038(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  add    $0x1,%eax
  mov    %eax,-0x10030(%rbp)
  mov    -0x10060(%rbp),%rcx
  mov    -0x10030(%rbp),%edx
  lea    -0x10010(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  cmp    %eax,-0x10030(%rbp)
  je     L300
  mov    $0x1,%eax
  jmp    L196
L300:
  mov    $0x0,%eax
L196:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L282
  call   <__stack_chk_fail@plt>
L282:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D0
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D17
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D21
type_guessed: string

tool: D0: hz1

tool: D17: hz0

tool: D21: %c%c

assistant: ```c
int encode_file(char **table, int n, FILE *f, FILE *f2, unsigned short tw, char *key) {
  char bitbuf[65536];
  int i, bits = 0;
  unsigned char cl, ch;
  int cx[2];
  union {
    char c[2];
    unsigned short word;
  } u;
  char *enc = key;
  fprintf(f2, "%s", (key ? "hz1" : "hz0"));
  cl = (unsigned char)(n & 0x00ff);
  ch = (unsigned char)(n >> 8);
  if (key) {
    unsigned char cs;
    for (cs = 0; *enc; enc++)
      cs ^= *enc;
    fprintf(f2, "%c", cs);
    enc = key;
    ch ^= *enc;
    if ((*(++enc)) == '\0')
      enc = key;
    cl ^= *enc;
  }
  fprintf(f2, "%c%c", ch, cl);
  for (i = 0; i < 65536; i++)
    bitbuf[i] = '\0';
  for (i = 0; i < 65536 + 1; i++)
    if (table[i]) {
      int nmemb;
      u.word = (unsigned short)i;
      if (i == 65536)
        u.word = tw;
      if (key) {
        if (*(++enc) == '\0')
          enc = key;
        u.c[0] ^= *enc;
        if (*(++enc) == '\0')
          enc = key;
        u.c[1] ^= *enc;
      }
      fprintf(f2, "%c%c", u.c[0], u.c[1]);
      bits = 0;
      if (write_bits(f2, bitbuf, &bits, table[i]) != 0)
        return 1;
      if (key) {
        if (*(++enc) == '\0')
          enc = key;
        fprintf(f2, "%c", ((unsigned char)bits) ^ *enc);
        for (cl = 0; cl <= bits / 8; cl++) {
          if (*(++enc) == '\0')
            enc = key;
          bitbuf[cl] ^= *enc;
        }
      } else
        fprintf(f2, "%c", (unsigned char)bits);
      nmemb = bits / 8 + 1;
      if (fwrite(bitbuf, sizeof(char), bits / 8 + 1, f2) != nmemb)
        return 1;
    }
  bits = 0;
  while ((cx[0] = getc(f)) != -1 && (cx[1] = getc(f)) != -1) {
    u.c[0] = cx[0];
    u.c[1] = cx[1];
    if (write_bits(f2, bitbuf, &bits, table[u.word]) != 0)
      return 1;
  }
  if (write_bits(f2, bitbuf, &bits, table[65536]) != 0)
    return 1;
  if (bits > 0) {
    int nmemb = bits / 8 + 1;
    if (fwrite(bitbuf, sizeof(char), nmemb, f2) != nmemb)
      return 1;
  }
  return 0;
}
```