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

```asm
<RecoverFile>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x28,%rsp
  mov    %edi,%r13d
  mov    %rsi,%r14
  mov    %rsi,0x8(%rsp)
  mov    %rdx,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x1018(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%rbx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <pathFromFile@plt>
  mov    %rbx,%rdi
  call   <ensurePath@plt>
  mov    (%r15),%ebx
  mov    $0x1b6,%esi
  mov    %r14,%rdi
  call   <creat@plt>
  mov    %eax,%r12d
  cmp    $0xffffffff,%eax
  je     L78
L34:
  lea    D41(%rip),%r14
  test   %ebx,%ebx
  jle    L33
L90:
  mov    $0x800,%edx
  cmp    %edx,%ebx
  cmovle %ebx,%edx
  lea    0x810(%rsp),%rsi
  mov    %r13d,%edi
  call   <read@plt>
  mov    %eax,%ebp
  test   %eax,%eax
  jle    L33
  mov    %ebp,%edx
  mov    %ebx,%esi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x810(%rsp),%rsi
  mov    %ebp,%edx
  mov    %r12d,%edi
  call   <write@plt>
  sub    $0x800,%ebx
  test   %ebx,%ebx
  jg     L90
L33:
  mov    0xc(%r15),%esi
  mov    %r12d,%edi
  call   <fchmod@plt>
  cmp    $0xffffffff,%eax
  je     L66
L92:
  mov    0x4(%r15),%edx
  mov    0x8(%r15),%esi
  mov    %r12d,%edi
  call   <fchown@plt>
  cmp    $0xffffffff,%eax
  je     L51
L63:
  mov    %r12d,%edi
  call   <close@plt>
  mov    0x8(%rsp),%rsi
  lea    D2(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x1018(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L11
  add    $0x1028,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L78:
  lea    D42(%rip),%rdi
  call   <perror@plt>
  mov    $0x2,%edi
  call   <exit@plt>
  jmp    L34
L66:
  lea    D36(%rip),%rdi
  call   <perror@plt>
  jmp    L92
L51:
  lea    D29(%rip),%rdi
  call   <perror@plt>
  jmp    L63
L11:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D41
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D2
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D42
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D36
type_infered: string
name: extract_symbolic_data
arguments: data_tag: D29
type_infered: string

tool: D41: %i - %i


tool: D2: recovered file %s


tool: D42: Backuptarget: 

tool: D36: fchmod

tool: D29: chown

assistant: ```c
void RecoverFile(int bfd, const char *fname, struct stat *inode) {
  char path[2048];
  pathFromFile(fname, &path);
  ensurePath(path);
  int cnt;
  char buf[2048];
  int fileEnd = inode->st_size;
  int targetfd;
  if ((targetfd = creat(fname, 0666)) == -1) {
    perror("Backuptarget: ");
    exit(2);
  }
  while (fileEnd > 0 && (cnt = read(bfd, &buf, (((2048) < (fileEnd)) ? (2048) : (fileEnd)))) > 0) {
    printf("%i - %i\n", fileEnd, cnt);
    write(targetfd, buf, cnt);
    fileEnd -= 2048;
  }
  if (fchmod(targetfd, inode->st_mode) == -1) {
    perror("fchmod");
  }
  if (fchown(targetfd, inode->st_uid, inode->st_gid) == -1) {
    perror("chown");
  }
  close(targetfd);
  printf("recovered file %s\n", fname);
}
```