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

```asm
<spiralOrder>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdi,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  je     L67
  mov    %edx,%ebx
  test   %edx,%edx
  je     L67
  mov    %esi,%edi
  movdqa D3(%rip),%xmm0
  mov    %esi,%ebp
  xor    %r12d,%r12d
  imul   %edx,%edi
  sub    $0x1,%ebp
  xor    %r14d,%r14d
  movaps %xmm0,0x40(%rsp)
  movdqa D16(%rip),%xmm0
  shl    $0x2,%edi
  movaps %xmm0,0x50(%rsp)
  call   <malloc@plt>
  movd   %ebx,%xmm0
  movd   %ebp,%xmm1
  xor    %r10d,%r10d
  mov    %rax,0x8(%rsp)
  punpckldq %xmm1,%xmm0
  mov    $0xffffffff,%r11d
  xor    %edx,%edx
  mov    %rax,0x20(%rsp)
  add    $0x4,%rax
  mov    %rax,0x28(%rsp)
  movq   %xmm0,0x38(%rsp)
  nopw   0x0(%rax,%rax,1)
L60:
  lea    -0x1(%rbx),%r9d
  test   %ebx,%ebx
  jle    L37
  movslq %r12d,%rax
  mov    0x44(%rsp,%rax,8),%esi
  mov    0x40(%rsp,%rax,8),%edi
  cmp    $0x1,%esi
  jne    L80
  cmp    $0x1,%edi
  jne    L80
  movslq %r11d,%rcx
  lea    -0x1(%rbx),%r8d
  mov    (%rsp),%r15
  lea    0x2(%rcx,%r8,1),%rbp
  mov    %r8,%r9
  movslq %r10d,%r8
  sub    %rcx,%r8
  lea    0x4(,%rcx,4),%rax
  shl    $0x2,%rcx
  lea    (%r15,%r8,8),%r13
  mov    0x8(%rsp),%r15
  movslq %r14d,%r8
  shl    $0x2,%rbp
  lea    (%r15,%r8,4),%r8
  sub    %rcx,%r8
  nopl   (%rax)
L77:
  mov    0x0(%r13,%rax,2),%rcx
  mov    (%rcx,%rax,1),%ecx
  mov    %ecx,-0x4(%r8,%rax,1)
  add    $0x4,%rax
  cmp    %rbp,%rax
  jne    L77
L78:
  add    %edi,%r10d
  imul   %r9d,%edi
  add    %esi,%r11d
  add    %ebx,%r14d
  imul   %r9d,%esi
  add    %edi,%r10d
  add    %esi,%r11d
L37:
  mov    %r9d,0x38(%rsp,%rdx,4)
  lea    0x1(%r12),%edx
  mov    %edx,%r12d
  and    $0x1,%edx
  mov    0x38(%rsp,%rdx,4),%ebx
  and    $0x3,%r12d
  test   %ebx,%ebx
  jne    L60
L86:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L100
  mov    0x20(%rsp),%rax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L80:
  movslq %edi,%rcx
  movslq %r10d,%rax
  movslq %r14d,%r13
  mov    %edi,0x1c(%rsp)
  add    %rcx,%rax
  lea    0x0(,%rcx,8),%r15
  mov    (%rsp),%rcx
  lea    -0x1(%rbx),%ebp
  mov    %rbp,%r9
  add    %r13,%rbp
  lea    (%rcx,%rax,8),%r8
  movslq %esi,%rax
  lea    0x0(,%rax,4),%rcx
  mov    %rcx,0x10(%rsp)
  movslq %r11d,%rcx
  add    %rax,%rcx
  mov    0x8(%rsp),%rax
  shl    $0x2,%rcx
  lea    (%rax,%r13,4),%rax
  mov    0x28(%rsp),%r13
  lea    0x0(%r13,%rbp,4),%r13
  mov    0x10(%rsp),%rbp
  nopl   0x0(%rax,%rax,1)
L8:
  mov    (%r8),%rdi
  add    $0x4,%rax
  add    %r15,%r8
  mov    (%rdi,%rcx,1),%edi
  add    %rbp,%rcx
  mov    %edi,-0x4(%rax)
  cmp    %r13,%rax
  jne    L8
  mov    0x1c(%rsp),%edi
  jmp    L78
L67:
  movq   $0x0,0x20(%rsp)
  jmp    L86
L100:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D3
type_infered: byte[16]
name: disassemble_data
arguments: data_label: D16
type_infered: byte[16]

tool: {"D3": [0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: {"D16": [0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00]}

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;
}
```