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

```asm
<isItMagic>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    %esi,-0x5c(%rbp)
  mov    %edx,-0x60(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x44(%rbp)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
  jmp    L166
L186:
  mov    -0x38(%rbp),%eax
  cltq
  movl   $0x0,-0x30(%rbp,%rax,4)
  addl   $0x1,-0x38(%rbp)
L166:
  cmpl   $0x9,-0x38(%rbp)
  jle    L186
  movl   $0x0,-0x38(%rbp)
  jmp    L16
L139:
  movl   $0x0,-0x34(%rbp)
  jmp    L69
L171:
  mov    -0x38(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jne    L8
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x34(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  add    %eax,-0x40(%rbp)
L8:
  mov    -0x38(%rbp),%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  cmp    %eax,-0x5c(%rbp)
  jne    L144
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x34(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  add    %eax,-0x3c(%rbp)
L144:
  mov    -0x34(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%ecx
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x34(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x34(%rbp),%eax
  cltq
  mov    %edx,-0x30(%rbp,%rax,4)
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rax,%rdx
  mov    -0x34(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  add    %eax,-0x44(%rbp)
  addl   $0x1,-0x34(%rbp)
L69:
  mov    -0x34(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L171
  mov    -0x44(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  je     L48
  mov    -0x44(%rbp),%eax
  mov    %eax,%esi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L6
L48:
  movl   $0x0,-0x44(%rbp)
  addl   $0x1,-0x38(%rbp)
L16:
  mov    -0x38(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L139
  movl   $0x0,-0x38(%rbp)
  jmp    L86
L13:
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  cmp    %eax,-0x60(%rbp)
  je     L37
  mov    -0x38(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,4),%eax
  mov    %eax,%esi
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L6
L37:
  addl   $0x1,-0x38(%rbp)
L86:
  mov    -0x38(%rbp),%eax
  cmp    -0x5c(%rbp),%eax
  jl     L13
  mov    -0x40(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  je     L74
  mov    -0x40(%rbp),%eax
  mov    %eax,%esi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L6
L74:
  mov    -0x3c(%rbp),%eax
  cmp    -0x60(%rbp),%eax
  je     L40
  mov    -0x3c(%rbp),%eax
  mov    %eax,%esi
  lea    D37(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x5c(%rbp),%eax
  mov    %eax,%esi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0xffffffff,%eax
  jmp    L6
L40:
  mov    $0x1,%eax
L6:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L147
  call   <__stack_chk_fail@plt>
L147:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D31
data_type: string
name: unpack_data
arguments: tag: D49
data_type: string
name: unpack_data
arguments: tag: D2
data_type: string
name: unpack_data
arguments: tag: D37
data_type: string
name: unpack_data
arguments: tag: D39
data_type: string

tool: D31: ROW SUM IS: %d

tool: D49: COL SUM IS: %d

tool: D2: MAIND SUM IS: %d

tool: D37: SECOND SUM IS: %d

tool: D39: 
Size is: %d


assistant: ```c
int isItMagic(int square[10][10], int squareSize, int sumOfSquare) {
  int row, mainDiag, secondDiag, columns[10], i, j;
  row = 0;
  mainDiag = 0;
  secondDiag = 0;
  for (i = 0; i < 10; i++) {
    columns[i] = 0;
  }
  for (i = 0; i < squareSize; i++) {
    for (j = 0; j < squareSize; j++) {
      if (i == j) {
        mainDiag += square[i][j];
      }
      if (i + j + 2 == squareSize + 1) {
        secondDiag += square[i][j];
      }
      columns[j] += square[i][j];
      row += square[i][j];
    }
    if (row != sumOfSquare) {
      printf("ROW SUM IS: %d", row);
      return -1;
    }
    row = 0;
  }
  for (i = 0; i < squareSize; i++) {
    if (columns[i] != sumOfSquare) {
      printf("COL SUM IS: %d", columns[i]);
      return -1;
    }
  }
  if (mainDiag != sumOfSquare) {
    printf("MAIND SUM IS: %d", mainDiag);
    return -1;
  }
  if (secondDiag != sumOfSquare) {
    printf("SECOND SUM IS: %d", secondDiag);
    printf("\nSize is: %d\n", squareSize);
    return -1;
  }
  return 1;
}
```