user: 请将这段汇编代码片段转换成等效的C代码:

```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     L48
  lea    0x10(%rsp),%rbp
  mov    %edi,%ecx
  mov    $0x100,%esi
  lea    D28(%rip),%rdx
  mov    %rbp,%rdi
  call   <snprintf@plt>
  cmp    $0xff,%eax
  ja     L49
L92:
  lea    D18(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L49
  lea    0x8(%rsp),%r14
  mov    %rsp,%r13
L77:
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <getline@plt>
  cmp    $0xffffffff,%eax
  je     L8
  mov    (%rsp),%rdi
  cmpb   $0x0,(%rdi)
  je     L77
  mov    $0x3a,%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L8
  lea    0x1(%rax),%rbp
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L8
  movb   $0x0,(%rax)
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <controller_in_clist@plt>
  test   %eax,%eax
  je     L77
  lea    0x1(%r15),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  test   %rax,%rax
  je     L34
  add    %rax,%r15
  cmpb   $0xa,(%r15)
  je     L81
L34:
  lea    D36(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L31
L8:
  xor    %r13d,%r13d
L119:
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
L155:
  mov    0x118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L68
  add    $0x128,%rsp
  mov    %r13,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L48:
  lea    0x10(%rsp),%rbp
  xor    %eax,%eax
  mov    $0x100,%esi
  lea    D27(%rip),%rdx
  mov    %rbp,%rdi
  call   <snprintf@plt>
  cmp    $0xff,%eax
  jbe    L92
L49:
  xor    %r13d,%r13d
  jmp    L155
  nopl   0x0(%rax,%rax,1)
L31:
  mov    %rbp,%rdi
  call   <strdup@plt>
  mov    %rax,%r13
  jmp    L119
  nopl   (%rax)
L81:
  movb   $0x0,(%r15)
  jmp    L34
L68:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D28
type_infered: string
name: extract_symbolic_data
arguments: tag: D18
type_infered: string
name: extract_symbolic_data
arguments: tag: D36
type_infered: string
name: extract_symbolic_data
arguments: tag: D27
type_infered: string

tool: D28: /proc/%d/cgroup

tool: D18: r

tool: D36: /

tool: D27: /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;
}
```