user: Translate the below assembly code into C programming language:

```asm
<spiralOrder>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x70,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %esi,-0x6c(%rbp)
  mov    %edx,-0x70(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x0,-0x6c(%rbp)
  je     L43
  cmpl   $0x0,-0x70(%rbp)
  jne    L57
L43:
  mov    $0x0,%eax
  jmp    L51
L57:
  movl   $0x0,-0x30(%rbp)
  movl   $0x1,-0x2c(%rbp)
  movl   $0x1,-0x28(%rbp)
  movl   $0x0,-0x24(%rbp)
  movl   $0x0,-0x20(%rbp)
  movl   $0xffffffff,-0x1c(%rbp)
  movl   $0xffffffff,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x6c(%rbp),%eax
  cltq
  mov    %eax,%edx
  mov    -0x70(%rbp),%eax
  cltq
  imul   %edx,%eax
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x40(%rbp)
  movl   $0x0,-0x54(%rbp)
  mov    -0x70(%rbp),%eax
  mov    %eax,-0x38(%rbp)
  mov    -0x6c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x34(%rbp)
  movl   $0x0,-0x50(%rbp)
  movl   $0x0,-0x4c(%rbp)
  movl   $0xffffffff,-0x48(%rbp)
  jmp    L21
L0:
  movl   $0x0,-0x44(%rbp)
  jmp    L45
L22:
  mov    -0x50(%rbp),%eax
  cltq
  mov    -0x30(%rbp,%rax,8),%eax
  add    %eax,-0x4c(%rbp)
  mov    -0x50(%rbp),%eax
  cltq
  mov    -0x2c(%rbp,%rax,8),%eax
  add    %eax,-0x48(%rbp)
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x48(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x54(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x54(%rbp)
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x40(%rbp),%rax
  add    %rax,%rdx
  mov    (%rcx),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x44(%rbp)
L45:
  mov    -0x50(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  cltq
  mov    -0x38(%rbp,%rax,4),%eax
  cmp    %eax,-0x44(%rbp)
  jl     L22
  mov    -0x50(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  mov    %eax,%ecx
  movslq %ecx,%rax
  mov    -0x38(%rbp,%rax,4),%eax
  lea    -0x1(%rax),%edx
  movslq %ecx,%rax
  mov    %edx,-0x38(%rbp,%rax,4)
  mov    -0x50(%rbp),%eax
  add    $0x1,%eax
  cltd
  shr    $0x1e,%edx
  add    %edx,%eax
  and    $0x3,%eax
  sub    %edx,%eax
  mov    %eax,-0x50(%rbp)
L21:
  mov    -0x50(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  cltq
  mov    -0x38(%rbp,%rax,4),%eax
  test   %eax,%eax
  jne    L0
  mov    -0x40(%rbp),%rax
L51:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L46
  call   <__stack_chk_fail@plt>
L46:
  leave
  ret
```

assistant: ```c
int *spiralOrder(int **matrix, int rSize, int cSize) {
  if (!rSize || !cSize)
    return NULL;
  int dirs[][2] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
  int *arr = (int *)malloc(sizeof(int) * rSize * cSize);
  int index = 0;
  int steps[] = {cSize, rSize - 1};
  int d = 0;
  int r = 0, c = -1;
  while (steps[d % 2]) {
    for (int i = 0; i < steps[d % 2]; i++) {
      r += dirs[d][0], c += dirs[d][1];
      arr[index++] = matrix[r][c];
    }
    steps[d % 2]--;
    d = (d + 1) % 4;
  }
  return arr;
}
```