user: What would the C source look like for the assembly code provided here:

```asm
<getmap>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  cmp    $0xffffffff,%edi
  je     L83
  test   %esi,%esi
  lea    D7(%rip),%rax
  lea    D70(%rip),%rdx
  mov    %edi,%esi
  cmovne %rax,%rdx
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  call   <string@plt>
  mov    %rax,%r13
L5:
  lea    D22(%rip),%rsi
  mov    %r13,%rdi
  call   <fopen@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L35
L81:
  lea    0x20(%rsp),%r12
  lea    0x10(%rsp),%rbx
  lea    D20(%rip),%r15
  lea    D73(%rip),%r14
  jmp    L59
  nopl   0x0(%rax)
L16:
  mov    0x10(%rsp),%rdi
  lea    0xc(%rsp),%rcx
  lea    0x8(%rsp),%rdx
  mov    %r15,%rsi
  lea    0x4(%rsp),%r8
  call   <sscanf@plt>
  cmp    $0x3,%eax
  je     L54
  mov    %r13,%rdx
  lea    D131(%rip),%rsi
  xor    %edi,%edi
  call   <die@plt>
L54:
  cmpq   $0x0,0x18(%rsp)
  lea    D127(%rip),%rdx
  mov    0x4(%rsp),%r9d
  lea    0x18(%rsp),%rdi
  cmovne %r14,%rdx
  mov    0xc(%rsp),%r8d
  mov    0x8(%rsp),%ecx
  lea    D35(%rip),%rsi
  call   <append@plt>
L59:
  mov    %rbp,%rdx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <getline@plt>
  test   %rax,%rax
  jns    L16
  cmpq   $0x0,0x18(%rsp)
  je     L46
L53:
  mov    %rbp,%rdi
  call   <fclose@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    %r13,%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rax
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L78
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L83:
  test   %esi,%esi
  lea    D7(%rip),%rax
  lea    D70(%rip),%rsi
  cmovne %rax,%rsi
  lea    D102(%rip),%rdi
  xor    %eax,%eax
  call   <string@plt>
  mov    %rax,%r13
  jmp    L5
  nopw   0x0(%rax,%rax,1)
L46:
  mov    %r13,%rdx
  lea    D131(%rip),%rsi
  xor    %edi,%edi
  call   <die@plt>
  jmp    L53
  cs nopw 0x0(%rax,%rax,1)
L35:
  mov    %r13,%rdx
  lea    D3(%rip),%rsi
  xor    %edi,%edi
  call   <die@plt>
  jmp    L81
L78:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D7
data_type: string
name: unpack_data
arguments: label: D70
data_type: string
name: unpack_data
arguments: label: D30
data_type: string
name: unpack_data
arguments: label: D22
data_type: string
name: unpack_data
arguments: label: D20
data_type: string
name: unpack_data
arguments: label: D73
data_type: string
name: unpack_data
arguments: label: D131
data_type: string
name: unpack_data
arguments: label: D127
data_type: string
name: unpack_data
arguments: label: D35
data_type: string
name: unpack_data
arguments: label: D102
data_type: string
name: unpack_data
arguments: label: D3
data_type: string

tool: D7: uid_map

tool: D70: gid_map

tool: D30: /proc/%d/%s

tool: D22: r

tool: D20:  %u %u %u

tool: D73: ,

tool: D131: Invalid map data in %s

tool: 

tool: D35: %s%u:%u:%u

tool: D102: /proc/self/%s

tool: D3: Cannot read %s

assistant: ```c
char *getmap(pid_t pid, int type) {
  char *line = NULL, *result = NULL, *path;
  size_t size;
  unsigned count, first, lower;
  FILE *file;
  if (pid == -1)
    path = string("/proc/self/%s", ((type) == 0 ? "gid_map" : "uid_map"));
  else
    path = string("/proc/%d/%s", pid, ((type) == 0 ? "gid_map" : "uid_map"));
  if (!(file = fopen(path, "r")))
    die(0, "Cannot read %s", path);
  while (getline(&line, &size, file) >= 0) {
    if (sscanf(line, " %u %u %u", &first, &lower, &count) != 3)
      die(0, "Invalid map data in %s", path);
    append(&result, "%s%u:%u:%u", result ? "," : "", first, lower, count);
  }
  if (!result)
    die(0, "Invalid map data in %s", path);
  fclose(file);
  free(line);
  free(path);
  return result;
}
```