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

```asm
<spiralPrint>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %esi,0x10(%rsp)
  mov    %rdx,0x8(%rsp)
  test   %edi,%edi
  jle    L72
  mov    %edi,%r15d
  test   %esi,%esi
  jle    L72
  movslq %esi,%rax
  mov    %rax,0x28(%rsp)
  lea    0x14(%rdx,%rax,4),%rax
  mov    %rax,0x18(%rsp)
  mov    %rdx,0x20(%rsp)
  mov    $0x0,%r12d
  mov    $0x0,%r14d
  lea    D4(%rip),%rbp
  jmp    L36
L14:
  cmp    0x4(%rsp),%r15d
  jle    L22
  movslq %r15d,%rax
  lea    (%rax,%rax,2),%rax
  lea    (%r12,%rax,2),%rax
  shl    $0x2,%rax
  mov    0x8(%rsp),%rcx
  lea    -0x18(%rcx,%rax,1),%rbx
  lea    -0x30(%rcx,%rax,1),%rdx
  mov    %r15d,%eax
  sub    %r12d,%eax
  lea    -0x2(%rax),%eax
  lea    (%rax,%rax,2),%rax
  shl    $0x3,%rax
  sub    %rax,%rdx
  mov    %rdx,%r13
L65:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  sub    $0x18,%rbx
  cmp    %r13,%rbx
  jne    L65
L22:
  add    $0x1,%r12
  addq   $0x14,0x18(%rsp)
  addq   $0x1c,0x20(%rsp)
  mov    0x14(%rsp),%eax
  cmp    %eax,%r15d
  cmovle %r15d,%eax
  mov    0x4(%rsp),%r14d
  cmp    %eax,%r14d
  jge    L72
L36:
  mov    0x10(%rsp),%eax
  sub    %r14d,%eax
  cmp    %eax,%r14d
  jge    L67
  lea    (%r14,%r14,1),%eax
  neg    %eax
  mov    0x10(%rsp),%ecx
  lea    -0x1(%rcx,%rax,1),%eax
  add    %r12,%rax
  lea    (%r12,%r12,2),%rdx
  mov    0x8(%rsp),%rcx
  lea    0x4(%rcx,%rdx,8),%rdx
  lea    (%rdx,%rax,4),%r13
  mov    0x20(%rsp),%rbx
L8:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  add    $0x4,%rbx
  cmp    %r13,%rbx
  jne    L8
L67:
  lea    0x1(%r14),%eax
  mov    %eax,0x4(%rsp)
  cmp    %r15d,%eax
  jge    L122
  lea    -0x2(%r15),%eax
  sub    %r12d,%eax
  add    %r12,%rax
  lea    (%rax,%rax,2),%rdx
  mov    0x28(%rsp),%rax
  sub    %r12,%rax
  lea    (%rax,%rdx,2),%rax
  mov    0x8(%rsp),%rcx
  lea    0x2c(%rcx,%rax,4),%r13
  mov    0x18(%rsp),%rbx
L35:
  mov    (%rbx),%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  add    $0x18,%rbx
  cmp    %r13,%rbx
  jne    L35
  mov    0x10(%rsp),%eax
  mov    %eax,%ecx
  mov    0x4(%rsp),%edx
  sub    %edx,%ecx
  mov    %ecx,0x14(%rsp)
  lea    -0x1(%rax),%ebx
  sub    %edx,%ebx
  cmp    %ebx,%r14d
  jg     L23
  movslq %r15d,%rax
  lea    (%rax,%rax,2),%rax
  mov    0x8(%rsp),%rcx
  lea    -0x18(%rcx,%rax,8),%r13
  movslq %ebx,%rbx
L25:
  mov    0x0(%r13,%rbx,4),%esi
  mov    %rbp,%rdi
  call   <printf@plt>
  sub    $0x1,%rbx
  cmp    %r12d,%ebx
  jge    L25
L23:
  sub    $0x1,%r15d
L79:
  cmp    %r14d,0x14(%rsp)
  jg     L14
L72:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L122:
  mov    0x10(%rsp),%eax
  sub    0x4(%rsp),%eax
  mov    %eax,0x14(%rsp)
  jmp    L79
```

tool_calls: name: parse_data
arguments: data_label: D4
type_guessed: string

tool: D4: %d 

assistant: ```c
void spiralPrint(int m, int n, int a[3][6]) {
  int i, k = 0, l = 0;
  while (k < m && l < n) {
    for (i = l; i < n; ++i) {
      printf("%d ", a[k][i]);
    }
    k++;
    for (i = k; i < m; ++i) {
      printf("%d ", a[i][n - 1]);
    }
    n--;
    if (k < m) {
      for (i = n - 1; i >= l; --i) {
        printf("%d ", a[m - 1][i]);
      }
      m--;
    }
    if (l < n) {
      for (i = m - 1; i >= k; --i) {
        printf("%d ", a[i][l]);
      }
      l++;
    }
  }
}
```