user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<n_queens>:
  endbr64
  test   %esi,%esi
  je     L167
  push   %r15
  movslq %edx,%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %rax,0x30(%rsp)
  lea    -0x9(%rsi),%eax
  mov    %rdi,0x58(%rsp)
  movl   $0x0,0x1c(%rsp)
  mov    %eax,0x84(%rsp)
  test   %edx,%edx
  jle    L197
  mov    %rdi,%rbx
  mov    %edx,%r12d
L350:
  movq   $0x0,0x10(%rsp)
L130:
  mov    0x10(%rsp),%r15
  mov    0x1c(%rsp),%edi
  mov    %r12d,%ecx
  mov    %rbx,%rdx
  mov    %r15d,%esi
  call   <is_attacked@plt>
  test   %rax,%rax
  jne    L35
  mov    0x58(%rsp),%rax
  movl   $0x1,(%rax,%r15,4)
  cmp    $0x1,%ebp
  je     L97
  movl   $0x0,0x20(%rsp)
  mov    %r12d,%eax
  mov    %rbx,%r12
  mov    %rbx,0x68(%rsp)
  mov    %ebp,%ebx
  mov    %eax,%ebp
L329:
  movq   $0x0,0x8(%rsp)
  mov    %ebp,%eax
  mov    %r12,%rbp
  mov    %eax,%r12d
L207:
  mov    0x8(%rsp),%r14
  mov    0x20(%rsp),%edi
  mov    %r12d,%ecx
  mov    %rbp,%rdx
  mov    %r14d,%esi
  call   <is_attacked@plt>
  test   %rax,%rax
  jne    L149
  mov    0x68(%rsp),%rax
  movl   $0x1,(%rax,%r14,4)
  cmp    $0x2,%ebx
  je     L97
  mov    %rbp,0x60(%rsp)
  mov    %ebx,%r15d
  mov    %r12d,%ebx
  mov    %rbp,%r12
  movl   $0x0,0x24(%rsp)
L47:
  movq   $0x0,(%rsp)
  mov    %ebx,%ebp
  mov    %r12,%rbx
L253:
  mov    (%rsp),%r14
  mov    0x24(%rsp),%edi
  mov    %ebp,%ecx
  mov    %rbx,%rdx
  mov    %r14d,%esi
  call   <is_attacked@plt>
  test   %rax,%rax
  jne    L317
  mov    0x60(%rsp),%rax
  movl   $0x1,(%rax,%r14,4)
  cmp    $0x3,%r15d
  je     L97
  mov    %rbx,0x48(%rsp)
  movl   $0x0,0x28(%rsp)
  mov    %r15d,0x18(%rsp)
  mov    %ebp,%r15d
  mov    %rbx,%rbp
L298:
  xor    %r13d,%r13d
  mov    %rbp,%r14
L198:
  mov    0x28(%rsp),%edi
  mov    %r15d,%ecx
  mov    %r14,%rdx
  mov    %r13d,%esi
  call   <is_attacked@plt>
  test   %rax,%rax
  jne    L76
  mov    0x48(%rsp),%rax
  cmpl   $0x4,0x18(%rsp)
  movl   $0x1,(%rax,%r13,4)
  je     L97
  mov    %r14,0x38(%rsp)
  mov    %r15d,%r12d
  mov    %r14,%r15
  movl   $0x0,0x2c(%rsp)
  mov    %r13,0x88(%rsp)
L213:
  xor    %r13d,%r13d
  mov    %r12d,%eax
  mov    %r15,%r14
  mov    %r13,%r12
  mov    %eax,%r13d
L347:
  mov    0x2c(%rsp),%edi
  mov    %r13d,%ecx
  mov    %r14,%rdx
  mov    %r12d,%esi
  call   <is_attacked@plt>
  test   %rax,%rax
  jne    L98
  mov    0x38(%rsp),%rax
  cmpl   $0x5,0x18(%rsp)
  movl   $0x1,(%rax,%r12,4)
  je     L97
  mov    %r14,0x50(%rsp)
  movl   $0x0,0x78(%rsp)
  mov    %r12,0x90(%rsp)
  mov    %r13d,%r12d
  mov    %r14,%r13
L277:
  xor    %r15d,%r15d
  nopl   (%rax)
L173:
  mov    0x78(%rsp),%edi
  mov    %r12d,%ecx
  mov    %r13,%rdx
  mov    %r15d,%esi
  call   <is_attacked@plt>
  test   %rax,%rax
  jne    L234
  mov    0x50(%rsp),%rax
  cmpl   $0x6,0x18(%rsp)
  movl   $0x1,(%rax,%r15,4)
  je     L97
  mov    %r13,0x40(%rsp)
  xor    %r14d,%r14d
  mov    %r15,0x98(%rsp)
L312:
  mov    %r14d,0x7c(%rsp)
  xor    %ebx,%ebx
  mov    %r12d,%r14d
  nopl   (%rax)
L313:
  mov    0x7c(%rsp),%edi
  mov    %r14d,%ecx
  mov    %r13,%rdx
  mov    %ebx,%esi
  call   <is_attacked@plt>
  test   %rax,%rax
  jne    L134
  mov    0x40(%rsp),%rax
  cmpl   $0x7,0x18(%rsp)
  movl   $0x1,(%rax,%rbx,4)
  je     L97
  mov    %rbx,0xa0(%rsp)
  mov    %r13,%r12
  xor    %r15d,%r15d
L281:
  mov    %r15d,0x80(%rsp)
  mov    %r13,%rax
  xor    %ebp,%ebp
  mov    %r12,%r13
  mov    %rax,%r12
  nopw   0x0(%rax,%rax,1)
L304:
  mov    0x80(%rsp),%edi
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %ebp,%esi
  call   <is_attacked@plt>
  test   %rax,%rax
  jne    L341
  movl   $0x1,0x0(%r13,%rbp,4)
  cmpl   $0x8,0x18(%rsp)
  je     L97
  mov    %r12,0x70(%rsp)
  xor    %ebx,%ebx
  mov    %rbp,0xa8(%rsp)
  mov    %ebx,%ebp
L245:
  mov    0x70(%rsp),%rbx
  xor    %r15d,%r15d
  nopw   0x0(%rax,%rax,1)
L174:
  mov    %r14d,%ecx
  mov    %r12,%rdx
  mov    %r15d,%esi
  mov    %ebp,%edi
  call   <is_attacked@plt>
  test   %rax,%rax
  jne    L286
  movl   $0x1,(%rbx)
  mov    0x84(%rsp),%esi
  mov    %r14d,%edx
  mov    %r12,%rdi
  call   <n_queens>
  test   %eax,%eax
  jne    L97
  movl   $0x0,(%rbx)
L286:
  add    $0x1,%r15d
  add    $0x4,%rbx
  cmp    %r15d,%r14d
  jg     L174
  addq   $0x190,0x70(%rsp)
  add    $0x1,%ebp
  cmp    %ebp,%r14d
  jg     L245
  mov    0xa8(%rsp),%rbp
  movl   $0x0,0x0(%r13,%rbp,4)
L341:
  add    $0x1,%rbp
  cmp    %ebp,%r14d
  jg     L304
  mov    0x80(%rsp),%r15d
  mov    %r12,%rax
  mov    %r13,%r12
  add    $0x190,%r12
  mov    %rax,%r13
  add    $0x1,%r15d
  cmp    %r15d,%r14d
  jg     L281
  mov    0xa0(%rsp),%rbx
  mov    0x40(%rsp),%rax
  movl   $0x0,(%rax,%rbx,4)
L134:
  add    $0x1,%rbx
  cmp    %ebx,%r14d
  jg     L313
  addq   $0x190,0x40(%rsp)
  mov    %r14d,%r12d
  mov    0x7c(%rsp),%r14d
  add    $0x1,%r14d
  cmp    %r14d,%r12d
  jg     L312
  mov    0x98(%rsp),%r15
  mov    0x50(%rsp),%rax
  movl   $0x0,(%rax,%r15,4)
L234:
  add    $0x1,%r15
  cmp    %r15d,%r12d
  jg     L173
  addl   $0x1,0x78(%rsp)
  mov    0x78(%rsp),%eax
  addq   $0x190,0x50(%rsp)
  cmp    %eax,%r12d
  jg     L277
  mov    0x38(%rsp),%rax
  mov    %r13,%r14
  mov    %r12d,%r13d
  mov    0x90(%rsp),%r12
  movl   $0x0,(%rax,%r12,4)
L98:
  add    $0x1,%r12
  cmp    %r12d,%r13d
  jg     L347
  addl   $0x1,0x2c(%rsp)
  mov    0x2c(%rsp),%eax
  mov    %r14,%r15
  mov    %r13d,%r12d
  addq   $0x190,0x38(%rsp)
  cmp    %eax,%r13d
  jg     L213
  mov    0x88(%rsp),%r13
  mov    0x48(%rsp),%rax
  mov    %r12d,%r15d
  movl   $0x0,(%rax,%r13,4)
L76:
  add    $0x1,%r13
  cmp    %r13,0x30(%rsp)
  jne    L198
  addl   $0x1,0x28(%rsp)
  mov    0x28(%rsp),%eax
  mov    %r14,%rbp
  addq   $0x190,0x48(%rsp)
  cmp    %eax,%r15d
  jne    L298
  mov    0x60(%rsp),%rax
  mov    (%rsp),%rdi
  mov    %r15d,%ebp
  mov    %r14,%rbx
  mov    0x18(%rsp),%r15d
  movl   $0x0,(%rax,%rdi,4)
L317:
  addq   $0x1,(%rsp)
  mov    (%rsp),%rax
  cmp    %rax,0x30(%rsp)
  jne    L253
  addl   $0x1,0x24(%rsp)
  mov    0x24(%rsp),%eax
  mov    %rbx,%r12
  mov    %ebp,%ebx
  addq   $0x190,0x60(%rsp)
  cmp    %eax,%ebp
  jne    L47
  mov    0x68(%rsp),%rax
  mov    0x8(%rsp),%rcx
  mov    %r12,%rbp
  mov    %ebx,%r12d
  mov    %r15d,%ebx
  movl   $0x0,(%rax,%rcx,4)
L149:
  addq   $0x1,0x8(%rsp)
  mov    0x8(%rsp),%rax
  cmp    %rax,0x30(%rsp)
  jne    L207
  mov    %r12d,%eax
  addl   $0x1,0x20(%rsp)
  mov    %rbp,%r12
  addq   $0x190,0x68(%rsp)
  mov    %eax,%ebp
  mov    0x20(%rsp),%eax
  cmp    %eax,%ebp
  jne    L329
  mov    %ebp,%eax
  mov    0x10(%rsp),%rdx
  mov    %ebx,%ebp
  mov    %r12,%rbx
  mov    %eax,%r12d
  mov    0x58(%rsp),%rax
  movl   $0x0,(%rax,%rdx,4)
L35:
  addq   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%rax
  cmp    %rax,0x30(%rsp)
  jne    L130
  addl   $0x1,0x1c(%rsp)
  mov    0x1c(%rsp),%eax
  addq   $0x190,0x58(%rsp)
  cmp    %eax,%r12d
  jne    L350
L197:
  xor    %eax,%eax
  jmp    L14
  xchg   %ax,%ax
L97:
  mov    $0x1,%eax
L14:
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L167:
  mov    $0x1,%eax
  ret
```

assistant: ```c
bool n_queens(int board[][(100)], int n, int dim) {
  int i, j;
  if (n == 0)
    return true;
  for (i = 0; i < dim; i++) {
    for (j = 0; j < dim; j++) {
      if (is_attacked(i, j, board, dim))
        continue;
      board[i][j] = 1;
      if (n_queens(board, n - 1, dim))
        return true;
      board[i][j] = 0;
    }
  }
  return false;
}
```