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

```asm
<generate_control_file>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x810,%rsp
  mov    %rsi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x808(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  lea    0x10(%rsp),%rdi
  mov    $0x7e,%ecx
  rep stos %rax,%es:(%rdi)
  movq   $0x0,0x400(%rsp)
  movq   $0x0,0x408(%rsp)
  lea    0x410(%rsp),%rdi
  mov    $0x7e,%ecx
  rep stos %rax,%es:(%rdi)
  mov    0x8(%rsi),%rdx
  mov    %rsp,%rbx
  lea    D104(%rip),%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  lea    D100(%rip),%rsi
  mov    %rbx,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L7
L26:
  mov    0x10(%r12),%rdx
  lea    0x400(%rsp),%rbx
  lea    D61(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  mov    0x18(%r12),%rdx
  lea    D20(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  mov    0x20(%r12),%rdx
  lea    D97(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  movabs $0x797469726f697250,%rax
  movabs $0x6e6f6974706f203a,%rdx
  mov    %rax,0x400(%rsp)
  mov    %rdx,0x408(%rsp)
  movl   $0xa6c61,0x410(%rsp)
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  mov    0x30(%r12),%rdx
  lea    D16(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  mov    0x38(%r12),%rdx
  lea    D98(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  mov    0x40(%r12),%rdi
  call   <atoi@plt>
  mov    %eax,%edx
  lea    D62(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  mov    0x48(%r12),%rdx
  lea    D70(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  mov    0x58(%r12),%rcx
  mov    0x50(%r12),%rdx
  lea    D42(%rip),%rsi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  mov    %rbx,%rdi
  call   <fix_description@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <fputs@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x808(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  add    $0x810,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L7:
  lea    D64(%rip),%rdi
  call   <printf@plt>
  mov    $0xfffffffe,%edi
  call   <exit@plt>
  jmp    L26
L19:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D104
type_infered: string
name: unpack_data
arguments: data_tag: D100
type_infered: string
name: unpack_data
arguments: data_tag: D61
type_infered: string
name: unpack_data
arguments: data_tag: D20
type_infered: string
name: unpack_data
arguments: data_tag: D97
type_infered: string
name: unpack_data
arguments: data_tag: D16
type_infered: string
name: unpack_data
arguments: data_tag: D98
type_infered: string
name: unpack_data
arguments: data_tag: D62
type_infered: string
name: unpack_data
arguments: data_tag: D70
type_infered: string
name: unpack_data
arguments: data_tag: D42
type_infered: string
name: unpack_data
arguments: data_tag: D64
type_infered: string

tool: D104: %s/control

tool: D100: wb

tool: D61: Package: %s


tool: D20: Version: %s


tool: D97: Section: %s


tool: D16: Architecture: %s


tool: D98: Depends: %s


tool: D62: Installed-Size: %d


tool: D70: Maintainer: %s


tool: D42: Description: %s
%s


tool: D64: file open error


assistant: ```c
void generate_control_file(int argc, char *argv[]) {
  FILE *fp;
  char fn[1024] = {0};
  char line[1024] = {0};
  sprintf(fn, "%s/control", argv[1]);
  fp = fopen(fn, "wb");
  if (!fp) {
    printf("file open error\n");
    exit(-2);
  }
  sprintf(line, "Package: %s\n", argv[2]);
  fputs(line, fp);
  sprintf(line, "Version: %s\n", argv[3]);
  fputs(line, fp);
  sprintf(line, "Section: %s\n", argv[4]);
  fputs(line, fp);
  sprintf(line, "Priority: optional\n");
  fputs(line, fp);
  sprintf(line, "Architecture: %s\n", argv[6]);
  fputs(line, fp);
  sprintf(line, "Depends: %s\n", argv[7]);
  fputs(line, fp);
  sprintf(line, "Installed-Size: %d\n", atoi(argv[8]));
  fputs(line, fp);
  sprintf(line, "Maintainer: %s\n", argv[9]);
  fputs(line, fp);
  sprintf(line, "Description: %s\n%s\n", argv[10], argv[11]);
  fix_description(line);
  fputs(line, fp);
  fclose(fp);
}
```