user: Please show me the C implementation that matches the assembly code listed below:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  lea    -0x3c(%rbp),%rsi
  push   %r13
  push   %r12
  lea    D6(%rip),%r12
  push   %rbx
  mov    %r12,%rdi
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <scanf@plt>
  movslq -0x3c(%rbp),%rax
  mov    %rsp,%rcx
  lea    0x0(,%rax,4),%rbx
  imul   %rax,%rax
  mov    %rbx,-0x58(%rbp)
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L147
L228:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L228
L147:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L50
L32:
  xor    %eax,%eax
  lea    D44(%rip),%rdi
  mov    %rsp,%rbx
  call   <printf@plt>
  cmpl   $0x0,-0x3c(%rbp)
  jle    L81
  mov    -0x58(%rbp),%rax
  movl   $0x0,-0x48(%rbp)
  xor    %r14d,%r14d
  shr    $0x2,%rax
  mov    %rax,-0x50(%rbp)
  nop
L16:
  lea    (%rbx,%r14,4),%r13
  xor    %r15d,%r15d
  nopw   0x0(%rax,%rax,1)
L71:
  mov    %r13,%rsi
  mov    %r12,%rdi
  add    $0x1,%r15d
  add    $0x4,%r13
  call   <scanf@plt>
  mov    -0x3c(%rbp),%eax
  cmp    %r15d,%eax
  jg     L71
  addl   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%ecx
  add    -0x50(%rbp),%r14
  cmp    %ecx,%eax
  jle    L81
  test   %eax,%eax
  jg     L16
L81:
  lea    D3(%rip),%rdi
  call   <puts@plt>
  mov    -0x3c(%rbp),%edx
  test   %edx,%edx
  jle    L12
  mov    -0x58(%rbp),%r13
  mov    %rbx,-0x48(%rbp)
  mov    %rbx,%r12
  lea    D0(%rip),%r14
  movl   $0x0,-0x50(%rbp)
  shr    $0x2,%r13
  nopw   0x0(%rax,%rax,1)
L242:
  mov    $0xa,%edi
  call   <putchar@plt>
  mov    -0x3c(%rbp),%eax
  test   %eax,%eax
  jle    L12
  xor    %r15d,%r15d
  nopl   0x0(%rax)
L198:
  mov    (%r12,%r15,4),%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%r15
  call   <printf@plt>
  mov    -0x3c(%rbp),%esi
  cmp    %r15d,%esi
  jg     L198
  addl   $0x1,-0x50(%rbp)
  mov    -0x50(%rbp),%eax
  add    -0x58(%rbp),%r12
  cmp    %eax,%esi
  jg     L242
  test   %esi,%esi
  jle    L12
  xor    %edi,%edi
  xor    %ecx,%ecx
  movslq %esi,%rdx
  nopl   0x0(%rax)
L115:
  xor    %eax,%eax
  jmp    L186
  nopl   0x0(%rax)
L103:
  add    $0x1,%rax
  cmp    %rax,%rdx
  je     L218
L186:
  cmp    %eax,%ecx
  jne    L103
  mov    -0x48(%rbp),%r10
  add    (%r10,%rax,4),%edi
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L186
L218:
  lea    0x1(%rcx),%eax
  mov    -0x58(%rbp),%r10
  add    %r10,-0x48(%rbp)
  cmp    %esi,%eax
  je     L196
  mov    %eax,%ecx
  jmp    L115
L12:
  lea    D8(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L113:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L107
  lea    -0x28(%rbp),%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L50:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L32
L107:
  call   <__stack_chk_fail@plt>
  nop
L196:
  xor    %r9d,%r9d
  nopl   0x0(%rax,%rax,1)
L174:
  xor    %esi,%esi
  xor    %edx,%edx
  movslq %r9d,%r8
  nop
L64:
  movslq %edx,%rax
  imul   %r13,%rax
  add    %r8,%rax
  add    (%rbx,%rax,4),%esi
  mov    %edx,%eax
  add    $0x1,%edx
  cmp    %ecx,%eax
  jne    L64
  cmp    %esi,%edi
  jne    L12
  lea    0x1(%r9),%eax
  cmp    %ecx,%r9d
  je     L86
  mov    %eax,%r9d
  jmp    L174
L86:
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L113
```

tool_calls: name: parse_data
arguments: tag: D6
datatype: string
name: parse_data
arguments: tag: D44
datatype: string
name: parse_data
arguments: tag: D3
datatype: string
name: parse_data
arguments: tag: D0
datatype: string
name: parse_data
arguments: tag: D8
datatype: string
name: parse_data
arguments: tag: D12
datatype: string

tool: D6: %d

tool: D44: 
 Vuvedi Chisla: 

tool: D3: Kvadrata e: 

tool: D0: 	%d

tool: D8: 
Ne e Magichen kvadrat

tool: D12: 
Magichen Kvadrat e

assistant: ```c
int main() {
  int size;
  scanf("%d", &size);
  int matrix[size][size];
  int row, column = 0;
  int sum, sum1, sum2;
  int flag = 0;
  printf("\n Vuvedi Chisla: ");
  for (row = 0; row < size; row++) {
    for (column = 0; column < size; column++)
      scanf("%d", &matrix[row][column]);
  }
  printf("Kvadrata e: \n");
  for (row = 0; row < size; row++) {
    printf("\n");
    for (column = 0; column < size; column++) {
      printf("\t%d", matrix[row][column]);
    }
  }
  sum = 0;
  for (row = 0; row < size; row++) {
    for (column = 0; column < size; column++) {
      if (row == column)
        sum = sum + matrix[row][column];
    }
  }
  for (row = 0; row < size; row++) {
    sum1 = 0;
    for (column = 0; column < size; column++) {
      sum1 = sum1 + matrix[row][column];
    }
    if (sum == sum1)
      flag = 1;
    else {
      flag = 0;
      break;
    }
  }
  for (row = 0; row < size; row++) {
    sum2 = 0;
    for (column = 0; column < size; column++) {
      sum2 = sum2 + matrix[column][row];
    }
    if (sum == sum2)
      flag = 1;
    else {
      flag = 0;
      break;
    }
  }
  if (flag == 1)
    printf("\nMagichen Kvadrat e");
  else
    printf("\nNe e Magichen kvadrat");
  return 0;
}
```