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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    D57(%rip),%rdi
  call   <printf@plt>
  lea    -0x3c(%rbp),%rsi
  lea    D31(%rip),%rdi
  call   <scanf@plt>
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rax
  lea    0x0(,%rax,4),%rdi
  mov    %rdi,-0x50(%rbp)
  imul   %rax,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rsi
  and    $0xfffffffffffffff0,%rsi
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rcx
  sub    %rax,%rcx
L125:
  cmp    %rcx,%rsp
  je     L23
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L125
L23:
  mov    %rsi,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L39
  orq    $0x0,-0x8(%rsp,%rax,1)
L39:
  mov    %rsp,%r14
  test   %edx,%edx
  jle    L82
  mov    -0x50(%rbp),%r15
  shr    $0x2,%r15
  mov    $0x0,%eax
  mov    $0x1,%r13d
  mov    %r15,-0x48(%rbp)
  mov    %rax,%r15
  jmp    L2
L8:
  add    $0x1,%ebx
  mov    %r13d,%edx
  mov    %ebx,%esi
  lea    D55(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %r12,%rsi
  lea    D31(%rip),%rdi
  call   <scanf@plt>
  add    $0x4,%r12
  cmp    -0x3c(%rbp),%ebx
  jl     L8
L99:
  mov    -0x3c(%rbp),%eax
  lea    0x1(%r13),%edx
  add    -0x48(%rbp),%r15
  cmp    %r13d,%eax
  jle    L67
  mov    %edx,%r13d
L2:
  lea    (%r14,%r15,4),%r12
  mov    $0x0,%ebx
  cmpl   $0x0,-0x3c(%rbp)
  jg     L8
  jmp    L99
L67:
  mov    -0x48(%rbp),%r15
  mov    %eax,%edi
  test   %eax,%eax
  jle    L82
  mov    %r14,%r9
  lea    -0x1(%rax),%r11d
  mov    %r11d,%ebx
  lea    0x4(%r14,%rbx,4),%rdx
  mov    %r14,%rax
  mov    $0x0,%esi
L84:
  add    (%rax),%esi
  add    $0x4,%rax
  cmp    %rdx,%rax
  jne    L84
  mov    $0x0,%r13d
  lea    0x1(%r15),%r12
  mov    %edi,%r10d
  mov    %esi,-0x48(%rbp)
L31:
  mov    $0x0,%edx
  mov    $0x0,%eax
  movslq %r13d,%r8
L93:
  add    (%r9,%rdx,4),%eax
  movslq %edx,%rcx
  mov    %rcx,%rsi
  imul   %r15,%rsi
  lea    (%r8,%rsi,1),%rdi
  add    (%r14,%rdi,4),%eax
  imul   %r12,%rcx
  add    (%r14,%rcx,4),%eax
  mov    %r11d,%ecx
  sub    %edx,%ecx
  movslq %ecx,%rcx
  add    %rsi,%rcx
  add    (%r14,%rcx,4),%eax
  mov    %rdx,%rcx
  add    $0x1,%rdx
  cmp    %rbx,%rcx
  jne    L93
  add    $0x1,%r13d
  add    -0x50(%rbp),%r9
  cmp    %r13d,%r10d
  jne    L31
  mov    -0x48(%rbp),%esi
  shl    $0x2,%esi
  cmp    %eax,%esi
  jne    L82
  lea    D36(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L138
L82:
  lea    D24(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L138:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L45
  mov    $0x0,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L45:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D57
type_infered: string
name: parse_data
arguments: tag: D31
type_infered: string
name: parse_data
arguments: tag: D55
type_infered: string
name: parse_data
arguments: tag: D36
type_infered: string
name: parse_data
arguments: tag: D24
type_infered: string

tool: D57: Vav. broi redove:

tool: D31: %d

tool: D55: Vav. chislo%d na red %d:

tool: D36: Square is magical

tool: D24: Square is not magical

assistant: ```c
int main() {
  int i, j, n;
  printf("Vav. broi redove:");
  scanf("%d", &n);
  int a[n][n];
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      printf("Vav. chislo%d na red %d:", j + 1, i + 1);
      scanf("%d", &a[i][j]);
    }
  }
  int magic = 0;
  for (i = 0; i < n; i++) {
    magic = magic + a[0][i];
  }
  int p = 0, wrong = 0;
  for (i = 0; i < n; i++, p = 0) {
    wrong = 0;
    for (j = 0; j < n; j++) {
      p = p + a[i][j];
      p = p + a[j][i];
      p = p + a[j][j];
      p = p + a[j][n - (j + 1)];
    }
    if (p == magic * 4) {
      wrong = 1;
    }
  }
  if (wrong == 1)
    printf("Square is magical");
  if (wrong == 0)
    printf("Square is not magical");
}
```