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

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x88,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L35
L11:
  mov    %rsp,%rax
  mov    %rax,-0xa8(%rbp)
  mov    -0x68(%rbp),%rsi
  mov    -0x68(%rbp),%rdi
  mov    %rsi,%rax
  sub    $0x1,%rax
  mov    %rax,-0x50(%rbp)
  mov    %rsi,-0xa0(%rbp)
  movq   $0x0,-0x98(%rbp)
  lea    0x0(,%rsi,4),%rbx
  mov    %rdi,%rax
  sub    $0x1,%rax
  mov    %rax,-0x48(%rbp)
  mov    %rsi,%r12
  mov    $0x0,%r13d
  mov    %rdi,%r14
  mov    $0x0,%r15d
  mov    %r13,%rdx
  imul   %r14,%rdx
  mov    %r15,%rax
  imul   %r12,%rax
  lea    (%rdx,%rax,1),%rcx
  mov    %r12,%rax
  mul    %r14
  add    %rdx,%rcx
  mov    %rcx,%rdx
  mov    %rsi,-0x80(%rbp)
  movq   $0x0,-0x78(%rbp)
  mov    %rdi,-0x90(%rbp)
  movq   $0x0,-0x88(%rbp)
  mov    -0x80(%rbp),%r8
  mov    -0x78(%rbp),%r9
  mov    %r9,%rdx
  mov    -0x90(%rbp),%r10
  mov    -0x88(%rbp),%r11
  imul   %r10,%rdx
  mov    %r11,%rax
  imul   %r8,%rax
  lea    (%rdx,%rax,1),%rcx
  mov    %r8,%rax
  mul    %r10
  add    %rdx,%rcx
  mov    %rcx,%rdx
  mov    %rsi,%rax
  imul   %rdi,%rax
  lea    0x0(,%rax,4),%rdx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L47:
  cmp    %rdx,%rsp
  je     L88
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L47
L88:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L98
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L98:
  mov    %rsp,%rax
  add    $0x3,%rax
  shr    $0x2,%rax
  shl    $0x2,%rax
  mov    %rax,-0x40(%rbp)
  movq   $0x0,-0x60(%rbp)
  jmp    L50
L7:
  movq   $0x0,-0x58(%rbp)
  jmp    L18
L60:
  mov    %rbx,%rax
  shr    $0x2,%rax
  imul   -0x60(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rsi
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  addq   $0x1,-0x58(%rbp)
L18:
  mov    -0x68(%rbp),%rax
  cmp    %rax,-0x58(%rbp)
  jb     L60
  addq   $0x1,-0x60(%rbp)
L50:
  mov    -0x68(%rbp),%rax
  cmp    %rax,-0x60(%rbp)
  jb     L7
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x68(%rbp),%rax
  mov    -0x40(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <print_image@plt>
  lea    D3(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x68(%rbp),%rax
  mov    -0x40(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <rotate_image@plt>
  mov    -0x68(%rbp),%rax
  mov    -0x40(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <print_image@plt>
  mov    -0xa8(%rbp),%rsp
L35:
  lea    -0x68(%rbp),%rax
  mov    %rax,%rsi
  lea    D31(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <scanf@plt>
  cmp    $0x1,%eax
  je     L11
  mov    $0x0,%eax
  mov    -0x38(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L21
  call   <__stack_chk_fail@plt>
L21:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: tag: D22
type_guessed: string
name: parse_data
arguments: tag: D20
type_guessed: string
name: parse_data
arguments: tag: D24
type_guessed: string
name: parse_data
arguments: tag: D3
type_guessed: string
name: parse_data
arguments: tag: D31
type_guessed: string

tool: D22: Enter N, followed by the NxN values


tool: D20: %u

tool: D24: Before rotation:


tool: D3: After rotation:


tool: D31: %zu

assistant: ```c
int main(void) {
  printf("Enter N, followed by the NxN values\n");
  size_t dim;
  while (scanf("%zu", &dim) == 1) {
    unsigned image[dim][dim];
    size_t i, j;
    for (i = 0; i < dim; i++) {
      for (j = 0; j < dim; j++) {
        scanf("%u", &image[i][j]);
      }
    }
    printf("Before rotation:\n");
    print_image(dim, image);
    printf("After rotation:\n");
    rotate_image(dim, image);
    print_image(dim, image);
  }
  return 0;
}
```