user: 请从给定的汇编指令推导出C源代码:

```asm
<test_write_binary>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x17161514,-0x20(%rbp)
  movb   $0x18,-0x1c(%rbp)
  movl   $0x21201f1e,-0x28(%rbp)
  movl   $0x17161514,-0x1b(%rbp)
  movb   $0x18,-0x17(%rbp)
  movl   $0x21201f1e,-0x24(%rbp)
  movl   $0xd0c0b0a,-0x16(%rbp)
  movw   $0xf0e,-0x12(%rbp)
  movb   $0x10,-0x10(%rbp)
  movl   $0x1716150a,-0xf(%rbp)
  movw   $0x201f,-0xb(%rbp)
  movb   $0x10,-0x9(%rbp)
  lea    -0x16(%rbp),%rax
  add    $0x1,%rax
  mov    %rax,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    -0x38(%rbp),%rax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <write_binary@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <write_binary@plt>
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x1b(%rbp),%rax
  add    $0x1,%rax
  mov    $0x0,%edx
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <write_binary@plt>
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x1b(%rbp),%rax
  add    $0x1,%rax
  lea    -0x30(%rbp),%rcx
  mov    $0x0,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <write_binary@plt>
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x30(%rbp),%rax
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <write_binary@plt>
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x38(%rbp),%rax
  mov    $0x35,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <write_binary@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x1,%edx
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <write_binary@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x1b(%rbp),%rax
  add    $0x1,%rax
  mov    $0x17,%edx
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <write_binary@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x1b(%rbp),%rax
  add    $0x1,%rax
  lea    -0x30(%rbp),%rcx
  mov    $0x1,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <write_binary@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x30(%rbp),%rax
  mov    $0x6,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <write_binary@plt>
  test   %eax,%eax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xb,%al
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x1b(%rbp),%rax
  add    $0x1,%rax
  lea    -0x38(%rbp),%rcx
  mov    $0x3,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <write_binary@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xe,%al
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x24(%rbp),%rax
  add    $0x1,%rax
  lea    -0x38(%rbp),%rcx
  mov    $0x2,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <write_binary@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x10,%al
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x24(%rbp),%rcx
  lea    -0x38(%rbp),%rax
  mov    $0x0,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <write_binary@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x10,%al
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x20(%rbp),%rcx
  lea    -0x1b(%rbp),%rax
  mov    $0x5,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0x28(%rbp),%rcx
  lea    -0x24(%rbp),%rax
  mov    $0x4,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    -0xf(%rbp),%rcx
  lea    -0x16(%rbp),%rax
  mov    $0x7,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  sete   %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D6
data_type: string
name: read_data
arguments: data_label: D19
data_type: string

tool: D6: 	Start  test_write_binary


tool: D19: 	Finish test_write_binary


assistant: ```c
void test_write_binary(void) {
  unsigned char original_src[] = {20, 21, 22, 23, 24};
  unsigned char original_src2[] = {30, 31, 32, 33};
  unsigned char src[] = {20, 21, 22, 23, 24};
  unsigned char src2[] = {30, 31, 32, 33};
  unsigned char dest[] = {10, 11, 12, 13, 14, 15, 16};
  unsigned char expected[] = {10, 21, 22, 23, 31, 32, 16};
  unsigned char *p = dest + 1;
  unsigned char *null_ptr = NULL;
  printf("\tStart  test_write_binary\n");
  assert(write_binary(&p, NULL, 0));
  assert(write_binary(NULL, NULL, 0));
  assert(write_binary(NULL, src + 1, 0));
  assert(write_binary(&null_ptr, src + 1, 0));
  assert(write_binary(&null_ptr, NULL, 0));
  assert(!write_binary(&p, NULL, 53));
  assert(!write_binary(NULL, NULL, 1));
  assert(!write_binary(NULL, src + 1, 23));
  assert(!write_binary(&null_ptr, src + 1, 1));
  assert(!write_binary(&null_ptr, NULL, 6));
  assert(*p == 11);
  assert(write_binary(&p, src + 1, 3));
  assert(*p == 14);
  assert(write_binary(&p, src2 + 1, 2));
  assert(*p == 16);
  assert(write_binary(&p, src2, 0));
  assert(*p == 16);
  assert(memcmp(src, original_src, sizeof src) == 0);
  assert(memcmp(src2, original_src2, sizeof src2) == 0);
  assert(memcmp(dest, expected, sizeof dest) == 0);
  printf("\tFinish test_write_binary\n");
}
```