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

```asm
<swapfunc>:
  endbr64
  mov    %rdi,%rax
  cmp    $0x1,%ecx
  jle    L31
  lea    0xf(%rdi),%rdi
  movslq %edx,%rcx
  sub    %rsi,%rdi
  mov    %rcx,%r9
  cmp    $0x1e,%rdi
  jbe    L47
  cmp    $0x7,%edx
  jle    L47
  test   %edx,%edx
  mov    $0x1,%r8d
  cmovg  %rcx,%r8
  cmp    $0xf,%edx
  jle    L180
  mov    %r8,%rdi
  xor    %edx,%edx
  and    $0xfffffffffffffff0,%rdi
  xchg   %ax,%ax
L186:
  movdqu (%rax,%rdx,1),%xmm0
  movdqu (%rsi,%rdx,1),%xmm1
  movups %xmm1,(%rax,%rdx,1)
  movups %xmm0,(%rsi,%rdx,1)
  add    $0x10,%rdx
  cmp    %rdx,%rdi
  jne    L186
  mov    %r8,%rdx
  and    $0xfffffffffffffff0,%rdx
  sub    %rdx,%rcx
  lea    (%rax,%rdx,1),%rdi
  mov    %rcx,%r9
  lea    (%rsi,%rdx,1),%rcx
  cmp    %rdx,%r8
  je     L60
L73:
  sub    %rdx,%r8
  lea    -0x1(%r8),%r10
  cmp    $0x6,%r10
  jbe    L182
  add    %rdx,%rax
  add    %rsi,%rdx
  mov    (%rdx),%r10
  mov    (%rax),%rsi
  mov    %r10,(%rax)
  mov    %r8,%rax
  and    $0xfffffffffffffff8,%rax
  mov    %rsi,(%rdx)
  sub    %rax,%r9
  add    %rax,%rdi
  add    %rax,%rcx
  cmp    %rax,%r8
  je     L134
L182:
  movzbl (%rdi),%eax
  movzbl (%rcx),%edx
  mov    %dl,(%rdi)
  mov    %al,(%rcx)
  lea    -0x1(%r9),%rax
  test   %rax,%rax
  jle    L134
  movzbl 0x1(%rdi),%eax
  movzbl 0x1(%rcx),%edx
  mov    %dl,0x1(%rdi)
  mov    %al,0x1(%rcx)
  cmp    $0x2,%r9
  je     L134
  movzbl 0x2(%rdi),%eax
  movzbl 0x2(%rcx),%edx
  mov    %dl,0x2(%rdi)
  mov    %al,0x2(%rcx)
  cmp    $0x3,%r9
  je     L134
  movzbl 0x3(%rdi),%eax
  movzbl 0x3(%rcx),%edx
  mov    %dl,0x3(%rdi)
  mov    %al,0x3(%rcx)
  cmp    $0x4,%r9
  je     L134
  movzbl 0x4(%rdi),%eax
  movzbl 0x4(%rcx),%edx
  mov    %dl,0x4(%rdi)
  mov    %al,0x4(%rcx)
  cmp    $0x5,%r9
  je     L134
  movzbl 0x5(%rdi),%eax
  movzbl 0x5(%rcx),%edx
  mov    %dl,0x5(%rdi)
  mov    %al,0x5(%rcx)
  cmp    $0x6,%r9
  je     L134
  movzbl 0x6(%rdi),%eax
  movzbl 0x6(%rcx),%edx
  mov    %dl,0x6(%rdi)
  mov    %al,0x6(%rcx)
  ret
  nop
L47:
  add    %rax,%rcx
  nopl   0x0(%rax,%rax,1)
L165:
  movzbl (%rax),%edx
  movzbl (%rsi),%edi
  add    $0x1,%rsi
  add    $0x1,%rax
  mov    %dil,-0x1(%rax)
  mov    %dl,-0x1(%rsi)
  mov    %rcx,%rdx
  sub    %rax,%rdx
  test   %rdx,%rdx
  jg     L165
L134:
  ret
  nopl   0x0(%rax)
L31:
  movslq %edx,%rdx
  lea    0xf(%rdi),%rdi
  shr    $0x3,%rdx
  sub    %rsi,%rdi
  mov    %rdx,%rcx
  cmp    $0x1e,%rdi
  jbe    L122
  movabs $0x7ffffffffffffffc,%rdi
  lea    -0x3(%rdx),%r8
  cmp    %rdi,%r8
  ja     L122
  test   %rdx,%rdx
  mov    $0x1,%ecx
  cmovg  %rdx,%rcx
  xor    %edx,%edx
  mov    %rcx,%rdi
  shr    %rdi
  shl    $0x4,%rdi
  nopw   0x0(%rax,%rax,1)
L164:
  movdqu (%rax,%rdx,1),%xmm0
  movdqu (%rsi,%rdx,1),%xmm2
  movups %xmm2,(%rax,%rdx,1)
  movups %xmm0,(%rsi,%rdx,1)
  add    $0x10,%rdx
  cmp    %rdi,%rdx
  jne    L164
  mov    %rcx,%rdi
  and    $0xfffffffffffffffe,%rdi
  lea    0x0(,%rdi,8),%rdx
  add    %rdx,%rax
  add    %rsi,%rdx
  cmp    %rdi,%rcx
  je     L134
  mov    (%rax),%rcx
  mov    (%rdx),%rsi
  mov    %rsi,(%rax)
  mov    %rcx,(%rdx)
  ret
  xchg   %ax,%ax
L122:
  mov    (%rax),%rdx
  mov    (%rsi),%rdi
  sub    $0x1,%rcx
  add    $0x8,%rsi
  add    $0x8,%rax
  mov    %rdi,-0x8(%rax)
  mov    %rdx,-0x8(%rsi)
  test   %rcx,%rcx
  jg     L122
  ret
L180:
  mov    %rsi,%rcx
  mov    %rax,%rdi
  xor    %edx,%edx
  jmp    L73
L60:
  ret
```

assistant: ```c
void swapfunc(char *a, char *b, int n, int swaptype) {
  if (swaptype <= 1) {
    long i = (n) / sizeof(long);
    register long *pi = (long *)(a);
    register long *pj = (long *)(b);
    do {
      register long t = *pi;
      *pi++ = *pj;
      *pj++ = t;
    } while (--i > 0);
  } else {
    long i = (n) / sizeof(char);
    register char *pi = (char *)(a);
    register char *pj = (char *)(b);
    do {
      register char t = *pi;
      *pi++ = *pj;
      *pj++ = t;
    } while (--i > 0);
  }
}
```