user: Please show me the C implementation that matches the assembly code listed below:

```asm
<transpose>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  mov    %edx,%ebx
  sub    $0x658,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x648(%rsp)
  xor    %eax,%eax
  test   %esi,%esi
  jle    L174
  test   %edx,%edx
  jle    L126
  mov    %edx,%r10d
  mov    %edx,%r11d
  mov    %rdi,%rcx
  mov    %rsp,%rax
  lea    -0x1(%rdx),%r12d
  shr    $0x2,%r10d
  and    $0xfffffffc,%r11d
  xor    %edi,%edi
  nopw   0x0(%rax,%rax,1)
L136:
  cmp    $0x2,%r12d
  jbe    L160
  movdqu (%rcx),%xmm0
  pshufd $0x55,%xmm0,%xmm1
  movd   %xmm0,(%rax)
  movd   %xmm1,0x50(%rax)
  movdqa %xmm0,%xmm1
  punpckhdq %xmm0,%xmm1
  pshufd $0xff,%xmm0,%xmm0
  movd   %xmm1,0xa0(%rax)
  movd   %xmm0,0xf0(%rax)
  cmp    $0x1,%r10d
  jbe    L186
  movdqu 0x10(%rcx),%xmm0
  pshufd $0x55,%xmm0,%xmm1
  movd   %xmm0,0x140(%rax)
  movd   %xmm1,0x190(%rax)
  movdqa %xmm0,%xmm1
  punpckhdq %xmm0,%xmm1
  pshufd $0xff,%xmm0,%xmm0
  movd   %xmm1,0x1e0(%rax)
  movd   %xmm0,0x230(%rax)
  cmp    $0x2,%r10d
  je     L186
  movdqu 0x20(%rcx),%xmm0
  pshufd $0x55,%xmm0,%xmm1
  movd   %xmm0,0x280(%rax)
  movd   %xmm1,0x2d0(%rax)
  movdqa %xmm0,%xmm1
  punpckhdq %xmm0,%xmm1
  pshufd $0xff,%xmm0,%xmm0
  movd   %xmm1,0x320(%rax)
  movd   %xmm0,0x370(%rax)
  cmp    $0x3,%r10d
  je     L186
  movdqu 0x30(%rcx),%xmm0
  pshufd $0x55,%xmm0,%xmm1
  movd   %xmm0,0x3c0(%rax)
  movd   %xmm1,0x410(%rax)
  movdqa %xmm0,%xmm1
  punpckhdq %xmm0,%xmm1
  pshufd $0xff,%xmm0,%xmm0
  movd   %xmm1,0x460(%rax)
  movd   %xmm0,0x4b0(%rax)
  cmp    $0x4,%r10d
  je     L186
  movdqu 0x40(%rcx),%xmm0
  pshufd $0x55,%xmm0,%xmm1
  movd   %xmm0,0x500(%rax)
  movd   %xmm1,0x550(%rax)
  movdqa %xmm0,%xmm1
  punpckhdq %xmm0,%xmm1
  pshufd $0xff,%xmm0,%xmm0
  movd   %xmm1,0x5a0(%rax)
  movd   %xmm0,0x5f0(%rax)
L186:
  mov    %r11d,%edx
  cmp    %ebx,%r11d
  je     L179
L167:
  movslq %edx,%rbp
  movslq %edi,%r9
  lea    0x0(,%rbp,4),%rsi
  lea    (%rcx,%rsi,1),%r8
  add    %rbp,%rsi
  mov    (%r8),%ebp
  lea    (%r9,%rsi,4),%rsi
  mov    %ebp,(%rsp,%rsi,4)
  lea    0x1(%rdx),%esi
  cmp    %ebx,%esi
  jge    L179
  movslq %esi,%rsi
  mov    0x4(%r8),%ebp
  add    $0x2,%edx
  lea    (%rsi,%rsi,4),%rsi
  lea    (%r9,%rsi,4),%rsi
  mov    %ebp,(%rsp,%rsi,4)
  cmp    %edx,%ebx
  jle    L179
  movslq %edx,%rdx
  mov    0x8(%r8),%esi
  lea    (%rdx,%rdx,4),%rdx
  lea    (%r9,%rdx,4),%rdx
  mov    %esi,(%rsp,%rdx,4)
L179:
  add    $0x1,%edi
  add    $0x50,%rcx
  add    $0x4,%rax
  cmp    %edi,%r13d
  jne    L136
  lea    D16(%rip),%rdi
  call   <puts@plt>
L104:
  lea    -0x1(%r13),%edx
  lea    (%r12,%r12,4),%rcx
  mov    $0xfffffffffffffffc,%r14
  lea    0x0(,%rdx,4),%rax
  lea    (%rdx,%rcx,4),%rdx
  lea    0x4(%rsp,%rax,1),%rbp
  lea    0x54(%rsp,%rdx,4),%r15
  sub    %rax,%r14
  lea    D4(%rip),%r12
  nopl   (%rax)
L143:
  lea    (%r14,%rbp,1),%rbx
  test   %r13d,%r13d
  jle    L84
  nopl   0x0(%rax)
L78:
  mov    (%rbx),%esi
  mov    %r12,%rdi
  xor    %eax,%eax
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    %rbp,%rbx
  jne    L78
L84:
  mov    $0xa,%edi
  add    $0x50,%rbp
  call   <putchar@plt>
  cmp    %r15,%rbp
  jne    L143
L157:
  mov    0x648(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L122
  add    $0x658,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L160:
  xor    %edx,%edx
  jmp    L167
L174:
  lea    D16(%rip),%rdi
  call   <puts@plt>
  test   %ebx,%ebx
  jle    L157
  lea    -0x1(%rbx),%r12d
  jmp    L104
L126:
  mov    0x648(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L122
  add    $0x658,%rsp
  lea    D16(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <puts@plt>
L122:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D16
type: string
name: retrieve_data
arguments: data_tag: D4
type: string

tool: D16: 
Transpose of first matrix:

tool: D4: %d 

assistant: ```c
void transpose(int a[20][20], int r, int s) {
  int c[20][20];
  int i, j;
  for (i = 0; i < r; i++) {
    for (j = 0; j < s; j++) {
      c[j][i] = a[i][j];
    }
  }
  printf("\nTranspose of first matrix:\n");
  for (i = 0; i < s; i++) {
    for (j = 0; j < r; j++)
      printf("%d ", c[i][j]);
    printf("\n");
  }
}
```