user: Converte this assembly snippet into its equivalent C code:

```asm
<IsItMagic>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,0x10(%rsp)
  test   %esi,%esi
  jle    L10
  lea    -0x1(%rsi),%eax
  mov    %esi,%ebx
  lea    D26(%rip),%r12
  mov    %rdi,%r13
  mov    %rax,0x18(%rsp)
  mov    %rax,%rbp
  imul   $0xf9c,%rax,%rax
  lea    0xf9c(%rdi,%rax,1),%rax
  mov    %rax,0x8(%rsp)
  nopw   0x0(%rax,%rax,1)
L87:
  mov    %r13,%r15
  xor    %r14d,%r14d
  cs nopw 0x0(%rax,%rax,1)
L64:
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  cmp    %ebp,%r14d
  je     L91
  add    $0x1,%r14d
  add    $0x4,%r15
  cmp    %r14d,%ebx
  jne    L64
  add    $0xf9c,%r13
  cmp    0x8(%rsp),%r13
  jne    L87
L45:
  mov    0x10(%rsp),%rax
  xor    %edx,%edx
  cs nopw 0x0(%rax,%rax,1)
L12:
  mov    (%rax),%ecx
  add    $0xf9c,%rax
  add    %edx,%ecx
  mov    %ecx,%edx
  cmp    0x8(%rsp),%rax
  jne    L12
  movslq %ebx,%rax
  mov    0x10(%rsp),%rbx
  imul   $0xf9c,%rax,%rax
  lea    -0x1f34(%rbx,%rax,1),%rsi
  lea    -0xf9c(%rbx,%rax,1),%rdx
  imul   $0xf98,0x18(%rsp),%rax
  sub    %rax,%rsi
  xor    %eax,%eax
L71:
  add    (%rdx),%eax
  sub    $0xf98,%rdx
  cmp    %rdx,%rsi
  jne    L71
  lea    D10(%rip),%rdi
  cmp    %ecx,%eax
  jne    L20
L85:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <printf@plt>
  nopl   0x0(%rax)
L91:
  lea    D27(%rip),%rdi
  add    $0x1,%r14d
  add    $0x4,%r15
  call   <printf@plt>
  cmp    %ebx,%r14d
  jne    L64
  add    $0xf9c,%r13
  cmp    0x8(%rsp),%r13
  jne    L87
  jmp    L45
L20:
  lea    D25(%rip),%rdi
  jmp    L85
L10:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: label: D26
type_guessed: string
name: retrieve_data
arguments: label: D10
type_guessed: string
name: retrieve_data
arguments: label: D27
type_guessed: string
name: retrieve_data
arguments: label: D25
type_guessed: string

tool: D26: %d

tool: D10: Magic! 


tool: D27: 


tool: D25: 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;
    }
  }
}
```