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

```asm
<cap_getstr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x848,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %r8d,0x14(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x838(%rsp)
  xor    %eax,%eax
  mov    D43(%rip),%eax
  add    $0x1,%eax
  mov    %eax,D38(%rip)
  mov    $0x0,%ebx
  cmp    $0x20,%eax
  jg     L16
  mov    %rsi,%rbp
  mov    %rdx,%r12
  lea    D38(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r14
  lea    D84(%rip),%rbx
  test   %rax,%rax
  je     L6
L111:
  lea    0x30(%rsp),%rsi
  mov    $0x800,%edx
  mov    %r14,%rdi
  call   <cap_getent@plt>
  test   %rax,%rax
  jle    L159
  lea    0x30(%rsp),%r15
  mov    $0x3a,%esi
  mov    %r15,%rdi
  call   <strchr@plt>
  mov    %rax,%r13
  movb   $0x0,(%rax)
  lea    0x20(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <strtok_r@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  je     L111
L10:
  mov    %rbp,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L117
  lea    0x20(%rsp),%rdx
  mov    %rbx,%rsi
  mov    $0x0,%edi
  call   <strtok_r@plt>
  mov    %rax,%rdi
  test   %rax,%rax
  jne    L10
  jmp    L111
L117:
  lea    0x1(%r13),%rdi
  lea    0x28(%rsp),%rdx
  lea    D59(%rip),%rsi
  call   <strtok_r@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L113
  lea    D61(%rip),%rbp
  lea    0x28(%rsp),%r15
  lea    D59(%rip),%r13
  jmp    L160
L148:
  mov    0x8(%rsp),%r15
  test   %r15,%r15
  je     L199
  lea    0x3(%rbx),%rbp
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    $0x0,%ebx
  cmp    0x14(%rsp),%eax
  jge    L16
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <strcpy@plt>
  mov    %r15,%rbx
L113:
  subl   $0x1,D38(%rip)
  mov    %r14,%rdi
  call   <fclose@plt>
L16:
  mov    0x838(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L83
  mov    %rbx,%rax
  add    $0x848,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L199:
  lea    0x3(%rbx),%rdi
  call   <s_dup@plt>
  mov    %rax,%rbx
  jmp    L113
L190:
  mov    %r15,%rdx
  mov    %r13,%rsi
  mov    $0x0,%edi
  call   <strtok_r@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L113
L160:
  mov    $0x2,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L129
  cmpb   $0x3d,0x2(%rbx)
  je     L148
L129:
  mov    $0x3,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L190
  lea    0x3(%rbx),%rsi
  mov    0x14(%rsp),%r8d
  mov    0x8(%rsp),%rcx
  mov    %r12,%rdx
  mov    0x18(%rsp),%rdi
  call   <cap_getstr>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L190
  jmp    L113
L159:
  mov    $0x0,%ebx
  jmp    L113
L6:
  subl   $0x1,D38(%rip)
  mov    %rax,%rbx
  jmp    L16
L83:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D38
type_infered: string
name: read_data
arguments: data_label: D84
type_infered: string
name: read_data
arguments: data_label: D59
type_infered: string
name: read_data
arguments: data_label: D61
type_infered: string

tool: D38: r

tool: D84: |

tool: D59: :

tool: D61: tc=

assistant: ```c
char *cap_getstr(const char *path, const char *entname, const char *strname, char *buf, int bufsize) {
  FILE *fp;
  char *cp, *tp;
  char *lcp, *ltp;
  static int rlev = 0;
  char *retval = NULL;
  char entbuf[2048];
  if (++rlev > 32)
    return NULL;
  fp = fopen(path, "r");
  if (fp == NULL)
    goto Exit;
  while (cap_getent(fp, entbuf, sizeof(entbuf)) > 0) {
    tp = strchr(entbuf, ':');
    *tp++ = '\0';
    cp = strtok_r(entbuf, "|", &lcp);
    while (cp) {
      if (strcmp(cp, entname) == 0) {
        tp = strtok_r(tp, ":", &ltp);
        while (tp) {
          if (strncmp(tp, strname, 2) == 0 && tp[2] == '=') {
            if (buf) {
              if (strlen(tp + 3) >= bufsize)
                return NULL;
              strcpy(buf, tp + 3);
              retval = buf;
            } else
              retval = s_dup(tp + 3);
            goto Exit;
          } else if (strncmp(tp, "tc=", 3) == 0) {
            retval = cap_getstr(path, tp + 3, strname, buf, bufsize);
            if (retval)
              goto Exit;
          }
          tp = strtok_r(NULL, ":", &ltp);
        }
        goto Exit;
      }
      cp = strtok_r(NULL, "|", &lcp);
    }
  }
Exit:
  --rlev;
  if (fp)
    fclose(fp);
  return retval;
}
```