user: Demonstrate the C code that generates the assembly output below:

```asm
<isMagic>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  lea    -0x1(%rsi),%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,(%rsp)
  mov    %esi,0x10(%rsp)
  test   %esi,%esi
  jle    L83
  mov    %r13d,%eax
  mov    (%rsp),%rbx
  mov    %r13d,0x14(%rsp)
  lea    D11(%rip),%r12
  lea    0x0(,%rax,4),%rdx
  imul   $0xfa0,%rax,%rax
  lea    0x4(%rbx,%rdx,1),%rbp
  mov    %rbx,%r14
  mov    %rbp,0x18(%rsp)
  lea    0xfa0(%rbx,%rax,1),%rdi
  mov    $0xfffffffffffffffc,%rax
  mov    %rbp,%rbx
  sub    %rdx,%rax
  mov    %rdi,%r13
  mov    %rax,0x8(%rsp)
  mov    %rax,%r15
  nopl   (%rax)
L36:
  lea    (%rbx,%r15,1),%rbp
  nopl   0x0(%rax)
L132:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  add    $0x4,%rbp
  call   <scanf@plt>
  cmp    %rbp,%rbx
  jne    L132
  add    $0xf9c,%rbx
  cmp    %r13,%rbx
  jne    L36
  mov    0x14(%rsp),%r13d
  mov    0x18(%rsp),%rbp
  xor    %r11d,%r11d
  xor    %r10d,%r10d
  mov    0x8(%rsp),%r12
  mov    0x10(%rsp),%r15d
  xor    %r9d,%r9d
  mov    $0x1,%ebx
  nopw   0x0(%rax,%rax,1)
L66:
  lea    (%r12,%rbp,1),%rax
  mov    %r14,%rdx
  xor    %esi,%esi
  xor    %ecx,%ecx
  nopl   0x0(%rax,%rax,1)
L27:
  add    (%rax),%ecx
  add    (%rdx),%esi
  add    $0x4,%rax
  add    $0xf9c,%rdx
  mov    %ecx,%edi
  mov    %esi,%r8d
  cmp    %rax,%rbp
  jne    L27
  test   %r9d,%r9d
  je     L109
  cmp    %r10d,%ecx
  jne    L39
  cmp    %r11d,%esi
  je     L109
L39:
  xor    %ebx,%ebx
L109:
  add    $0x1,%r9d
  add    $0x4,%r14
  add    $0xf9c,%rbp
  cmp    %r9d,%r15d
  je     L1
  mov    %r8d,%r11d
  mov    %edi,%r10d
  jmp    L66
L83:
  test   %r13d,%r13d
  js     L110
  xor    %esi,%esi
  mov    $0x1,%ebx
  xchg   %ax,%ax
L1:
  movslq 0x10(%rsp),%rax
  mov    (%rsp),%rdi
  xor    %ecx,%ecx
  imul   $0xf9c,%rax,%rdx
  imul   $0xfa0,%rax,%rax
  lea    -0xf9c(%rdi,%rdx,1),%rdx
  lea    -0xfa0(%rdi,%rax,1),%rax
  xor    %edi,%edi
  nopl   0x0(%rax,%rax,1)
L47:
  sub    $0x1,%r13d
  add    (%rdx),%edi
  add    (%rax),%ecx
  sub    $0xf98,%rdx
  sub    $0xfa0,%rax
  cmp    $0xffffffff,%r13d
  jne    L47
  cmp    %edi,%esi
  setne  %al
  cmp    %ecx,%esi
  setne  %dl
  or     %dl,%al
  jne    L58
  test   %ebx,%ebx
  jne    L110
L58:
  lea    D18(%rip),%rdi
L113:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1060 <printf@plt>
L110:
  lea    D22(%rip),%rdi
  jmp    L113
```

tool_calls: name: read_data
arguments: data_tag: D11
type_guessed: string
name: read_data
arguments: data_tag: D18
type_guessed: string
name: read_data
arguments: data_tag: D22
type_guessed: string

tool: D11: %d

tool: D18: NO MAGIC


tool: D22: MAGIC


assistant: ```c
void isMagic(int square[999][999], int n) {
  int magical = 1;
  int i;
  int j;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
      scanf("%d", &square[i][j]);
  int curr_sumrows = 0;
  int prev_sumrows = 0;
  int curr_sumcols = 0;
  int prev_sumcols = 0;
  for (i = 0; i < n; i++) {
    prev_sumrows = curr_sumrows;
    curr_sumrows = 0;
    prev_sumcols = curr_sumcols;
    curr_sumcols = 0;
    for (j = 0; j < n; j++) {
      curr_sumrows = curr_sumrows + square[i][j];
      curr_sumcols = curr_sumcols + square[j][i];
    }
    if (i == 0) {
      prev_sumrows = curr_sumrows;
      prev_sumcols = curr_sumcols;
    }
    if (curr_sumrows != prev_sumrows || curr_sumcols != prev_sumcols)
      magical = 0;
  }
  j = 0;
  int curr_sumdiag1 = 0;
  int curr_sumdiag2 = 0;
  for (i = n - 1; i >= 0; i--) {
    curr_sumdiag1 = curr_sumdiag1 + square[i][j];
    curr_sumdiag2 = curr_sumdiag2 + square[i][i];
    j++;
  }
  if (curr_sumdiag1 != curr_sumcols || curr_sumdiag2 != curr_sumcols)
    magical = 0;
  if (magical == 1)
    printf("MAGIC\n");
  else
    printf("NO MAGIC\n");
}
```