user: 请从给定的汇编指令推导出C源代码:

```asm
<generateMatrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %edi,%ebx
  mov    %rsi,%r15
  mov    %rdx,%r12
  movslq %edi,%r14
  lea    0x0(,%rdi,8),%edi
  call   <malloc@plt>
  mov    %rax,%rbp
  mov    %ebx,%r13d
  imul   %ebx,%r13d
  lea    0x0(,%r13,4),%edi
  call   <malloc@plt>
  mov    %rax,0x8(%rsp)
  mov    %ebx,(%r15)
  lea    0x0(,%rbx,4),%edi
  call   <malloc@plt>
  mov    %rax,(%r12)
  test   %ebx,%ebx
  jle    L19
  shl    $0x2,%r14
  mov    0x8(%rsp),%rdx
  mov    %ebx,%esi
  shl    $0x2,%rsi
  mov    $0x0,%eax
L171:
  mov    %rdx,0x0(%rbp,%rax,2)
  mov    (%r12),%rcx
  mov    %ebx,(%rcx,%rax,1)
  add    %r14,%rdx
  add    $0x4,%rax
  cmp    %rsi,%rax
  jne    L171
L19:
  sub    $0x1,%ebx
  test   %r13d,%r13d
  jle    L91
  mov    %ebx,%r8d
  mov    $0x0,%eax
  mov    $0x0,%edi
  mov    $0x0,%r9d
  mov    $0x0,%edx
  jmp    L82
L131:
  cmp    $0x3,%edx
  jne    L63
  cmp    %ebx,%r9d
  jg     L126
  movslq %edi,%r11
  shl    $0x2,%r11
  movslq %ebx,%rcx
  lea    0x0(%rbp,%rcx,8),%rcx
  lea    0x1(%rbx,%rax,1),%r10d
  sub    %r9d,%r10d
L130:
  add    $0x1,%eax
  mov    (%rcx),%rsi
  mov    %eax,(%rsi,%r11,1)
  sub    $0x8,%rcx
  cmp    %r10d,%eax
  jne    L130
L126:
  add    $0x1,%edi
  jmp    L63
L113:
  cmp    %r8d,%edi
  jg     L140
  movslq %ebx,%rcx
  lea    0x0(%rbp,%rcx,8),%r12
  movslq %r8d,%r11
  lea    0x0(,%r11,4),%rcx
  mov    %r8d,%r15d
  mov    %edi,%r14d
  mov    %r8d,%esi
  sub    %edi,%esi
  sub    %rsi,%r11
  shl    $0x2,%r11
  mov    %eax,%esi
L48:
  add    $0x1,%esi
  mov    (%r12),%r10
  mov    %esi,(%r10,%rcx,1)
  mov    %rcx,%r10
  sub    $0x4,%rcx
  cmp    %r11,%r10
  jne    L48
  lea    0x1(%rax,%r15,1),%eax
  sub    %r14d,%eax
L140:
  sub    $0x1,%ebx
  jmp    L63
L156:
  cmp    %r8d,%edi
  jg     L37
  movslq %r9d,%rcx
  lea    0x0(%rbp,%rcx,8),%r12
  movslq %edi,%rsi
  lea    0x0(,%rsi,4),%rcx
  mov    %r8d,%r15d
  mov    %edi,%r14d
  mov    %r8d,%r10d
  sub    %edi,%r10d
  lea    0x1(%rsi,%r10,1),%r11
  shl    $0x2,%r11
  mov    %eax,%esi
L67:
  add    $0x1,%esi
  mov    (%r12),%r10
  mov    %esi,(%r10,%rcx,1)
  add    $0x4,%rcx
  cmp    %r11,%rcx
  jne    L67
  lea    0x1(%rax,%r15,1),%eax
  sub    %r14d,%eax
L37:
  add    $0x1,%r9d
L63:
  add    $0x1,%edx
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  shr    $0x1e,%ecx
  add    %ecx,%edx
  and    $0x3,%edx
  sub    %ecx,%edx
  cmp    %eax,%r13d
  jle    L91
L82:
  cmp    $0x2,%edx
  je     L113
  jg     L131
  test   %edx,%edx
  je     L156
  cmp    $0x1,%edx
  jne    L63
  cmp    %ebx,%r9d
  jg     L207
  movslq %r8d,%r11
  shl    $0x2,%r11
  movslq %r9d,%rcx
  lea    0x0(%rbp,%rcx,8),%rcx
  lea    0x1(%rbx,%rax,1),%r10d
  sub    %r9d,%r10d
L119:
  add    $0x1,%eax
  mov    (%rcx),%rsi
  mov    %eax,(%rsi,%r11,1)
  add    $0x8,%rcx
  cmp    %r10d,%eax
  jne    L119
L207:
  sub    $0x1,%r8d
  jmp    L63
L91:
  mov    %rbp,%rax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int **generateMatrix(int n, int *returnSize, int **returnColumnSizes) {
  int i;
  int **matrix = malloc(n * sizeof(int *));
  int *nums = malloc(n * n * sizeof(int));
  *returnSize = n;
  *returnColumnSizes = malloc(n * sizeof(int));
  for (i = 0; i < n; i++) {
    matrix[i] = &nums[i * n];
    (*returnColumnSizes)[i] = n;
  }
  int direction = 0;
  int hor_top = 0;
  int hor_bottom = n - 1;
  int ver_left = 0;
  int ver_right = n - 1;
  int num = 0;
  while (num < n * n) {
    switch (direction) {
    case 0:
      for (i = ver_left; i <= ver_right; i++) {
        matrix[hor_top][i] = ++num;
      }
      hor_top++;
      break;
    case 1:
      for (i = hor_top; i <= hor_bottom; i++) {
        matrix[i][ver_right] = ++num;
      }
      ver_right--;
      break;
    case 2:
      for (i = ver_right; i >= ver_left; i--) {
        matrix[hor_bottom][i] = ++num;
      }
      hor_bottom--;
      break;
    case 3:
      for (i = hor_bottom; i >= hor_top; i--) {
        matrix[i][ver_left] = ++num;
      }
      ver_left++;
      break;
    }
    direction++;
    direction %= 4;
  }
  return matrix;
}
```