user: Translate the below assembly code into C programming language:

```asm
<IsItMagic>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  movl   $0x1,-0x1c(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L115
L97:
  movl   $0x0,-0x20(%rbp)
  jmp    L104
L58:
  mov    -0x24(%rbp),%eax
  cltq
  imul   $0xf9c,%rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D39(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x20(%rbp)
  jne    L61
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L61:
  addl   $0x1,-0x20(%rbp)
L104:
  mov    -0x20(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L58
  addl   $0x1,-0x24(%rbp)
L115:
  mov    -0x24(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L97
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x24(%rbp)
  nop
  mov    -0x24(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jge    L123
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L89
L156:
  mov    -0x24(%rbp),%eax
  cltq
  imul   $0xf9c,%rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  add    %eax,-0x18(%rbp)
  mov    -0x20(%rbp),%eax
  cltq
  imul   $0xf9c,%rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x24(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  add    %eax,-0x10(%rbp)
  addl   $0x1,-0x20(%rbp)
L89:
  mov    -0x20(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L156
  cmpl   $0x0,-0x24(%rbp)
  jne    L112
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0xc(%rbp)
L112:
  mov    -0x18(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jne    L142
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  je     L65
L142:
  movl   $0x0,-0x1c(%rbp)
L65:
  movl   $0x0,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  mov    -0x3c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x24(%rbp)
  jmp    L132
L43:
  mov    -0x24(%rbp),%eax
  cltq
  imul   $0xf9c,%rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  add    %eax,-0x8(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  imul   $0xf9c,%rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rax,%rdx
  mov    -0x20(%rbp),%eax
  cltq
  mov    (%rdx,%rax,4),%eax
  add    %eax,-0x4(%rbp)
  addl   $0x1,-0x20(%rbp)
  subl   $0x1,-0x24(%rbp)
L132:
  cmpl   $0x0,-0x24(%rbp)
  jns    L43
  mov    -0x8(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jne    L45
  mov    -0x4(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  je     L82
L45:
  movl   $0x0,-0x1c(%rbp)
L82:
  cmpl   $0x1,-0x1c(%rbp)
  jne    L126
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L108
L126:
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L108
L123:
  nop
L108:
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D39
datatype: string
name: disassemble_data
arguments: label: D27
datatype: string
name: disassemble_data
arguments: label: D29
datatype: string
name: disassemble_data
arguments: label: D2
datatype: string

tool: D39: %d

tool: D27: 


tool: D29: Magic! 


tool: D2: No Magic! 


assistant: ```c
void IsItMagic(int square[999][999], int inp) {
  int count, subcount;
  int magic = 1;
  for (count = 0; count < inp; count++) {
    for (subcount = 0; subcount < inp; subcount++) {
      scanf("%d", &square[count][subcount]);
      if (subcount == inp - 1)
        printf("\n");
    }
  }
  int sum_l_r = 0;
  int prevsum_l_r = 0;
  int sum_u_d = 0;
  int prevsum_u_d = 0;
  for (count = 0; count < inp; count++) {
    prevsum_l_r = sum_l_r;
    sum_l_r = 0;
    prevsum_u_d = sum_u_d;
    sum_u_d = 0;
    for (subcount = 0; subcount < inp; subcount++) {
      sum_l_r = sum_l_r + square[count][subcount];
      sum_u_d = sum_u_d + square[subcount][count];
    }
    if (count == 0) {
      prevsum_l_r = sum_l_r;
      prevsum_u_d = sum_u_d;
    }
    if (sum_l_r != prevsum_l_r || sum_u_d != prevsum_u_d)
      magic = 0;
    subcount = 0;
    int sumdiag_l_r = 0;
    int sumdiag_r_l = 0;
    for (count = inp - 1; count >= 0; count--) {
      sumdiag_l_r = sumdiag_l_r + square[count][subcount];
      sumdiag_r_l = sumdiag_r_l + square[count][subcount];
      subcount = subcount + 1;
    }
    if (sumdiag_l_r != sum_u_d || sumdiag_r_l != sum_u_d)
      magic = 0;
    if (magic == 1) {
      printf("Magic! \n");
      break;
    } else {
      printf("No Magic! \n");
      break;
    }
  }
}
```