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

```asm
<swapbytes>:
  endbr64
  mov    %rdi,%rax
  mov    %edx,%ecx
  test   $0x4,%sil
  jne    L115
  test   $0x2,%sil
  jne    L177
  test   $0x1,%sil
  jne    L338
  and    $0x8,%esi
  je     L491
  lea    -0x1(%rdx),%esi
  test   %edx,%edx
  je     L338
  cmp    $0xe,%esi
  jbe    L383
  mov    %rdi,%rdx
  mov    %ecx,%edi
  movdqa D46(%rip),%xmm0
  shr    $0x4,%edi
  sub    $0x1,%edi
  shl    $0x7,%rdi
  lea    0x80(%rax,%rdi,1),%rdi
  nopl   0x0(%rax,%rax,1)
L432:
  movdqu (%rdx),%xmm1
  movdqu 0x10(%rdx),%xmm2
  movdqa %xmm0,%xmm10
  sub    $0xffffffffffffff80,%rdx
  movdqu -0x70(%rdx),%xmm3
  movdqu -0x60(%rdx),%xmm8
  pand   %xmm0,%xmm2
  pand   %xmm0,%xmm1
  movdqu -0x60(%rdx),%xmm7
  movdqu -0x40(%rdx),%xmm5
  packuswb %xmm2,%xmm1
  movdqu -0x80(%rdx),%xmm2
  psrlw  $0x8,%xmm3
  pand   %xmm0,%xmm8
  psrlw  $0x8,%xmm7
  pand   %xmm0,%xmm5
  movdqu -0x30(%rdx),%xmm4
  movdqu -0x10(%rdx),%xmm6
  psrlw  $0x8,%xmm2
  movdqu -0x10(%rdx),%xmm9
  pand   %xmm1,%xmm10
  packuswb %xmm3,%xmm2
  movdqu -0x50(%rdx),%xmm3
  psrlw  $0x8,%xmm4
  pand   %xmm0,%xmm6
  psrlw  $0x8,%xmm9
  psrlw  $0x8,%xmm1
  pand   %xmm0,%xmm3
  packuswb %xmm3,%xmm8
  movdqu -0x50(%rdx),%xmm3
  psrlw  $0x8,%xmm3
  packuswb %xmm3,%xmm7
  movdqu -0x30(%rdx),%xmm3
  pand   %xmm0,%xmm3
  packuswb %xmm3,%xmm5
  movdqu -0x40(%rdx),%xmm3
  psrlw  $0x8,%xmm3
  packuswb %xmm4,%xmm3
  movdqu -0x20(%rdx),%xmm4
  pand   %xmm0,%xmm4
  packuswb %xmm6,%xmm4
  movdqu -0x20(%rdx),%xmm6
  psrlw  $0x8,%xmm6
  packuswb %xmm9,%xmm6
  movdqa %xmm0,%xmm9
  pand   %xmm8,%xmm9
  psrlw  $0x8,%xmm8
  packuswb %xmm9,%xmm10
  packuswb %xmm8,%xmm1
  movdqa %xmm0,%xmm9
  movdqa %xmm0,%xmm8
  pand   %xmm4,%xmm9
  pand   %xmm5,%xmm8
  psrlw  $0x8,%xmm4
  psrlw  $0x8,%xmm5
  packuswb %xmm9,%xmm8
  movdqa %xmm0,%xmm9
  packuswb %xmm4,%xmm5
  movdqa %xmm0,%xmm4
  pand   %xmm7,%xmm9
  pand   %xmm2,%xmm4
  psrlw  $0x8,%xmm7
  psrlw  $0x8,%xmm2
  packuswb %xmm9,%xmm4
  movdqa %xmm0,%xmm9
  packuswb %xmm7,%xmm2
  movdqa %xmm0,%xmm7
  pand   %xmm3,%xmm9
  pand   %xmm6,%xmm7
  psrlw  $0x8,%xmm3
  psrlw  $0x8,%xmm6
  packuswb %xmm7,%xmm9
  movdqa %xmm0,%xmm7
  packuswb %xmm6,%xmm3
  movdqa %xmm0,%xmm6
  pand   %xmm10,%xmm7
  pand   %xmm8,%xmm6
  psrlw  $0x8,%xmm8
  packuswb %xmm6,%xmm7
  movdqa %xmm10,%xmm6
  movdqa %xmm0,%xmm10
  psrlw  $0x8,%xmm6
  pand   %xmm9,%xmm10
  packuswb %xmm8,%xmm6
  psrlw  $0x8,%xmm9
  movdqa %xmm0,%xmm8
  pand   %xmm4,%xmm8
  psrlw  $0x8,%xmm4
  movdqa %xmm6,%xmm11
  packuswb %xmm10,%xmm8
  packuswb %xmm9,%xmm4
  movdqa %xmm0,%xmm10
  movdqa %xmm0,%xmm9
  pand   %xmm5,%xmm10
  punpcklbw %xmm7,%xmm11
  pand   %xmm1,%xmm9
  psrlw  $0x8,%xmm5
  punpckhbw %xmm7,%xmm6
  psrlw  $0x8,%xmm1
  packuswb %xmm10,%xmm9
  movdqa %xmm0,%xmm10
  packuswb %xmm5,%xmm1
  movdqa %xmm0,%xmm5
  pand   %xmm3,%xmm10
  pand   %xmm2,%xmm5
  psrlw  $0x8,%xmm3
  psrlw  $0x8,%xmm2
  packuswb %xmm10,%xmm5
  packuswb %xmm3,%xmm2
  movdqa %xmm1,%xmm3
  punpckhbw %xmm9,%xmm1
  movdqa %xmm2,%xmm10
  punpcklbw %xmm9,%xmm3
  movdqa %xmm4,%xmm9
  punpcklbw %xmm5,%xmm10
  punpcklbw %xmm8,%xmm9
  punpckhbw %xmm5,%xmm2
  movdqa %xmm10,%xmm5
  punpckhbw %xmm8,%xmm4
  movdqa %xmm3,%xmm7
  punpcklbw %xmm9,%xmm5
  movdqa %xmm2,%xmm8
  punpcklbw %xmm11,%xmm7
  punpcklbw %xmm4,%xmm8
  punpckhbw %xmm4,%xmm2
  movdqa %xmm5,%xmm4
  punpckhbw %xmm9,%xmm10
  punpcklbw %xmm7,%xmm4
  punpckhbw %xmm11,%xmm3
  movups %xmm4,-0x80(%rdx)
  movdqa %xmm10,%xmm4
  movdqa %xmm1,%xmm9
  punpckhbw %xmm6,%xmm1
  punpcklbw %xmm3,%xmm4
  punpcklbw %xmm6,%xmm9
  punpckhbw %xmm7,%xmm5
  movups %xmm4,-0x60(%rdx)
  movdqa %xmm10,%xmm4
  punpckhbw %xmm3,%xmm4
  movdqa %xmm8,%xmm3
  movups %xmm5,-0x70(%rdx)
  punpcklbw %xmm9,%xmm3
  movups %xmm4,-0x50(%rdx)
  movups %xmm3,-0x40(%rdx)
  movdqa %xmm8,%xmm3
  punpckhbw %xmm9,%xmm3
  movups %xmm3,-0x30(%rdx)
  movdqa %xmm2,%xmm3
  punpckhbw %xmm1,%xmm2
  punpcklbw %xmm1,%xmm3
  movups %xmm2,-0x10(%rdx)
  movups %xmm3,-0x20(%rdx)
  cmp    %rdx,%rdi
  jne    L432
  mov    %ecx,%edx
  and    $0xfffffff0,%edx
  mov    %edx,%edi
  sub    %edx,%esi
  lea    (%rax,%rdi,8),%rax
  cmp    %edx,%ecx
  je     L338
L383:
  mov    (%rax),%rdx
  bswap  %rdx
  mov    %rdx,(%rax)
  test   %esi,%esi
  je     L338
  mov    0x8(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x8(%rax)
  cmp    $0x1,%esi
  je     L338
  mov    0x10(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x10(%rax)
  cmp    $0x2,%esi
  je     L338
  mov    0x18(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x18(%rax)
  cmp    $0x3,%esi
  je     L338
  mov    0x20(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x20(%rax)
  cmp    $0x4,%esi
  je     L338
  mov    0x28(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x28(%rax)
  cmp    $0x5,%esi
  je     L338
  mov    0x30(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x30(%rax)
  cmp    $0x6,%esi
  je     L338
  mov    0x38(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x38(%rax)
  cmp    $0x7,%esi
  je     L338
  mov    0x40(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x40(%rax)
  cmp    $0x8,%esi
  je     L338
  mov    0x48(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x48(%rax)
  cmp    $0x9,%esi
  je     L338
  mov    0x50(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x50(%rax)
  cmp    $0xa,%esi
  je     L338
  mov    0x58(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x58(%rax)
  cmp    $0xb,%esi
  je     L338
  mov    0x60(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x60(%rax)
  cmp    $0xc,%esi
  je     L338
  mov    0x68(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x68(%rax)
  cmp    $0xd,%esi
  je     L338
  mov    0x70(%rax),%rdx
  bswap  %rdx
  mov    %rdx,0x70(%rax)
  ret
  nopw   0x0(%rax,%rax,1)
L177:
  lea    -0x1(%rdx),%esi
  test   %edx,%edx
  je     L338
  cmp    $0xe,%esi
  jbe    L513
  mov    %rdi,%rdx
  mov    %ecx,%edi
  movdqa D46(%rip),%xmm0
  shr    $0x4,%edi
  sub    $0x1,%edi
  shl    $0x5,%rdi
  lea    0x20(%rax,%rdi,1),%rdi
  nopl   0x0(%rax)
L316:
  movdqu (%rdx),%xmm2
  movdqu 0x10(%rdx),%xmm1
  add    $0x20,%rdx
  movdqu -0x10(%rdx),%xmm3
  pand   %xmm0,%xmm1
  pand   %xmm0,%xmm2
  packuswb %xmm1,%xmm2
  movdqu -0x20(%rdx),%xmm1
  psrlw  $0x8,%xmm3
  psrlw  $0x8,%xmm1
  packuswb %xmm3,%xmm1
  movdqa %xmm1,%xmm3
  punpckhbw %xmm2,%xmm1
  punpcklbw %xmm2,%xmm3
  movups %xmm1,-0x10(%rdx)
  movups %xmm3,-0x20(%rdx)
  cmp    %rdi,%rdx
  jne    L316
  mov    %ecx,%edx
  and    $0xfffffff0,%edx
  mov    %edx,%edi
  sub    %edx,%esi
  lea    (%rax,%rdi,2),%rax
  cmp    %edx,%ecx
  je     L338
L513:
  rolw   $0x8,(%rax)
  test   %esi,%esi
  je     L338
  rolw   $0x8,0x2(%rax)
  cmp    $0x1,%esi
  je     L338
  rolw   $0x8,0x4(%rax)
  cmp    $0x2,%esi
  je     L338
  rolw   $0x8,0x6(%rax)
  cmp    $0x3,%esi
  je     L338
  rolw   $0x8,0x8(%rax)
  cmp    $0x4,%esi
  je     L338
  rolw   $0x8,0xa(%rax)
  cmp    $0x5,%esi
  je     L338
  rolw   $0x8,0xc(%rax)
  cmp    $0x6,%esi
  je     L338
  rolw   $0x8,0xe(%rax)
  cmp    $0x7,%esi
  je     L338
  rolw   $0x8,0x10(%rax)
  cmp    $0x8,%esi
  je     L338
  rolw   $0x8,0x12(%rax)
  cmp    $0x9,%esi
  je     L338
  rolw   $0x8,0x14(%rax)
  cmp    $0xa,%esi
  je     L338
  rolw   $0x8,0x16(%rax)
  cmp    $0xb,%esi
  je     L338
  rolw   $0x8,0x18(%rax)
  cmp    $0xc,%esi
  je     L338
  rolw   $0x8,0x1a(%rax)
  cmp    $0xd,%esi
  je     L338
  rolw   $0x8,0x1c(%rax)
  ret
  nop
L115:
  lea    -0x1(%rdx),%esi
  test   %edx,%edx
  je     L338
  cmp    $0xe,%esi
  jbe    L104
  mov    %rdi,%rdx
  mov    %ecx,%edi
  movdqa D46(%rip),%xmm0
  shr    $0x4,%edi
  sub    $0x1,%edi
  shl    $0x6,%rdi
  lea    0x40(%rax,%rdi,1),%rdi
L356:
  movdqu (%rdx),%xmm2
  movdqu 0x10(%rdx),%xmm1
  movdqa %xmm0,%xmm6
  add    $0x40,%rdx
  movdqu -0x30(%rdx),%xmm3
  movdqu -0x20(%rdx),%xmm4
  pand   %xmm0,%xmm1
  pand   %xmm0,%xmm2
  movdqu -0x10(%rdx),%xmm5
  packuswb %xmm1,%xmm2
  movdqu -0x40(%rdx),%xmm1
  psrlw  $0x8,%xmm3
  pand   %xmm0,%xmm4
  psrlw  $0x8,%xmm5
  psrlw  $0x8,%xmm1
  packuswb %xmm3,%xmm1
  movdqu -0x10(%rdx),%xmm3
  pand   %xmm0,%xmm3
  packuswb %xmm3,%xmm4
  movdqu -0x20(%rdx),%xmm3
  pand   %xmm4,%xmm6
  psrlw  $0x8,%xmm4
  psrlw  $0x8,%xmm3
  packuswb %xmm5,%xmm3
  movdqa %xmm0,%xmm5
  pand   %xmm2,%xmm5
  psrlw  $0x8,%xmm2
  packuswb %xmm6,%xmm5
  packuswb %xmm4,%xmm2
  movdqa %xmm0,%xmm6
  movdqa %xmm0,%xmm4
  pand   %xmm3,%xmm6
  pand   %xmm1,%xmm4
  psrlw  $0x8,%xmm3
  psrlw  $0x8,%xmm1
  packuswb %xmm6,%xmm4
  packuswb %xmm3,%xmm1
  movdqa %xmm1,%xmm3
  punpckhbw %xmm4,%xmm1
  punpcklbw %xmm4,%xmm3
  movdqa %xmm2,%xmm4
  punpckhbw %xmm5,%xmm2
  punpcklbw %xmm5,%xmm4
  movdqa %xmm3,%xmm5
  punpckhbw %xmm4,%xmm3
  punpcklbw %xmm4,%xmm5
  movups %xmm3,-0x30(%rdx)
  movdqa %xmm1,%xmm3
  punpckhbw %xmm2,%xmm1
  punpcklbw %xmm2,%xmm3
  movups %xmm5,-0x40(%rdx)
  movups %xmm3,-0x20(%rdx)
  movups %xmm1,-0x10(%rdx)
  cmp    %rdx,%rdi
  jne    L356
  mov    %ecx,%edx
  and    $0xfffffff0,%edx
  mov    %edx,%edi
  sub    %edx,%esi
  lea    (%rax,%rdi,4),%rax
  cmp    %edx,%ecx
  je     L338
L104:
  movzbl 0x3(%rax),%edx
  movzbl (%rax),%ecx
  rolw   $0x8,0x1(%rax)
  mov    %cl,0x3(%rax)
  mov    %dl,(%rax)
  test   %esi,%esi
  je     L338
  movzbl 0x7(%rax),%edx
  movzbl 0x4(%rax),%ecx
  rolw   $0x8,0x5(%rax)
  mov    %cl,0x7(%rax)
  mov    %dl,0x4(%rax)
  cmp    $0x1,%esi
  je     L338
  movzbl 0xb(%rax),%edx
  movzbl 0x8(%rax),%ecx
  rolw   $0x8,0x9(%rax)
  mov    %cl,0xb(%rax)
  mov    %dl,0x8(%rax)
  cmp    $0x2,%esi
  je     L338
  movzbl 0xf(%rax),%edx
  movzbl 0xc(%rax),%ecx
  rolw   $0x8,0xd(%rax)
  mov    %cl,0xf(%rax)
  mov    %dl,0xc(%rax)
  cmp    $0x3,%esi
  jne    L559
L338:
  ret
  nopl   0x0(%rax,%rax,1)
L559:
  movzbl 0x13(%rax),%edx
  movzbl 0x10(%rax),%ecx
  rolw   $0x8,0x11(%rax)
  mov    %cl,0x13(%rax)
  mov    %dl,0x10(%rax)
  cmp    $0x4,%esi
  je     L338
  movzbl 0x17(%rax),%edx
  movzbl 0x14(%rax),%ecx
  rolw   $0x8,0x15(%rax)
  mov    %cl,0x17(%rax)
  mov    %dl,0x14(%rax)
  cmp    $0x5,%esi
  je     L338
  movzbl 0x1b(%rax),%edx
  movzbl 0x18(%rax),%ecx
  rolw   $0x8,0x19(%rax)
  mov    %cl,0x1b(%rax)
  mov    %dl,0x18(%rax)
  cmp    $0x6,%esi
  je     L338
  movzbl 0x1f(%rax),%edx
  movzbl 0x1c(%rax),%ecx
  rolw   $0x8,0x1d(%rax)
  mov    %cl,0x1f(%rax)
  mov    %dl,0x1c(%rax)
  cmp    $0x7,%esi
  je     L338
  movzbl 0x23(%rax),%edx
  movzbl 0x20(%rax),%ecx
  rolw   $0x8,0x21(%rax)
  mov    %cl,0x23(%rax)
  mov    %dl,0x20(%rax)
  cmp    $0x8,%esi
  je     L338
  movzbl 0x27(%rax),%edx
  movzbl 0x24(%rax),%ecx
  rolw   $0x8,0x25(%rax)
  mov    %cl,0x27(%rax)
  mov    %dl,0x24(%rax)
  cmp    $0x9,%esi
  je     L338
  movzbl 0x2b(%rax),%edx
  movzbl 0x28(%rax),%ecx
  rolw   $0x8,0x29(%rax)
  mov    %cl,0x2b(%rax)
  mov    %dl,0x28(%rax)
  cmp    $0xa,%esi
  je     L338
  movzbl 0x2f(%rax),%edx
  movzbl 0x2c(%rax),%ecx
  rolw   $0x8,0x2d(%rax)
  mov    %cl,0x2f(%rax)
  mov    %dl,0x2c(%rax)
  cmp    $0xb,%esi
  je     L338
  movzbl 0x33(%rax),%edx
  movzbl 0x30(%rax),%ecx
  rolw   $0x8,0x31(%rax)
  mov    %cl,0x33(%rax)
  mov    %dl,0x30(%rax)
  cmp    $0xc,%esi
  je     L338
  movzbl 0x37(%rax),%edx
  movzbl 0x34(%rax),%ecx
  rolw   $0x8,0x35(%rax)
  mov    %cl,0x37(%rax)
  mov    %dl,0x34(%rax)
  cmp    $0xd,%esi
  je     L338
  movzbl 0x3b(%rax),%edx
  movzbl 0x38(%rax),%ecx
  rolw   $0x8,0x39(%rax)
  mov    %cl,0x3b(%rax)
  mov    %dl,0x38(%rax)
  ret
  nopl   0x0(%rax,%rax,1)
L491:
  lea    D43(%rip),%rdx
  lea    D37(%rip),%rsi
  mov    $0xffffffff,%edi
  jmp    1050 <error@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D46
type_guessed: byte[16]
name: unpack_data
arguments: data_tag: D43
type_guessed: string
name: unpack_data
arguments: data_tag: D37
type_guessed: string

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

tool: D43: swapbytes()

tool: D37: *Internal Error*: Unknown size in 

assistant: ```c
void swapbytes(void *ptr, int nb, int n) {
  char *cp, c;
  int j;
  cp = (char *)ptr;
  if (nb & 4) {
    for (j = n; j--; cp += 4) {
      c = cp[3];
      cp[3] = cp[0];
      cp[0] = c;
      c = cp[2];
      cp[2] = cp[1];
      cp[1] = c;
    }
    return;
  }
  if (nb & 2) {
    for (j = n; j--; cp += 2) {
      c = cp[1];
      cp[1] = cp[0];
      cp[0] = c;
    }
    return;
  }
  if (nb & 1)
    return;
  if (nb & 8) {
    for (j = n; j--; cp += 8) {
      c = cp[7];
      cp[7] = cp[0];
      cp[0] = c;
      c = cp[6];
      cp[6] = cp[1];
      cp[1] = c;
      c = cp[5];
      cp[5] = cp[2];
      cp[2] = c;
      c = cp[4];
      cp[4] = cp[3];
      cp[3] = c;
    }
    return;
  }
  error(-1, "*Internal Error*: Unknown size in ", "swapbytes()");
  return;
}
```