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

```asm
<build_default_affinity_string>:
  endbr64
  push   %r15
  push   %r14
  mov    %edi,%r14d
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  call   <numa_num_configured_nodes@plt>
  mov    %eax,%r13d
  xor    %eax,%eax
  call   <numa_num_configured_cpus@plt>
  lea    0x0(,%r13,8),%edi
  movl   $0x200,0x38(%rsp)
  movl   $0x0,0x3c(%rsp)
  mov    %eax,%ebx
  call   <malloc@plt>
  mov    %rax,0x10(%rsp)
  test   %r13d,%r13d
  jle    L123
  mov    %rax,%r12
  mov    %rax,%rbp
  xor    %r15d,%r15d
  nopw   0x0(%rax,%rax,1)
L15:
  xor    %eax,%eax
  add    $0x8,%rbp
  call   <numa_allocate_cpumask@plt>
  mov    %r15d,%edi
  mov    %rax,-0x8(%rbp)
  mov    %rax,%rsi
  call   <numa_node_to_cpus@plt>
  mov    %r15d,%edx
  add    $0x1,%r15d
  cmp    %r15d,%r13d
  jne    L15
  mov    0x38(%rsp),%edi
  mov    %edx,0x8(%rsp)
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x40(%rsp)
  call   <assert@plt>
  test   %r14d,%r14d
  mov    0x8(%rsp),%edx
  jne    L48
  mov    0x10(%rsp),%rax
  lea    0x3c(%rsp),%r13
  lea    0x8(%rax,%rdx,8),%r14
  nopl   0x0(%rax)
L35:
  xor    %ebp,%ebp
  test   %ebx,%ebx
  jg     L63
  jmp    L21
  nopl   0x0(%rax,%rax,1)
L64:
  add    $0x1,%ebp
  cmp    %ebp,%ebx
  je     L21
L63:
  mov    (%r12),%rdi
  mov    %ebp,%esi
  call   <numa_bitmask_isbitset@plt>
  test   %rax,%rax
  je     L64
  mov    %ebp,%ecx
  lea    0x38(%rsp),%rsi
  lea    0x40(%rsp),%rdi
  mov    %r13,%rdx
  call   <add_core_to_str@plt>
  add    $0x1,%ebp
  cmp    %ebp,%ebx
  jne    L63
L21:
  add    $0x8,%r12
  cmp    %r12,%r14
  jne    L35
L75:
  movslq 0x3c(%rsp),%rax
  test   %eax,%eax
  je     L20
  mov    0x40(%rsp),%rdx
  movb   $0x0,-0x1(%rdx,%rax,1)
L20:
  mov    0x40(%rsp),%rax
  mov    0x48(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L101
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L123:
  mov    0x38(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x40(%rsp)
  call   <assert@plt>
  test   %r14d,%r14d
  je     L75
  nopl   0x0(%rax)
L48:
  test   %ebx,%ebx
  jle    L75
  lea    0x3c(%rsp),%rax
  movl   $0x0,0xc(%rsp)
  mov    %rax,0x20(%rsp)
  lea    0x38(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x40(%rsp),%rax
  movl   $0x0,0x8(%rsp)
  mov    %rax,0x28(%rsp)
  nopw   0x0(%rax,%rax,1)
L68:
  mov    0x8(%rsp),%eax
  mov    0x10(%rsp),%rcx
  xor    %r15d,%r15d
  xor    %r14d,%r14d
  cltd
  idiv   %r13d
  lea    0x1(%rax),%ebp
  movslq 0xc(%rsp),%rax
  lea    (%rcx,%rax,8),%r12
  jmp    L95
  nopl   0x0(%rax)
L98:
  lea    0x1(%r15),%eax
  cltd
  idiv   %ebx
  mov    %edx,%r15d
L95:
  mov    (%r12),%rdi
  mov    %r15d,%esi
  call   <numa_bitmask_isbitset@plt>
  cmp    $0x1,%rax
  sbb    $0xffffffff,%r14d
  cmp    %ebp,%r14d
  jne    L98
  mov    0x20(%rsp),%rdx
  mov    0x18(%rsp),%rsi
  mov    %r15d,%ecx
  mov    0x28(%rsp),%rdi
  call   <add_core_to_str@plt>
  mov    0xc(%rsp),%eax
  addl   $0x1,0x8(%rsp)
  add    $0x1,%eax
  cltd
  idiv   %r13d
  mov    0x8(%rsp),%eax
  mov    %edx,0xc(%rsp)
  cmp    %eax,%ebx
  jne    L68
  jmp    L75
L101:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
char *build_default_affinity_string(int shuffle) {
  int nr_nodes = numa_num_configured_nodes();
  int nr_cores = numa_num_configured_cpus();
  char *str;
  int str_size = 512;
  int str_written = 0;
  int i;
  struct bitmask **bm = (struct bitmask **)malloc(sizeof(struct bitmask *) * nr_nodes);
  for (i = 0; i < nr_nodes; i++) {
    bm[i] = numa_allocate_cpumask();
    numa_node_to_cpus(i, bm[i]);
  }
  str = (char *)malloc(str_size * sizeof(char));
  assert(str);
  if (!shuffle) {
    for (i = 0; i < nr_nodes; i++) {
      int j;
      for (j = 0; j < nr_cores; j++) {
        if (numa_bitmask_isbitset(bm[i], j)) {
          add_core_to_str(&str, &str_size, &str_written, j);
        }
      }
    }
  } else {
    int next_node = 0;
    for (i = 0; i < nr_cores; i++) {
      int idx = (i / nr_nodes) + 1;
      int found = 0;
      int j = 0;
      do {
        if (numa_bitmask_isbitset(bm[next_node], j)) {
          found++;
        }
        if (found == idx) {
          add_core_to_str(&str, &str_size, &str_written, j);
          break;
        }
        j = (j + 1) % nr_cores;
      } while (found != idx);
      next_node = (next_node + 1) % nr_nodes;
    }
  }
  if (str_written) {
    str[str_written - 1] = 0;
  }
  return str;
}
```