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

```asm
<remove_diagonals>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %edi,%ebx
  mov    %esi,%r13d
  mov    %rdx,%r12
  call   <calc_row@plt>
  mov    %eax,%r15d
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <calc_col@plt>
  lea    0x1(%rax),%ebp
  cmp    %ebp,%ebx
  jg     L104
L0:
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <calc_row@plt>
  mov    %eax,%r14d
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <calc_col@plt>
  sub    $0x1,%eax
  mov    %eax,%ebp
  jns    L3
L171:
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <calc_row@plt>
  mov    %eax,%r14d
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <calc_col@plt>
  lea    0x1(%rax),%ebp
  cmp    %ebp,%ebx
  jg     L93
L178:
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <calc_row@plt>
  mov    %eax,%r14d
  mov    %r13d,%esi
  mov    %ebx,%edi
  call   <calc_col@plt>
  sub    $0x1,%eax
  mov    %eax,%ebp
  jns    L81
L153:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L172:
  add    $0x1,%ebp
  cmp    %ebp,%ebx
  je     L0
L104:
  lea    0x1(%r15),%r14d
  cmp    %ebx,%r14d
  jge    L172
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %ebx,%edi
  call   <calc_index@plt>
  cltq
  add    %r12,%rax
  mov    %r14d,%r15d
  cmpb   $0x71,(%rax)
  je     L172
  movb   $0x2a,(%rax)
  jmp    L172
L50:
  sub    $0x1,%ebp
  cmp    $0xffffffff,%ebp
  je     L171
L3:
  lea    0x1(%r14),%r15d
  cmp    %ebx,%r15d
  jge    L50
  mov    %ebp,%edx
  mov    %r15d,%esi
  mov    %ebx,%edi
  call   <calc_index@plt>
  cltq
  add    %r12,%rax
  mov    %r15d,%r14d
  cmpb   $0x71,(%rax)
  je     L50
  movb   $0x2a,(%rax)
  jmp    L50
L118:
  add    $0x1,%ebp
  cmp    %ebp,%ebx
  je     L178
L93:
  test   %r14d,%r14d
  jle    L118
  sub    $0x1,%r14d
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %ebx,%edi
  call   <calc_index@plt>
  cltq
  add    %r12,%rax
  cmpb   $0x71,(%rax)
  je     L118
  movb   $0x2a,(%rax)
  jmp    L118
L99:
  sub    $0x1,%ebp
  cmp    $0xffffffff,%ebp
  je     L153
L81:
  test   %r14d,%r14d
  jle    L99
  sub    $0x1,%r14d
  mov    %ebp,%edx
  mov    %r14d,%esi
  mov    %ebx,%edi
  call   <calc_index@plt>
  cltq
  add    %r12,%rax
  cmpb   $0x71,(%rax)
  je     L99
  movb   $0x2a,(%rax)
  jmp    L99
```

assistant: ```c
void remove_diagonals(int n, int index, char *board) {
  int row;
  int col_start;
  int diag;
  row = calc_row(n, index);
  col_start = calc_col(n, index) + 1;
  for (int col = col_start; col < n; col++) {
    if (row + 1 < n) {
      row += 1;
      diag = calc_index(n, row, col);
      if (board[diag] != 'q') {
        board[diag] = '*';
      }
    }
  }
  row = calc_row(n, index);
  col_start = calc_col(n, index) - 1;
  for (int col = col_start; col > -1; col--) {
    if (row + 1 < n) {
      row += 1;
      diag = calc_index(n, row, col);
      if (board[diag] != 'q') {
        board[diag] = '*';
      }
    }
  }
  row = calc_row(n, index);
  col_start = calc_col(n, index) + 1;
  for (int col = col_start; col < n; col++) {
    if (row - 1 >= 0) {
      row -= 1;
      diag = calc_index(n, row, col);
      if (board[diag] != 'q') {
        board[diag] = '*';
      }
    }
  }
  row = calc_row(n, index);
  col_start = calc_col(n, index) - 1;
  for (int col = col_start; col > -1; col--) {
    if (row - 1 >= 0) {
      row -= 1;
      diag = calc_index(n, row, col);
      if (board[diag] != 'q') {
        board[diag] = '*';
      }
    }
  }
}
```