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

```asm
<spiral_print_mat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %edx,-0x50(%rbp)
  mov    -0x4c(%rbp),%eax
  imul   -0x50(%rbp),%eax
  mov    %eax,-0x34(%rbp)
  movl   $0x0,-0x30(%rbp)
  movl   $0x0,-0x2c(%rbp)
  movl   $0x0,-0x28(%rbp)
  mov    -0x50(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x50(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    $0x5b,%edi
  call   <putchar@plt>
L88:
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  jmp    L62
L133:
  mov    -0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  subl   $0x1,-0x34(%rbp)
  addl   $0x1,-0x10(%rbp)
L62:
  mov    -0x10(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jle    L133
  cmpl   $0x0,-0x34(%rbp)
  je     L116
  addl   $0x1,-0x30(%rbp)
  addl   $0x1,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L21
L99:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  subl   $0x1,-0x34(%rbp)
  addl   $0x1,-0xc(%rbp)
L21:
  mov    -0xc(%rbp),%eax
  cmp    -0x20(%rbp),%eax
  jle    L99
  cmpl   $0x0,-0x34(%rbp)
  je     L58
  subl   $0x1,-0x24(%rbp)
  subl   $0x1,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,-0x8(%rbp)
  jmp    L48
L37:
  mov    -0x20(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  subl   $0x1,-0x34(%rbp)
  subl   $0x1,-0x8(%rbp)
L48:
  mov    -0x8(%rbp),%eax
  cmp    -0x14(%rbp),%eax
  jge    L37
  cmpl   $0x0,-0x34(%rbp)
  je     L44
  subl   $0x1,-0x20(%rbp)
  subl   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L126
L18:
  mov    -0x4(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,%esi
  lea    D19(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  subl   $0x1,-0x34(%rbp)
  subl   $0x1,-0x4(%rbp)
L126:
  mov    -0x4(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jge    L18
  cmpl   $0x0,-0x34(%rbp)
  je     L124
  addl   $0x1,-0x2c(%rbp)
  addl   $0x1,-0x14(%rbp)
  jmp    L88
L116:
  nop
  jmp    L40
L58:
  nop
  jmp    L40
L44:
  nop
  jmp    L40
L124:
  nop
L40:
  lea    D34(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D19
type_guessed: string
name: extract_symbolic_data
arguments: data_label: D34
type_guessed: string

tool: D19: %d 

tool: D34: ]

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