user: 请将以下的汇编代码转换成C语言代码：

```asm
<encode_file>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x10000(%rsp),%r11
L305:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L305
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x10058(%rbp)
  mov    %esi,-0x1005c(%rbp)
  mov    %rdx,-0x10068(%rbp)
  mov    %rcx,-0x10070(%rbp)
  mov    %r8d,%eax
  mov    %r9,-0x10078(%rbp)
  mov    %ax,-0x10060(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x10040(%rbp)
  mov    -0x10078(%rbp),%rax
  mov    %rax,-0x10038(%rbp)
  cmpq   $0x0,-0x10078(%rbp)
  je     L23
  lea    D13(%rip),%rax
  jmp    L282
L23:
  lea    D35(%rip),%rax
L282:
  mov    -0x10070(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fputs@plt>
  mov    -0x1005c(%rbp),%eax
  mov    %al,-0x10043(%rbp)
  mov    -0x1005c(%rbp),%eax
  sar    $0x8,%eax
  mov    %al,-0x10042(%rbp)
  cmpq   $0x0,-0x10078(%rbp)
  je     L139
  movb   $0x0,-0x10041(%rbp)
  jmp    L77
L303:
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x10041(%rbp),%eax
  xor    %edx,%eax
  mov    %al,-0x10041(%rbp)
  addq   $0x1,-0x10038(%rbp)
L77:
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L303
  movzbl -0x10041(%rbp),%eax
  mov    -0x10070(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fputc@plt>
  mov    -0x10078(%rbp),%rax
  mov    %rax,-0x10038(%rbp)
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x10042(%rbp),%eax
  xor    %edx,%eax
  mov    %al,-0x10042(%rbp)
  addq   $0x1,-0x10038(%rbp)
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L199
  mov    -0x10078(%rbp),%rax
  mov    %rax,-0x10038(%rbp)
L199:
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x10043(%rbp),%eax
  xor    %edx,%eax
  mov    %al,-0x10043(%rbp)
L139:
  movzbl -0x10043(%rbp),%ecx
  movzbl -0x10042(%rbp),%edx
  mov    -0x10070(%rbp),%rax
  lea    D31(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movl   $0x0,-0x1003c(%rbp)
  jmp    L132
L330:
  mov    -0x1003c(%rbp),%eax
  cltq
  movb   $0x0,-0x10010(%rbp,%rax,1)
  addl   $0x1,-0x1003c(%rbp)
L132:
  cmpl   $0xffff,-0x1003c(%rbp)
  jle    L330
  movl   $0x0,-0x1003c(%rbp)
  jmp    L332
L249:
  mov    -0x1003c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10058(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L265
  mov    -0x1003c(%rbp),%eax
  mov    %ax,-0x1001a(%rbp)
  cmpl   $0x10000,-0x1003c(%rbp)
  jne    L149
  movzwl -0x10060(%rbp),%eax
  mov    %ax,-0x1001a(%rbp)
L149:
  cmpq   $0x0,-0x10078(%rbp)
  je     L294
  addq   $0x1,-0x10038(%rbp)
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L153
  mov    -0x10078(%rbp),%rax
  mov    %rax,-0x10038(%rbp)
L153:
  movzbl -0x1001a(%rbp),%edx
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%eax
  xor    %edx,%eax
  mov    %al,-0x1001a(%rbp)
  addq   $0x1,-0x10038(%rbp)
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L227
  mov    -0x10078(%rbp),%rax
  mov    %rax,-0x10038(%rbp)
L227:
  movzbl -0x10019(%rbp),%edx
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%eax
  xor    %edx,%eax
  mov    %al,-0x10019(%rbp)
L294:
  movzbl -0x10019(%rbp),%eax
  movsbl %al,%ecx
  movzbl -0x1001a(%rbp),%eax
  movsbl %al,%edx
  mov    -0x10070(%rbp),%rax
  lea    D31(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movl   $0x0,-0x10040(%rbp)
  mov    -0x1003c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10058(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  lea    -0x10040(%rbp),%rdx
  lea    -0x10010(%rbp),%rsi
  mov    -0x10070(%rbp),%rax
  mov    %rax,%rdi
  call   <write_bits@plt>
  test   %rax,%rax
  je     L40
  mov    $0x1,%eax
  jmp    L244
L40:
  cmpq   $0x0,-0x10078(%rbp)
  je     L241
  addq   $0x1,-0x10038(%rbp)
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L231
  mov    -0x10078(%rbp),%rax
  mov    %rax,-0x10038(%rbp)
L231:
  mov    -0x10040(%rbp),%eax
  movzbl %al,%edx
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  xor    %eax,%edx
  mov    -0x10070(%rbp),%rax
  mov    %rax,%rsi
  mov    %edx,%edi
  call   <fputc@plt>
  movb   $0x0,-0x10043(%rbp)
  jmp    L27
L233:
  addq   $0x1,-0x10038(%rbp)
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L323
  mov    -0x10078(%rbp),%rax
  mov    %rax,-0x10038(%rbp)
L323:
  movzbl -0x10043(%rbp),%eax
  cltq
  movzbl -0x10010(%rbp,%rax,1),%ecx
  mov    -0x10038(%rbp),%rax
  movzbl (%rax),%edx
  movzbl -0x10043(%rbp),%eax
  xor    %ecx,%edx
  cltq
  mov    %dl,-0x10010(%rbp,%rax,1)
  movzbl -0x10043(%rbp),%eax
  add    $0x1,%eax
  mov    %al,-0x10043(%rbp)
L27:
  movzbl -0x10043(%rbp),%edx
  mov    -0x10040(%rbp),%eax
  lea    0x7(%rax),%ecx
  test   %eax,%eax
  cmovs  %ecx,%eax
  sar    $0x3,%eax
  cmp    %eax,%edx
  jle    L233
  jmp    L65
L241:
  mov    -0x10040(%rbp),%eax
  movzbl %al,%eax
  mov    -0x10070(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fputc@plt>
L65:
  mov    -0x10040(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  add    $0x1,%eax
  cltq
  mov    %rax,-0x10028(%rbp)
  mov    -0x10040(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  mov    -0x10070(%rbp),%rcx
  lea    -0x10010(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  cmp    %rax,-0x10028(%rbp)
  je     L265
  mov    $0x1,%eax
  jmp    L244
L265:
  addl   $0x1,-0x1003c(%rbp)
L332:
  cmpl   $0x10000,-0x1003c(%rbp)
  jle    L249
  movl   $0x0,-0x10040(%rbp)
  jmp    L155
L125:
  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    -0x10058(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  lea    -0x10040(%rbp),%rdx
  lea    -0x10010(%rbp),%rsi
  mov    -0x10070(%rbp),%rax
  mov    %rax,%rdi
  call   <write_bits@plt>
  test   %rax,%rax
  je     L155
  mov    $0x1,%eax
  jmp    L244
L155:
  mov    -0x10068(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0x10018(%rbp)
  mov    -0x10018(%rbp),%eax
  cmp    $0xffffffff,%eax
  je     L26
  mov    -0x10068(%rbp),%rax
  mov    %rax,%rdi
  call   <getc@plt>
  mov    %eax,-0x10014(%rbp)
  mov    -0x10014(%rbp),%eax
  cmp    $0xffffffff,%eax
  jne    L125
L26:
  mov    -0x10058(%rbp),%rax
  add    $0x80000,%rax
  mov    (%rax),%rcx
  lea    -0x10040(%rbp),%rdx
  lea    -0x10010(%rbp),%rsi
  mov    -0x10070(%rbp),%rax
  mov    %rax,%rdi
  call   <write_bits@plt>
  test   %rax,%rax
  je     L104
  mov    $0x1,%eax
  jmp    L244
L104:
  mov    -0x10040(%rbp),%eax
  test   %eax,%eax
  jle    L262
  mov    -0x10040(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  add    $0x1,%eax
  cltq
  mov    %rax,-0x10030(%rbp)
  mov    -0x10070(%rbp),%rcx
  mov    -0x10030(%rbp),%rdx
  lea    -0x10010(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fwrite@plt>
  cmp    %rax,-0x10030(%rbp)
  je     L262
  mov    $0x1,%eax
  jmp    L244
L262:
  mov    $0x0,%eax
L244:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L279
  call   <__stack_chk_fail@plt>
L279:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D13
type_infered: string
name: parse_data
arguments: tag: D35
type_infered: string
name: parse_data
arguments: tag: D31
type_infered: string

tool: D13: hz1

tool: D35: hz0

tool: D31: %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]) {
      size_t 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, 1, 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) {
    size_t nmemb = bits / 8 + 1;
    if (fwrite(bitbuf, 1, nmemb, f2) != nmemb)
      return 1;
  }
  return 0;
}
```