user: 请将以下的汇编代码转换成C语言代码：

```asm
<magic_square>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x3cf000(%rsp),%r11
L60:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L60
  sub    $0x988,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x3cf978(%rsp)
  xor    %eax,%eax
  test   %edi,%edi
  jle    L44
  lea    -0x1(%rdi),%eax
  mov    $0xfffffffffffffffc,%rdx
  mov    %edi,%r14d
  xor    %r12d,%r12d
  shl    $0x2,%rax
  lea    0xfb0(%rsp),%r13
  lea    D25(%rip),%rbp
  sub    %rax,%rdx
  lea    0xfb4(%rsp,%rax,1),%rbx
  mov    %rdx,0x8(%rsp)
  nopl   0x0(%rax)
L93:
  add    $0x1,%r12d
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  mov    %r12d,%esi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  lea    (%rax,%rbx,1),%r15
  xchg   %ax,%ax
L55:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  add    $0x4,%r15
  call   <scanf@plt>
  cmp    %rbx,%r15
  jne    L55
  lea    0xf9c(%r15),%rbx
  cmp    %r14d,%r12d
  jne    L93
  lea    (%r14,%r14,1),%eax
  lea    0x10(%rsp),%rbx
  movslq %r14d,%rbp
  mov    %r13,%r8
  movslq %eax,%r11
  add    $0x1,%eax
  lea    (%rbx,%rbp,4),%rsi
  mov    %rbx,%rcx
  cltq
  xor    %r9d,%r9d
  mov    %r14d,%r10d
  movl   $0x0,0x10(%rsp,%r11,4)
  movl   $0x0,0x10(%rsp,%rax,4)
  nopl   (%rax)
L153:
  movl   $0x0,(%rcx)
  mov    %r13,%rdx
  xor    %eax,%eax
  movl   $0x0,(%rsi)
  jmp    L5
  nopl   0x0(%rax,%rax,1)
L42:
  add    $0x1,%rax
  add    $0xf9c,%rdx
  cmp    %r10,%rax
  je     L64
L5:
  mov    (%r8,%rax,4),%edi
  add    %edi,(%rcx)
  mov    (%rdx),%edi
  add    %edi,(%rsi)
  cmp    %eax,%r9d
  jne    L42
  add    $0x1,%rax
  mov    (%r8,%rbp,4),%edi
  add    $0xf9c,%rdx
  add    %edi,0x10(%rsp,%r11,4)
  cmp    %r10,%rax
  jne    L5
L64:
  lea    0x1(%r9),%eax
  add    $0x4,%rcx
  add    $0x4,%rsi
  add    $0x4,%r13
  add    $0xf9c,%r8
  cmp    %eax,%r14d
  je     L78
  mov    %eax,%r9d
  jmp    L153
  nopl   0x0(%rax)
L78:
  cmp    $0x1,%r14d
  jne    L127
L44:
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L127:
  mov    %r14d,%edx
  xor    %ebp,%ebp
  imul   %r14d,%edx
  add    $0x1,%edx
  imul   %r14d,%edx
  sar    %edx
  jmp    L6
  nopl   0x0(%rax)
L71:
  lea    0x1(%rbp),%eax
  add    $0x4,%rbx
  cmp    %r9d,%ebp
  je     L12
  mov    %eax,%ebp
L6:
  cmp    %edx,(%rbx)
  je     L71
  lea    D24(%rip),%rdi
  call   <puts@plt>
  cmp    %ebp,%r14d
  je     L12
L159:
  mov    0x3cf978(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  add    $0x3cf988,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L12:
  lea    D3(%rip),%rdi
  call   <puts@plt>
  jmp    L159
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D25
data_type: string
name: parse_data
arguments: data_label: D12
data_type: string
name: parse_data
arguments: data_label: D24
data_type: string
name: parse_data
arguments: data_label: D3
data_type: string

tool: D25:  %d

tool: D12: Enter %d line: 

tool: D24: NO MAGIC

tool: D3: MAGIC

assistant: ```c
void magic_square(int a) {
  int i, b, c;
  int ar[999][999];
  int ar1[999];
  for (i = 0; i < a; i++) {
    printf("Enter %d line: ", i + 1);
    for (b = 0; b < a; b++) {
      scanf(" %d", &ar[i][b]);
    }
  }
  c = (a * (a * a + 1)) / 2;
  ar1[a + a] = 0;
  ar1[a + a + 1] = 0;
  for (i = 0; i < a; i++) {
    ar1[i] = 0;
    ar1[i + a] = 0;
    for (b = 0; b < a; b++) {
      ar1[i] = ar1[i] + ar[i][b];
      ar1[i + a] = ar1[i + a] + ar[b][i];
      if (b == i) {
        ar1[a + a] = ar1[a + a] + ar[i][a];
      }
    }
  }
  b = 0;
  for (i = a - 1; i <= 0; i--) {
    ar1[a + a + 1] = ar1[a + a + 1] + ar[i][b];
    b++;
  }
  b = 0;
  for (i = 0; i < a; i++) {
    if (ar1[i] == c)
      b++;
    else {
      printf("NO MAGIC\n");
      break;
    }
  }
  if (b == a)
    printf("MAGIC\n");
}
```