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

```asm
<field_debug_mask>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x30(%rbp),%rdx
  mov    -0x40(%rbp),%rcx
  mov    -0x38(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <extract_val@plt>
  test   %rax,%rax
  je     L66
  mov    $0x0,%eax
  jmp    L38
L66:
  movq   $0x4,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L85
  mov    $0x0,%eax
  jmp    L38
L85:
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  lea    D8(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strlcpy@plt>
  movl   $0x1,-0x2c(%rbp)
  jmp    L35
L68:
  mov    -0x30(%rbp),%eax
  and    -0x2c(%rbp),%eax
  test   %eax,%eax
  je     L4
  mov    -0x2c(%rbp),%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <constant_name_maps@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  add    $0x1,%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <realloc@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L61
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L38
L61:
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x20(%rbp),%rdx
  mov    -0x18(%rbp),%rcx
  mov    -0x28(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strlcat@plt>
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  lea    D28(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strlcat@plt>
L4:
  shll   -0x2c(%rbp)
L35:
  cmpl   $0x0,-0x2c(%rbp)
  jne    L68
  mov    -0x20(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  lea    D9(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strlcat@plt>
  mov    -0x28(%rbp),%rax
L38:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L97
  call   <__stack_chk_fail@plt>
L97:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D8
type: string
name: unpack_data
arguments: label: D28
type: string
name: unpack_data
arguments: label: D9
type: string

tool: D8: [ 

tool: D28:  

tool: D9: ]

assistant: ```c
char *field_debug_mask(u_int8_t *buf, size_t len, struct constant_map **maps) {
  u_int32_t val;
  u_int32_t bit;
  char *retval, *new_buf, *name;
  size_t buf_sz;
  if (extract_val(buf, len, &val))
    return 0;
  buf_sz = 4;
  retval = malloc(buf_sz);
  if (!retval)
    return 0;
  strlcpy(retval, "[ ", buf_sz);
  for (bit = 1; bit; bit <<= 1) {
    if (val & bit) {
      name = constant_name_maps(maps, bit);
      buf_sz += strlen(name) + 1;
      new_buf = realloc(retval, buf_sz);
      if (!new_buf) {
        free(retval);
        return 0;
      }
      retval = new_buf;
      strlcat(retval, name, buf_sz);
      strlcat(retval, " ", buf_sz);
    }
  }
  strlcat(retval, "]", buf_sz);
  return retval;
}
```