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

```asm
<get_cgroup>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x128,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x118(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  test   %edi,%edi
  je     L87
  lea    0x10(%rsp),%rbp
  mov    %edi,%ecx
  mov    $0x100,%esi
  lea    D12(%rip),%rdx
  mov    %rbp,%rdi
  call   <snprintf@plt>
  cmp    $0xff,%eax
  ja     L38
L125:
  lea    D17(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L38
  lea    0x8(%rsp),%r14
  mov    %rsp,%r13
L108:
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <getline@plt>
  cmp    $0xffffffff,%eax
  je     L78
  mov    (%rsp),%rdi
  cmpb   $0x0,(%rdi)
  je     L108
  mov    $0x3a,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L78
  lea    0x1(%rax),%rbp
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L78
  movb   $0x0,(%rax)
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <controller_in_clist@plt>
  test   %eax,%eax
  je     L108
  lea    0x1(%r15),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  test   %rax,%rax
  je     L30
  add    %rax,%r15
  cmpb   $0xa,(%r15)
  je     L138
L30:
  lea    D38(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L105
L78:
  xor    %r13d,%r13d
L93:
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
L12:
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L153
  add    $0x128,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L87:
  lea    0x10(%rsp),%rbp
  xor    %eax,%eax
  mov    $0x100,%esi
  lea    D0(%rip),%rdx
  mov    %rbp,%rdi
  call   <snprintf@plt>
  cmp    $0xff,%eax
  jbe    L125
L38:
  xor    %r13d,%r13d
  jmp    L12
  nopl   0x0(%rax,%rax,1)
L105:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,%r13
  jmp    L93
  nopl   (%rax)
L138:
  movb   $0x0,(%r15)
  jmp    L30
L153:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D12
data_type: string
name: extract_symbolic_data
arguments: data_tag: D17
data_type: string
name: extract_symbolic_data
arguments: data_tag: D38
data_type: string
name: extract_symbolic_data
arguments: data_tag: D0
data_type: string

tool: D12: /proc/%d/cgroup

tool: D17: r

tool: D38: /

tool: D0: /proc/self/cgroup

assistant: ```c
char *get_cgroup(pid_t pid, const char *contrl) {
  char fn[256];
  FILE *f;
  char *line = NULL;
  size_t len = 0;
  size_t l = 0;
  int ret;
  char *cgrp = NULL;
  char *c1, *c2;
  if (pid) {
    ret = snprintf(fn, 256, "/proc/%d/cgroup", pid);
  } else {
    ret = snprintf(fn, 256, "/proc/self/cgroup");
  }
  if (ret < 0 || ret >= 256)
    return NULL;
  if (!(f = fopen(fn, "r")))
    return NULL;
  while (getline(&line, &len, f) != -1) {
    if (!line[0])
      continue;
    c1 = strchr(line, ':');
    if (!c1)
      goto out;
    c1++;
    c2 = strchr(c1, ':');
    if (!c2)
      goto out;
    *c2 = '\0';
    if (!controller_in_clist(c1, contrl))
      continue;
    c2++;
    l = strlen(c2);
    if (l && c2[l - 1] == '\n')
      c2[l - 1] = '\0';
    if (strcmp(c2, "/") == 0)
      goto out;
    cgrp = strdup(c2);
    break;
  }
out:
  fclose(f);
  free(line);
  return cgrp;
}
```