user: What is the c source code of the assembly code below:

```asm
<takedarkimage>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x848,%rsp
  mov    %edi,%ebp
  mov    %fs:0x28,%rax
  mov    %rax,0x838(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r12
  mov    $0xc8,%esi
  mov    %r12,%rdi
  call   <convint@plt>
  lea    0x12(%rsp),%rdi
  mov    $0x0,%esi
  call   <convint@plt>
  lea    0x14(%rsp),%rdi
  mov    $0x0,%esi
  call   <convint@plt>
  lea    0x16(%rsp),%rdi
  mov    $0x79,%esi
  call   <convint@plt>
  lea    0x18(%rsp),%rdi
  mov    $0x0,%esi
  call   <convint@plt>
  lea    0x1a(%rsp),%rdi
  mov    $0xfa,%esi
  call   <convint@plt>
  lea    0x1c(%rsp),%rdi
  mov    $0x0,%esi
  call   <convint@plt>
  lea    0x1e(%rsp),%rdi
  mov    $0x0,%esi
  call   <convint@plt>
  lea    0x20(%rsp),%rdi
  mov    $0x0,%esi
  call   <convint@plt>
  lea    0x22(%rsp),%rdi
  mov    $0x1770,%esi
  call   <convint@plt>
  lea    0x24(%rsp),%rdi
  mov    $0x0,%esi
  call   <convint@plt>
  lea    0x26(%rsp),%rdi
  mov    $0x0,%esi
  call   <convint@plt>
  lea    0x28(%rsp),%rdi
  mov    $0x3,%esi
  call   <convint@plt>
  lea    0x2a(%rsp),%rdi
  mov    $0x0,%esi
  call   <convint@plt>
  lea    0xc(%rsp),%rsi
  lea    0x30(%rsp),%rbx
  mov    $0x1c,%r8d
  mov    %r12,%rcx
  mov    $0x1,%edx
  mov    %rbx,%rdi
  call   <buildpacket@plt>
  mov    0xc(%rsp),%edx
  mov    %rbx,%rsi
  mov    %ebp,%edi
  call   <write@plt>
  lea    0x430(%rsp),%rsi
  mov    %ebp,%edi
  call   <listen@plt>
  cmp    $0x1,%eax
  jne    L16
  cmpb   $0x6,0x430(%rsp)
  je     L50
L16:
  lea    D19(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%ebx
L15:
  mov    0x838(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  mov    %ebx,%eax
  add    $0x848,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L50:
  lea    D6(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%r13d
  mov    $0x160dc080,%r12d
  jmp    L32
L46:
  mov    $0x0,%edx
  mov    %r12d,%edi
  mov    %r13,%rsi
  call   <nanosleep@plt>
L32:
  mov    %ebp,%edi
  call   <checkidle@plt>
  mov    %eax,%ebx
  cmp    $0x1,%eax
  jne    L46
  lea    D26(%rip),%rdi
  call   <printf@plt>
  jmp    L15
L40:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D19
datatype: string
name: parse_data
arguments: tag: D6
datatype: string
name: parse_data
arguments: tag: D26
datatype: string

tool: D19: Problem taking image.


tool: D6: Taking image ...


tool: D26: Exposure completed!  Image stored in dark buffer.


assistant: ```c
int takedarkimage(int fd) {
  unsigned char pak[1024];
  unsigned char buf[1024];
  int len, res;
  int DONE = 0;
  unsigned char p[28];
  convint(&p[0], 200);
  convint(&p[2], 0);
  convint(&p[4], 0);
  convint(&p[6], 121);
  convint(&p[8], 0);
  convint(&p[10], 250);
  convint(&p[12], 0);
  convint(&p[14], 0);
  convint(&p[16], 0);
  convint(&p[18], 6000);
  convint(&p[20], 0);
  convint(&p[22], 0);
  convint(&p[24], 3);
  convint(&p[26], 0);
  buildpacket(pak, &len, 0x01, p, 28);
  write(fd, pak, len);
  res = listen(fd, buf);
  if (!(res == 1 && buf[0] == 0x06)) {
    printf("Problem taking image.\n");
    return 0;
  } else
    printf("Taking image ...\n");
  struct timespec wait;
  wait.tv_sec = 0;
  wait.tv_nsec = 370000000;
  while (!(checkidle(fd) == 1)) {
    nanosleep(wait, NULL);
  }
  printf("Exposure completed!  Image stored in dark buffer.\n");
  return 1;
}
```