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

```asm
<generateMatrix>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
  jmp    L5
L12:
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  addl   $0x1,-0x18(%rbp)
L5:
  mov    -0x18(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L12
  movl   $0x1,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L43
L18:
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  jmp    L79
L54:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  mov    -0x10(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
  addl   $0x1,-0x18(%rbp)
L79:
  mov    -0x18(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L54
  mov    -0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L40
L101:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0xc(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
  addl   $0x1,-0x18(%rbp)
L40:
  mov    -0x18(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jle    L101
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L100
L113:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  mov    -0xc(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
  subl   $0x1,-0x18(%rbp)
L100:
  mov    -0x18(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jge    L113
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L0
L96:
  mov    -0x14(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x14(%rbp)
  mov    -0x18(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rcx
  mov    -0x10(%rbp),%edx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
  subl   $0x1,-0x18(%rbp)
L0:
  mov    -0x18(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jg     L96
  addl   $0x1,-0x10(%rbp)
  subl   $0x1,-0xc(%rbp)
L43:
  mov    -0x24(%rbp),%eax
  imul   %eax,%eax
  cmp    %eax,-0x14(%rbp)
  jle    L18
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
int **generateMatrix(int n) {
  int **result = (int **)malloc(sizeof(int *) * n);
  int i, k;
  for (i = 0; i < n; i++) {
    result[i] = (int *)malloc(sizeof(int) * n);
  }
  int start, end;
  k = 1;
  start = 0;
  end = n - 1;
  while (k <= n * n) {
    for (i = start; i <= end; i++) {
      result[start][i] = k++;
    }
    for (i = start + 1; i <= end; i++) {
      result[i][end] = k++;
    }
    for (i = end - 1; i >= start; i--) {
      result[end][i] = k++;
    }
    for (i = end - 1; i > start; i--) {
      result[i][start] = k++;
    }
    start++;
    end--;
  }
  return result;
}
```