user: What is the c source code of the assembly code below:

```asm
<magic>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x3cf000(%rsp),%r11
L26:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L26
  sub    $0x988,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3cf978(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  jle    L116
  lea    -0x1(%rdi),%eax
  mov    $0xfffffffffffffffc,%rdx
  mov    %edi,%r14d
  xor    %r12d,%r12d
  shl    $0x2,%rax
  lea    0xfb0(%rsp),%r13
  lea    D32(%rip),%rbp
  sub    %rax,%rdx
  lea    0xfb4(%rsp,%rax,1),%rbx
  mov    %rdx,0x8(%rsp)
  nopl   0x0(%rax)
L59:
  add    $0x1,%r12d
  lea    D18(%rip),%rdi
  xor    %eax,%eax
  mov    %r12d,%esi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  lea    (%rax,%rbx,1),%r15
  xchg   %ax,%ax
L147:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  add    $0x4,%r15
  call   <scanf@plt>
  cmp    %rbx,%r15
  jne    L147
  lea    0xf9c(%r15),%rbx
  cmp    %r14d,%r12d
  jne    L59
  lea    (%r14,%r14,1),%eax
  lea    0x10(%rsp),%rbp
  mov    %r13,%r10
  xor    %r9d,%r9d
  movslq %eax,%rbx
  add    $0x1,%eax
  mov    %rbp,%rcx
  mov    %r14d,%r11d
  cltq
  movl   $0x0,0x10(%rsp,%rbx,4)
  movl   $0x0,0x10(%rsp,%rax,4)
  movslq %r14d,%rax
  lea    0x0(%rbp,%rax,4),%rsi
  nopl   (%rax)
L58:
  movl   $0x0,(%rcx)
  mov    %r13,%rdx
  xor    %eax,%eax
  movl   $0x0,(%rsi)
  jmp    L48
  nopl   0x0(%rax,%rax,1)
L130:
  add    $0x1,%rax
  add    $0xf9c,%rdx
  cmp    %r11,%rax
  je     L118
L48:
  mov    (%r10,%rax,4),%edi
  mov    (%rdx),%r8d
  add    %edi,(%rcx)
  add    %r8d,(%rsi)
  cmp    %eax,%r9d
  jne    L130
  add    $0x1,%rax
  add    %edi,0x10(%rsp,%rbx,4)
  add    $0xf9c,%rdx
  cmp    %r11,%rax
  jne    L48
L118:
  lea    0x1(%r9),%eax
  add    $0x4,%rcx
  add    $0x4,%rsi
  add    $0x4,%r13
  add    $0xf9c,%r10
  cmp    %eax,%r14d
  je     L172
  mov    %eax,%r9d
  jmp    L58
  cs nopw 0x0(%rax,%rax,1)
L172:
  cmp    $0x1,%r14d
  jne    L173
L116:
  jmp    L116
  nopl   0x0(%rax,%rax,1)
L173:
  mov    %r14d,%edx
  xor    %ebx,%ebx
  imul   %r14d,%edx
  add    $0x1,%edx
  imul   %r14d,%edx
  sar    %edx
  jmp    L87
  nopl   0x0(%rax)
L117:
  lea    0x1(%rbx),%eax
  add    $0x4,%rbp
  cmp    %r9d,%ebx
  je     L68
  mov    %eax,%ebx
L87:
  cmp    %edx,0x0(%rbp)
  je     L117
  lea    D36(%rip),%rdi
  call   <puts@plt>
  cmp    %ebx,%r14d
  je     L68
L20:
  mov    0x3cf978(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L171
  add    $0x3cf988,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L68:
  lea    D15(%rip),%rdi
  call   <puts@plt>
  jmp    L20
L171:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D32
type: string
name: parse_data
arguments: label: D18
type: string
name: parse_data
arguments: label: D36
type: string
name: parse_data
arguments: label: D15
type: string

tool: D32:  %d

tool: D18: Vavedi %d red: 


tool: D36: NO MAGIC

tool: D15: MAGIC

assistant: ```c
void magic(int n) {
  int i, k, b, j, l;
  int m[999][999];
  int m1[999];
  for (i = 0; i < n; i++) {
    printf("Vavedi %d red: \n", i + 1);
    for (k = 0; k < n; k++) {
      scanf(" %d", &m[i][k]);
    }
  }
  b = (n * (n * n + 1)) / 2;
  m1[n + n] = 0;
  m1[n + n + 1] = 0;
  for (i = 0; i < n; i++) {
    m1[i] = 0;
    m1[i + n] = 0;
    for (k = 0; k < n; k++) {
      m1[i] = m1[i] + m[i][k];
      m1[i + n] = m1[i + n] + m[k][i];
      if (k == i) {
        m1[n + n] = m1[n + n] + m[i][k];
      }
    }
  }
  k = 0;
  for (i = n - 1; i <= 0; i--) {
    m1[n + n + 1] = m1[n + n + 1] + m[i][k];
    k++;
  }
  k = 0;
  for (i = 0; i < n; i++) {
    if (m1[i] == b)
      k++;
    else {
      printf("NO MAGIC\n");
      break;
    }
  }
  if (k == n)
    printf("MAGIC\n");
}
```