user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <tmpfile@plt>
  mov    %rax,-0x30(%rbp)
  lea    D111(%rip),%rax
  mov    %rax,%rdi
  call   <title@plt>
  lea    D213(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    $0x0,%edx
  lea    D213(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fpack@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    $0x2,%ecx
  mov    $0x1,%edx
  lea    D11(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fpack@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x2,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    $0x5,%r8d
  mov    $0x4,%ecx
  mov    $0x3,%edx
  lea    D62(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fpack@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x3,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x5,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  lea    D149(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    $0x9,%r9d
  mov    $0x8,%r8d
  mov    $0x7,%ecx
  mov    $0x6,%edx
  lea    D149(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fpack@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x6,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x7,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <fgetc@plt>
  movsbl %al,%eax
  mov    $0x9,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  lea    D95(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  sub    $0x8,%rsp
  push   $0x0
  push   $0xa
  push   $0x21
  push   $0x64
  push   $0x6c
  push   $0x72
  push   $0x6f
  push   $0x77
  push   $0x20
  push   $0x2c
  push   $0x6f
  mov    $0x6c,%r9d
  mov    $0x6c,%r8d
  mov    $0x65,%ecx
  mov    $0x48,%edx
  lea    D95(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fpack@plt>
  add    $0x60,%rsp
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0xf,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rcx
  mov    -0x28(%rbp),%rdx
  lea    -0x20(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  lea    -0x20(%rbp),%rax
  lea    D225(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <str_ok@plt>
  lea    D113(%rip),%rax
  mov    %rax,%rdi
  call   <title@plt>
  lea    D213(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <fputc@plt>
  movb   $0xff,-0x3f(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  lea    -0x3f(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  lea    D213(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <funpack@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  movzbl -0x3f(%rbp),%eax
  movsbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x1,%edi
  call   <fputc@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x2,%edi
  call   <fputc@plt>
  movb   $0xff,-0x3f(%rbp)
  movb   $0xff,-0x3e(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  lea    -0x3e(%rbp),%rcx
  lea    -0x3f(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  lea    D11(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <funpack@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x2,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  movzbl -0x3f(%rbp),%eax
  movsbl %al,%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3e(%rbp),%eax
  movsbl %al,%eax
  mov    $0x2,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x3,%edi
  call   <fputc@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x4,%edi
  call   <fputc@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x5,%edi
  call   <fputc@plt>
  movb   $0xff,-0x3f(%rbp)
  movb   $0xff,-0x3e(%rbp)
  movb   $0xff,-0x3d(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  lea    -0x3d(%rbp),%rsi
  lea    -0x3e(%rbp),%rcx
  lea    -0x3f(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rsi,%r8
  lea    D62(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <funpack@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x3,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  movzbl -0x3f(%rbp),%eax
  movsbl %al,%eax
  mov    $0x3,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3e(%rbp),%eax
  movsbl %al,%eax
  mov    $0x4,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3d(%rbp),%eax
  movsbl %al,%eax
  mov    $0x5,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  lea    D149(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x6,%edi
  call   <fputc@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x7,%edi
  call   <fputc@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x8,%edi
  call   <fputc@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x9,%edi
  call   <fputc@plt>
  movb   $0xff,-0x3f(%rbp)
  movb   $0xff,-0x3e(%rbp)
  movb   $0xff,-0x3d(%rbp)
  movb   $0xff,-0x3c(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  lea    -0x3c(%rbp),%rdi
  lea    -0x3d(%rbp),%rsi
  lea    -0x3e(%rbp),%rcx
  lea    -0x3f(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  mov    %rdi,%r9
  mov    %rsi,%r8
  lea    D149(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <funpack@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  movzbl -0x3f(%rbp),%eax
  movsbl %al,%eax
  mov    $0x6,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3e(%rbp),%eax
  movsbl %al,%eax
  mov    $0x7,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3d(%rbp),%eax
  movsbl %al,%eax
  mov    $0x8,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3c(%rbp),%eax
  movsbl %al,%eax
  mov    $0x9,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  lea    D95(%rip),%rax
  mov    %rax,%rdi
  call   <test@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  mov    -0x30(%rbp),%rax
  mov    %rax,%rcx
  mov    $0xe,%edx
  mov    $0x1,%esi
  lea    D225(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  movb   $0xff,-0x3f(%rbp)
  movb   $0xff,-0x3e(%rbp)
  movb   $0xff,-0x3d(%rbp)
  movb   $0xff,-0x3c(%rbp)
  movb   $0xff,-0x3b(%rbp)
  movb   $0xff,-0x3a(%rbp)
  movb   $0xff,-0x39(%rbp)
  movb   $0xff,-0x38(%rbp)
  movb   $0xff,-0x37(%rbp)
  movb   $0xff,-0x36(%rbp)
  movb   $0xff,-0x35(%rbp)
  movb   $0xff,-0x34(%rbp)
  movb   $0xff,-0x33(%rbp)
  movb   $0xff,-0x32(%rbp)
  movb   $0xff,-0x31(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,%rdi
  call   <rewind@plt>
  lea    -0x3c(%rbp),%r8
  lea    -0x3d(%rbp),%rdi
  lea    -0x3e(%rbp),%rcx
  lea    -0x3f(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x31(%rbp),%rsi
  push   %rsi
  lea    -0x32(%rbp),%rsi
  push   %rsi
  lea    -0x33(%rbp),%rsi
  push   %rsi
  lea    -0x34(%rbp),%rsi
  push   %rsi
  lea    -0x35(%rbp),%rsi
  push   %rsi
  lea    -0x36(%rbp),%rsi
  push   %rsi
  lea    -0x37(%rbp),%rsi
  push   %rsi
  lea    -0x38(%rbp),%rsi
  push   %rsi
  lea    -0x39(%rbp),%rsi
  push   %rsi
  lea    -0x3a(%rbp),%rsi
  push   %rsi
  lea    -0x3b(%rbp),%rsi
  push   %rsi
  mov    %r8,%r9
  mov    %rdi,%r8
  lea    D95(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <funpack@plt>
  add    $0x60,%rsp
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    $0xf,%esi
  mov    %rax,%rdi
  call   <size_ok@plt>
  movzbl -0x3f(%rbp),%eax
  movsbl %al,%eax
  mov    $0x48,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3e(%rbp),%eax
  movsbl %al,%eax
  mov    $0x65,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3d(%rbp),%eax
  movsbl %al,%eax
  mov    $0x6c,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3c(%rbp),%eax
  movsbl %al,%eax
  mov    $0x6c,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3b(%rbp),%eax
  movsbl %al,%eax
  mov    $0x6f,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x3a(%rbp),%eax
  movsbl %al,%eax
  mov    $0x2c,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x39(%rbp),%eax
  movsbl %al,%eax
  mov    $0x20,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x38(%rbp),%eax
  movsbl %al,%eax
  mov    $0x77,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x37(%rbp),%eax
  movsbl %al,%eax
  mov    $0x6f,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x36(%rbp),%eax
  movsbl %al,%eax
  mov    $0x72,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x35(%rbp),%eax
  movsbl %al,%eax
  mov    $0x6c,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x34(%rbp),%eax
  movsbl %al,%eax
  mov    $0x64,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x33(%rbp),%eax
  movsbl %al,%eax
  mov    $0x21,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x32(%rbp),%eax
  movsbl %al,%eax
  mov    $0xa,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  movzbl -0x31(%rbp),%eax
  movsbl %al,%eax
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <int_ok@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D111
type_infered: string
name: retrieve_data
arguments: data_tag: D213
type_infered: string
name: retrieve_data
arguments: data_tag: D11
type_infered: string
name: retrieve_data
arguments: data_tag: D62
type_infered: string
name: retrieve_data
arguments: data_tag: D149
type_infered: string
name: retrieve_data
arguments: data_tag: D95
type_infered: string
name: retrieve_data
arguments: data_tag: D225
type_infered: string
name: retrieve_data
arguments: data_tag: D113
type_infered: string

tool: D111: fpack()

tool: D213: c

tool: D11: cc

tool: D62: c c c

tool: D149: c4

tool: D95: c15

tool: D225: Hello, world!


tool: D113: funpack()

assistant: ```c
int main(void) {
  FILE *file = tmpfile();
  size_t len;
  title("fpack()");
  test("c");
  rewind(file);
  len = fpack(file, "c", 0);
  size_ok(len, 1);
  rewind(file);
  int_ok(fgetc(file), 0);
  test("cc");
  rewind(file);
  len = fpack(file, "cc", 1, 2);
  size_ok(len, 2);
  rewind(file);
  int_ok(fgetc(file), 1);
  int_ok(fgetc(file), 2);
  test("c c c");
  rewind(file);
  len = fpack(file, "c c c", 3, 4, 5);
  size_ok(len, 3);
  rewind(file);
  int_ok(fgetc(file), 3);
  int_ok(fgetc(file), 4);
  int_ok(fgetc(file), 5);
  test("c4");
  rewind(file);
  len = fpack(file, "c4", 6, 7, 8, 9);
  size_ok(len, 4);
  rewind(file);
  int_ok(fgetc(file), 6);
  int_ok(fgetc(file), 7);
  int_ok(fgetc(file), 8);
  int_ok(fgetc(file), 9);
  test("c15");
  rewind(file);
  len = fpack(file, "c15", 'H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd', '!', '\n', 0);
  size_ok(len, 15);
  rewind(file);
  char buffer[20];
  fread(buffer, 1, len, file);
  str_ok(buffer, "Hello, world!\n");
  title("funpack()");
  char c1, c2, c3, c4, c5;
  char c6, c7, c8, c9, c10;
  char c11, c12, c13, c14, c15;
  test("c");
  rewind(file);
  fputc(0, file);
  c1 = -1;
  rewind(file);
  len = funpack(file, "c", &c1);
  size_ok(len, 1);
  int_ok(c1, 0);
  test("cc");
  rewind(file);
  fputc(1, file);
  fputc(2, file);
  c1 = -1;
  c2 = -1;
  rewind(file);
  len = funpack(file, "cc", &c1, &c2);
  size_ok(len, 2);
  int_ok(c1, 1);
  int_ok(c2, 2);
  test("c c c");
  rewind(file);
  fputc(3, file);
  fputc(4, file);
  fputc(5, file);
  c1 = -1;
  c2 = -1;
  c3 = -1;
  rewind(file);
  len = funpack(file, "c c c", &c1, &c2, &c3);
  size_ok(len, 3);
  int_ok(c1, 3);
  int_ok(c2, 4);
  int_ok(c3, 5);
  test("c4");
  rewind(file);
  fputc(6, file);
  fputc(7, file);
  fputc(8, file);
  fputc(9, file);
  c1 = -1;
  c2 = -1;
  c3 = -1;
  c4 = -1;
  rewind(file);
  len = funpack(file, "c4", &c1, &c2, &c3, &c4);
  size_ok(len, 4);
  int_ok(c1, 6);
  int_ok(c2, 7);
  int_ok(c3, 8);
  int_ok(c4, 9);
  test("c15");
  rewind(file);
  fputs("Hello, world!\n", file);
  c1 = -1;
  c2 = -1;
  c3 = -1;
  c4 = -1;
  c5 = -1;
  c6 = -1;
  c7 = -1;
  c8 = -1;
  c9 = -1;
  c10 = -1;
  c11 = -1;
  c12 = -1;
  c13 = -1;
  c14 = -1;
  c15 = -1;
  rewind(file);
  len = funpack(file, "c15", &c1, &c2, &c3, &c4, &c5, &c6, &c7, &c8, &c9, &c10, &c11, &c12, &c13, &c14, &c15);
  size_ok(len, 15);
  int_ok(c1, 'H');
  int_ok(c2, 'e');
  int_ok(c3, 'l');
  int_ok(c4, 'l');
  int_ok(c5, 'o');
  int_ok(c6, ',');
  int_ok(c7, ' ');
  int_ok(c8, 'w');
  int_ok(c9, 'o');
  int_ok(c10, 'r');
  int_ok(c11, 'l');
  int_ok(c12, 'd');
  int_ok(c13, '!');
  int_ok(c14, '\n');
  int_ok(c15, 0);
  return 0;
}
```