user: 请将以下的汇编代码转换成C语言代码:

```asm
<build_default_affinity_string>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %edi,%r14d
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  call   <numa_num_configured_nodes@plt>
  mov    %eax,%r15d
  mov    $0x0,%eax
  call   <numa_num_configured_cpus@plt>
  mov    %eax,%r12d
  movl   $0x200,0x28(%rsp)
  movl   $0x0,0x2c(%rsp)
  lea    0x0(,%r15,8),%edi
  call   <malloc@plt>
  mov    %rax,0x18(%rsp)
  test   %r15d,%r15d
  jle    L111
  mov    %rax,%r13
  mov    %rax,%rbp
  mov    $0x0,%ebx
L137:
  mov    $0x0,%eax
  call   <numa_allocate_cpumask@plt>
  mov    %rax,%rsi
  mov    %rax,0x0(%rbp)
  mov    %ebx,%edi
  call   <numa_node_to_cpus@plt>
  mov    %ebx,0x8(%rsp)
  add    $0x1,%ebx
  add    $0x8,%rbp
  cmp    %ebx,%r15d
  jne    L137
  mov    0x28(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x30(%rsp)
  call   <assert@plt>
  test   %r14d,%r14d
  jne    L9
  mov    0x8(%rsp),%eax
  mov    0x18(%rsp),%rcx
  lea    0x8(%rcx,%rax,8),%rax
  mov    %rax,0x8(%rsp)
  lea    0x2c(%rsp),%r15
  jmp    L71
L101:
  add    $0x1,%ebx
  cmp    %ebx,%r12d
  je     L1
L103:
  mov    %ebx,%esi
  mov    0x0(%rbp),%rdi
  call   <numa_bitmask_isbitset@plt>
  test   %rax,%rax
  je     L101
  lea    0x28(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  mov    %ebx,%ecx
  mov    %r15,%rdx
  call   <add_core_to_str@plt>
  jmp    L101
L1:
  add    $0x8,%r13
  cmp    %r13,0x8(%rsp)
  je     L130
L71:
  mov    %r13,%rbp
  mov    %r14d,%ebx
  test   %r12d,%r12d
  jg     L103
  jmp    L1
L144:
  lea    0x1(%rbp),%eax
  cltd
  idiv   %r12d
  mov    %edx,%ebp
L151:
  mov    %ebp,%esi
  mov    (%r14),%rdi
  call   <numa_bitmask_isbitset@plt>
  cmp    $0x1,%rax
  sbb    $0xffffffff,%ebx
  cmp    %r13d,%ebx
  jne    L144
  lea    0x2c(%rsp),%rdx
  lea    0x28(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  mov    %ebp,%ecx
  call   <add_core_to_str@plt>
  mov    0x14(%rsp),%eax
  add    $0x1,%eax
  cltd
  idiv   %r15d
  mov    %edx,0x14(%rsp)
  addl   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%eax
  cmp    %eax,%r12d
  je     L130
L67:
  mov    0x8(%rsp),%eax
  cltd
  idiv   %r15d
  lea    0x1(%rax),%r13d
  movslq 0x14(%rsp),%rax
  mov    0x18(%rsp),%rcx
  lea    (%rcx,%rax,8),%r14
  mov    $0x0,%ebp
  mov    $0x0,%ebx
  jmp    L151
L111:
  mov    0x28(%rsp),%edi
  call   <malloc@plt>
  mov    %rax,%rdi
  mov    %rax,0x30(%rsp)
  call   <assert@plt>
  test   %r14d,%r14d
  je     L130
L9:
  movl   $0x0,0x14(%rsp)
  movl   $0x0,0x8(%rsp)
  test   %r12d,%r12d
  jg     L67
L130:
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  je     L12
  cltq
  mov    0x30(%rsp),%rdx
  movb   $0x0,-0x1(%rdx,%rax,1)
L12:
  mov    0x30(%rsp),%rax
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L76
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L76:
  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;
}
```