user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x3c(%rbp),%rdx
  lea    -0x40(%rbp),%rax
  mov    %rax,%rsi
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <scanf@plt>
  mov    -0x40(%rbp),%edx
  mov    -0x40(%rbp),%eax
  imul   %edx,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x38(%rbp)
  jmp    L51
L200:
  mov    -0x40(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    -0x38(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  addl   $0x1,-0x38(%rbp)
L51:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x38(%rbp)
  jl     L200
  movl   $0x0,-0x38(%rbp)
  jmp    L298
L163:
  movl   $0x0,-0x34(%rbp)
  jmp    L278
L201:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x34(%rbp)
L278:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  jl     L201
  addl   $0x1,-0x38(%rbp)
L298:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x38(%rbp)
  jl     L163
  movl   $0x0,-0x38(%rbp)
  jmp    L292
L276:
  movl   $0x0,-0x34(%rbp)
  jmp    L94
L20:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x34(%rbp)
L94:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  jl     L20
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x38(%rbp)
L292:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x38(%rbp)
  jl     L276
  movl   $0x0,-0x30(%rbp)
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  mov    -0x40(%rbp),%edx
  mov    -0x40(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  movl   $0x0,-0x1c(%rbp)
  jmp    L295
L148:
  cmpl   $0x0,-0x30(%rbp)
  jne    L130
  jmp    L192
L296:
  mov    -0x1c(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
  addl   $0x1,-0x1c(%rbp)
L192:
  mov    -0x1c(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L296
  movl   $0x1,-0x30(%rbp)
  subl   $0x1,-0x28(%rbp)
  jmp    L92
L130:
  cmpl   $0x1,-0x30(%rbp)
  jne    L70
  jmp    L102
L299:
  mov    -0x1c(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
L102:
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L299
  movl   $0x2,-0x30(%rbp)
  subl   $0x1,-0x2c(%rbp)
  jmp    L92
L70:
  cmpl   $0x2,-0x30(%rbp)
  jne    L35
  jmp    L96
L259:
  mov    -0x1c(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
L96:
  mov    -0x1c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jg     L259
  movl   $0x3,-0x30(%rbp)
  jmp    L92
L35:
  cmpl   $0x3,-0x30(%rbp)
  jne    L92
  jmp    L37
L71:
  mov    -0x1c(%rbp),%edx
  mov    -0x14(%rbp),%eax
  mov    %eax,%esi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x20(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x20(%rbp)
  mov    -0x14(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x1c(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
L37:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jg     L71
  movl   $0x0,-0x30(%rbp)
  addl   $0x1,-0x24(%rbp)
L92:
  mov    -0x28(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L295:
  cmpl   $0xf,-0x20(%rbp)
  jle    L148
  movl   $0x0,-0x38(%rbp)
  jmp    L53
L310:
  movl   $0x0,-0x34(%rbp)
  jmp    L275
L62:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  addl   $0x1,-0x34(%rbp)
L275:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x34(%rbp)
  jl     L62
  mov    $0xa,%edi
  call   <putchar@plt>
  addl   $0x1,-0x38(%rbp)
L53:
  mov    -0x40(%rbp),%eax
  cmp    %eax,-0x38(%rbp)
  jl     L310
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L181
  call   <__stack_chk_fail@plt>
L181:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D55
datatype: string
name: disassemble_data
arguments: data_tag: D26
datatype: string
name: disassemble_data
arguments: data_tag: D13
datatype: string
name: disassemble_data
arguments: data_tag: D57
datatype: string

tool: D55: %d %d

tool: D26: %d 

tool: D13: %d %d


tool: D57: h=%d, v=%d


assistant: ```c
int main(void) {
  int **c, a, b, i, j;
  scanf("%d %d", &a, &b);
  c = (int **)malloc(a * a * sizeof(int));
  for (i = 0; i < a; i++) {
    c[i] = (int *)malloc(a * sizeof(int));
  }
  for (i = 0; i < a; i++) {
    for (j = 0; j < a; j++) {
      c[i][j] = 0;
    }
  }
  for (i = 0; i < a; i++) {
    for (j = 0; j < a; j++) {
      printf("%d ", c[i][j]);
    }
    printf("\n");
  }
  int o = 0;
  int h = a, v = a;
  int step = 0;
  int index = 0;
  int total = a * a;
  int x = 0;
  int y = 0;
  while (index < 16) {
    if (o == 0) {
      while (y < h) {
        printf("%d %d\n", x, y);
        c[x][y] = index++;
        y++;
      }
      o = 1;
      v--;
    } else if (o == 1) {
      while (x < v - 1) {
        printf("%d %d\n", x, y);
        c[x][y] = index++;
      }
      o = 2;
      h--;
    } else if (o == 2) {
      while (y > step) {
        printf("%d %d\n", x, y);
        c[x][y] = index++;
      }
      o = 3;
    } else if (o == 3) {
      while (x > step) {
        printf("%d %d\n", x, y);
        c[x][y] = index++;
      }
      o = 0;
      step++;
    }
    printf("h=%d, v=%d\n", h, v);
  }
  for (i = 0; i < a; i++) {
    for (j = 0; j < a; j++) {
      printf("%d ", c[i][j]);
    }
    printf("\n");
  }
  return 0;
}
```