user: 请将以下的汇编代码转换成C语言代码:

```asm
<spiral_print_mat>:
  endbr64
  push   %r15
  mov    %esi,%eax
  lea    -0x1(%rdx),%r15d
  push   %r14
  sub    $0x1,%eax
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  imul   %edx,%r12d
  mov    $0x5b,%edi
  push   %rbx
  mov    %eax,%ebx
  sub    $0x48,%rsp
  mov    %edx,0x2c(%rsp)
  mov    %r15d,0xc(%rsp)
  mov    %esi,0x3c(%rsp)
  mov    %eax,0x38(%rsp)
  call   <putchar@plt>
  movslq %ebx,%rdx
  movslq %r15d,%rax
  movl   $0x0,0x8(%rsp)
  mov    %rdx,0x10(%rsp)
  xor    %r15d,%r15d
  lea    D12(%rip),%rbx
  mov    %edx,0x28(%rsp)
  mov    0xc(%rsp),%edx
  mov    %rax,0x18(%rsp)
  cmp    %edx,0x8(%rsp)
  jg     L63
  cs nopw 0x0(%rax,%rax,1)
L46:
  lea    0x0(,%r15,4),%r13
  mov    %r15,%rdx
  mov    %rbp,%rax
  mov    %r12d,%r14d
  mov    %r13,%r15
  mov    %r12d,%ebp
  mov    %rdx,%r13
  mov    %rax,%r12
  nopl   (%rax)
L24:
  mov    (%r12,%r13,8),%rax
  mov    %rbx,%rdi
  sub    $0x1,%r14d
  mov    (%rax,%r15,1),%esi
  xor    %eax,%eax
  add    $0x4,%r15
  call   <printf@plt>
  mov    %ebp,%eax
  sub    %r14d,%eax
  add    0x8(%rsp),%eax
  cmp    %eax,0xc(%rsp)
  jge    L24
  mov    %r13,%r15
  mov    %r12,%rbp
  test   %r14d,%r14d
  je     L93
L122:
  addl   $0x1,0x8(%rsp)
  mov    0x10(%rsp),%rdx
  mov    0x8(%rsp),%eax
  mov    %edx,%r12d
  cmp    %edx,%eax
  jg     L148
  mov    0x18(%rsp),%rcx
  add    %r15d,%r14d
  mov    %r15,0x20(%rsp)
  movslq %eax,%r13
  mov    %rbp,%r15
  mov    %r14d,%ebp
  lea    0x0(,%rcx,4),%rdx
  mov    %rdx,%r14
  nopw   0x0(%rax,%rax,1)
L21:
  mov    (%r15,%r13,8),%rax
  mov    %rbx,%rdi
  mov    (%rax,%r14,1),%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %ebp,%eax
  sub    %r13d,%eax
  add    $0x1,%r13
  cmp    %r13d,%r12d
  jge    L21
  mov    %r15,%rbp
  mov    %eax,%r12d
  mov    0x20(%rsp),%r15
  test   %eax,%eax
  je     L93
L132:
  subl   $0x1,0xc(%rsp)
  mov    0xc(%rsp),%eax
  cmp    %r15d,%eax
  jl     L0
  movslq %eax,%r14
  mov    0x8(%rsp),%eax
  mov    0x2c(%rsp),%edx
  mov    %r12d,0x20(%rsp)
  mov    %rbp,%r12
  mov    0x10(%rsp),%rbp
  shl    $0x2,%r14
  neg    %eax
  lea    (%rdx,%rax,2),%edx
  mov    0x18(%rsp),%rax
  sub    %rdx,%rax
  lea    -0x8(,%rax,4),%r13
  nopw   0x0(%rax,%rax,1)
L14:
  mov    (%r12,%rbp,8),%rax
  mov    %rbx,%rdi
  mov    (%rax,%r14,1),%esi
  xor    %eax,%eax
  sub    $0x4,%r14
  call   <printf@plt>
  cmp    %r14,%r13
  jne    L14
  mov    %r12,%rbp
  mov    0x20(%rsp),%r12d
  mov    0x2c(%rsp),%eax
  sub    0x3c(%rsp),%eax
  add    0x28(%rsp),%eax
  sub    %eax,%r12d
  je     L93
L0:
  mov    0x38(%rsp),%eax
  mov    0x8(%rsp),%edx
  sub    %edx,%eax
  cmp    %eax,%edx
  jg     L106
  cltq
  lea    0x0(,%r15,4),%rcx
  mov    %rbp,0x30(%rsp)
  lea    0x0(%rbp,%rax,8),%r14
  mov    0x10(%rsp),%rax
  lea    -0x10(%rbp,%rax,8),%r13
  mov    0x28(%rsp),%eax
  mov    %r14,%rbp
  mov    %rcx,%r14
  sub    $0x2,%eax
  mov    %eax,0x20(%rsp)
  shl    $0x3,%rax
  sub    %rax,%r13
L85:
  mov    0x0(%rbp),%rax
  mov    %rbx,%rdi
  sub    $0x8,%rbp
  mov    (%rax,%r14,1),%esi
  xor    %eax,%eax
  call   <printf@plt>
  cmp    %r13,%rbp
  jne    L85
  sub    0x28(%rsp),%r12d
  mov    0x30(%rsp),%rbp
  add    $0x1,%r12d
  je     L93
L23:
  mov    0x20(%rsp),%eax
  subq   $0x1,0x10(%rsp)
  add    $0x1,%r15
  subq   $0x1,0x18(%rsp)
  mov    0xc(%rsp),%edx
  mov    %eax,0x28(%rsp)
  cmp    %edx,0x8(%rsp)
  jle    L46
L63:
  mov    %r12d,%r14d
  test   %r14d,%r14d
  jne    L122
L93:
  add    $0x48,%rsp
  lea    D11(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1080 <puts@plt>
  nopw   0x0(%rax,%rax,1)
L148:
  mov    %r14d,%r12d
  jmp    L132
  nopl   0x0(%rax,%rax,1)
L106:
  mov    0x28(%rsp),%eax
  sub    $0x2,%eax
  mov    %eax,0x20(%rsp)
  jmp    L23
```

tool_calls: name: disassemble_data
arguments: tag: D12
datatype: string
name: disassemble_data
arguments: tag: D11
datatype: string

tool: D12: %d 

tool: D11: ]

assistant: ```c
void spiral_print_mat(int **xs, int r, int c) {
  int n = r * c;
  int nwx = 0, nwy = 0, nex = 0, ney = c - 1, sex = r - 1, sey = c - 1, swx = r - 1, swy = 0;
  printf("[");
  while (1) {
    for (int j = nwy; j <= ney; j++) {
      printf("%d ", xs[nwx][j]);
      n--;
    }
    if (n == 0)
      break;
    nwx++;
    nex++;
    for (int i = nex; i <= sex; i++) {
      printf("%d ", xs[i][ney]);
      n--;
    }
    if (n == 0)
      break;
    ney--;
    sey--;
    for (int j = sey; j >= swy; j--) {
      printf("%d ", xs[sex][j]);
      n--;
    }
    if (n == 0)
      break;
    sex--;
    swx--;
    for (int i = swx; i >= nwx; i--) {
      printf("%d ", xs[i][swy]);
      n--;
    }
    if (n == 0)
      break;
    nwy++;
    swy++;
  }
  printf("]\n");
}
```