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

```asm
<build_default_affinity_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <numa_num_configured_nodes@plt>
  mov    %eax,-0x34(%rbp)
  mov    $0x0,%eax
  call   <numa_num_configured_cpus@plt>
  mov    %eax,-0x30(%rbp)
  movl   $0x200,-0x50(%rbp)
  movl   $0x0,-0x4c(%rbp)
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L161
L99:
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rbx
  mov    $0x0,%eax
  call   <numa_allocate_cpumask@plt>
  mov    %rax,(%rbx)
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x48(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <numa_node_to_cpus@plt>
  addl   $0x1,-0x48(%rbp)
L161:
  mov    -0x48(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L99
  mov    -0x50(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <assert@plt>
  cmpl   $0x0,-0x54(%rbp)
  jne    L138
  movl   $0x0,-0x48(%rbp)
  jmp    L91
L139:
  movl   $0x0,-0x44(%rbp)
  jmp    L145
L43:
  mov    -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x44(%rbp),%edx
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <numa_bitmask_isbitset@plt>
  test   %rax,%rax
  je     L81
  mov    -0x44(%rbp),%ecx
  lea    -0x4c(%rbp),%rdx
  lea    -0x50(%rbp),%rsi
  lea    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <add_core_to_str@plt>
L81:
  addl   $0x1,-0x44(%rbp)
L145:
  mov    -0x44(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L43
  addl   $0x1,-0x48(%rbp)
L91:
  mov    -0x48(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L139
  jmp    L168
L138:
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x48(%rbp)
  jmp    L67
L135:
  mov    -0x48(%rbp),%eax
  cltd
  idivl  -0x34(%rbp)
  add    $0x1,%eax
  mov    %eax,-0x2c(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
L73:
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x38(%rbp),%edx
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <numa_bitmask_isbitset@plt>
  test   %rax,%rax
  je     L115
  addl   $0x1,-0x3c(%rbp)
L115:
  mov    -0x3c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jne    L28
  mov    -0x38(%rbp),%ecx
  lea    -0x4c(%rbp),%rdx
  lea    -0x50(%rbp),%rsi
  lea    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <add_core_to_str@plt>
  jmp    L50
L28:
  mov    -0x38(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x30(%rbp)
  mov    %edx,-0x38(%rbp)
  mov    -0x3c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jne    L73
L50:
  mov    -0x40(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x34(%rbp)
  mov    %edx,-0x40(%rbp)
  addl   $0x1,-0x48(%rbp)
L67:
  mov    -0x48(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L135
L168:
  mov    -0x4c(%rbp),%eax
  test   %eax,%eax
  je     L26
  mov    -0x28(%rbp),%rdx
  mov    -0x4c(%rbp),%eax
  cltq
  sub    $0x1,%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L26:
  mov    -0x28(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L147
  call   <__stack_chk_fail@plt>
L147:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

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;
}
```