user: Translate the below assembly code into C programming language:

```asm
<SwapBuffer>:
  endbr64
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  test   %rdi,%rdi
  setne  %al
  xor    %edi,%edi
  test   %rsi,%rsi
  setne  %dil
  and    %eax,%edi
  call   <assert@plt>
  test   %r13d,%r13d
  je     L167
  cmp    $0x1,%r13d
  jne    L90
  movzbl 0x0(%rbp),%eax
  movzbl (%r12),%edx
  mov    %dl,0x0(%rbp)
  mov    %al,(%r12)
L167:
  add    $0x8,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L90:
  mov    %r13d,%edi
  call   <malloc@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L49
  mov    %r13d,%edx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    %r13d,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <memmove@plt>
  mov    %r12,%rdi
  mov    %r13d,%edx
  mov    %r14,%rsi
  call   <memcpy@plt>
  add    $0x8,%rsp
  mov    %r14,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  jmp    1090 <free@plt>
  nopl   (%rax)
L49:
  lea    0xf(%rbp),%rax
  lea    -0x1(%r13),%edx
  sub    %r12,%rax
  cmp    $0x1e,%rax
  jbe    L171
  cmp    $0x6,%edx
  jbe    L171
  cmp    $0xe,%edx
  jbe    L46
  mov    %r13d,%edx
  xor    %eax,%eax
  shr    $0x4,%edx
  shl    $0x4,%rdx
  nopl   0x0(%rax,%rax,1)
L182:
  movdqu 0x0(%rbp,%rax,1),%xmm0
  movdqu (%r12,%rax,1),%xmm1
  movups %xmm1,0x0(%rbp,%rax,1)
  movups %xmm0,(%r12,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L182
  mov    %r13d,%eax
  and    $0xfffffff0,%eax
  test   $0xf,%r13b
  je     L167
  mov    %r13d,%ecx
  sub    %eax,%ecx
  lea    -0x1(%rcx),%edx
  cmp    $0x6,%edx
  jbe    L94
L151:
  mov    %eax,%edx
  lea    0x0(%rbp,%rdx,1),%rsi
  add    %r12,%rdx
  mov    (%rdx),%r8
  mov    (%rsi),%rdi
  mov    %r8,(%rsi)
  mov    %rdi,(%rdx)
  mov    %ecx,%edx
  and    $0xfffffff8,%edx
  add    %edx,%eax
  cmp    %edx,%ecx
  je     L167
L94:
  mov    %eax,%edx
  lea    0x0(%rbp,%rdx,1),%rcx
  add    %r12,%rdx
  movzbl (%rdx),%edi
  movzbl (%rcx),%esi
  mov    %dil,(%rcx)
  mov    %sil,(%rdx)
  lea    0x1(%rax),%edx
  cmp    %edx,%r13d
  jbe    L167
  lea    0x0(%rbp,%rdx,1),%rcx
  add    %r12,%rdx
  movzbl (%rdx),%edi
  movzbl (%rcx),%esi
  mov    %dil,(%rcx)
  mov    %sil,(%rdx)
  lea    0x2(%rax),%edx
  cmp    %edx,%r13d
  jbe    L167
  lea    0x0(%rbp,%rdx,1),%rcx
  add    %r12,%rdx
  movzbl (%rdx),%edi
  movzbl (%rcx),%esi
  mov    %dil,(%rcx)
  mov    %sil,(%rdx)
  lea    0x3(%rax),%edx
  cmp    %edx,%r13d
  jbe    L167
  lea    0x0(%rbp,%rdx,1),%rcx
  add    %r12,%rdx
  movzbl (%rdx),%edi
  movzbl (%rcx),%esi
  mov    %dil,(%rcx)
  mov    %sil,(%rdx)
  lea    0x4(%rax),%edx
  cmp    %edx,%r13d
  jbe    L167
  lea    0x0(%rbp,%rdx,1),%rcx
  add    %r12,%rdx
  movzbl (%rdx),%edi
  movzbl (%rcx),%esi
  mov    %dil,(%rcx)
  mov    %sil,(%rdx)
  lea    0x5(%rax),%edx
  cmp    %edx,%r13d
  jbe    L167
  lea    0x0(%rbp,%rdx,1),%rcx
  add    %r12,%rdx
  add    $0x6,%eax
  movzbl (%rcx),%esi
  movzbl (%rdx),%edi
  mov    %dil,(%rcx)
  mov    %sil,(%rdx)
  cmp    %eax,%r13d
  jbe    L167
  add    %rax,%rbp
  add    %r12,%rax
  movzbl 0x0(%rbp),%edx
  movzbl (%rax),%ecx
  mov    %cl,0x0(%rbp)
  mov    %dl,(%rax)
  jmp    L167
L171:
  xor    %eax,%eax
  nopl   0x0(%rax)
L108:
  movzbl 0x0(%rbp,%rax,1),%edx
  movzbl (%r12,%rax,1),%ecx
  mov    %cl,0x0(%rbp,%rax,1)
  mov    %dl,(%r12,%rax,1)
  add    $0x1,%rax
  cmp    %r13,%rax
  jne    L108
  jmp    L167
L46:
  mov    %r13d,%ecx
  xor    %eax,%eax
  jmp    L151
```

assistant: ```c
void SwapBuffer(char *p1, char *p2, unsigned len) {
  char temp;
  char *buf;
  unsigned i;
  assert(p1 && p2);
  if (!len)
    return;
  buf = (len == 1) ? 0 : (char *)malloc(len);
  if (buf) {
    memcpy(buf, p1, len);
    memmove(p1, p2, len);
    memcpy(p2, buf, len);
    free(buf);
  } else {
    for (i = 0; i < len; i++) {
      temp = p1[i];
      p1[i] = p2[i];
      p2[i] = temp;
    }
  }
}
```