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

```asm
<timingsafe_bcmp>:
  endbr64
  test   %rdx,%rdx
  je     L56
  lea    -0x1(%rdx),%rax
  mov    %rsi,%rcx
  mov    %rdi,%r11
  mov    %rdx,%rsi
  cmp    $0xe,%rax
  jbe    L118
  and    $0xfffffffffffffff0,%rdx
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  xchg   %ax,%ax
L2:
  movdqu (%r11,%rax,1),%xmm1
  movdqu (%rcx,%rax,1),%xmm2
  add    $0x10,%rax
  pxor   %xmm2,%xmm1
  por    %xmm1,%xmm0
  cmp    %rdx,%rax
  jne    L2
  movdqa %xmm0,%xmm1
  mov    %rsi,%r10
  mov    %rsi,%r9
  psrldq $0x8,%xmm1
  and    $0xfffffffffffffff0,%r10
  and    $0xf,%r9d
  por    %xmm1,%xmm0
  lea    (%r11,%r10,1),%r8
  lea    (%rcx,%r10,1),%rdi
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x2,%xmm1
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x1,%xmm1
  por    %xmm1,%xmm0
  movd   %xmm0,%eax
  cmp    %rsi,%r10
  je     L168
L98:
  sub    %r10,%rsi
  lea    -0x1(%rsi),%rdx
  cmp    $0x6,%rdx
  jbe    L140
  push   %rbx
  movq   (%rcx,%r10,1),%xmm0
  movq   (%r11,%r10,1),%xmm1
  pxor   %xmm0,%xmm1
  movq   %xmm1,%rdx
  mov    %edx,%ecx
  movzbl %dh,%ebx
  shr    $0x38,%rdx
  or     %ebx,%ecx
  or     %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x10,%rcx
  or     %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x18,%rcx
  or     %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x20,%rcx
  or     %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x28,%rcx
  or     %ecx,%eax
  movq   %xmm1,%rcx
  shr    $0x30,%rcx
  or     %ecx,%eax
  or     %edx,%eax
  mov    %rsi,%rdx
  and    $0xfffffffffffffff8,%rdx
  sub    %rdx,%r9
  add    %rdx,%r8
  add    %rdx,%rdi
  cmp    %rdx,%rsi
  je     L17
  movzbl (%r8),%edx
  xor    (%rdi),%dl
  or     %edx,%eax
  cmp    $0x1,%r9
  je     L17
  movzbl 0x1(%rdi),%edx
  xor    0x1(%r8),%dl
  or     %edx,%eax
  cmp    $0x2,%r9
  je     L17
  movzbl 0x2(%r8),%edx
  xor    0x2(%rdi),%dl
  or     %edx,%eax
  cmp    $0x3,%r9
  je     L17
  movzbl 0x3(%r8),%edx
  xor    0x3(%rdi),%dl
  or     %edx,%eax
  cmp    $0x4,%r9
  je     L17
  movzbl 0x4(%r8),%edx
  xor    0x4(%rdi),%dl
  or     %edx,%eax
  cmp    $0x5,%r9
  je     L17
  movzbl 0x5(%r8),%edx
  xor    0x5(%rdi),%dl
  or     %edx,%eax
  cmp    $0x6,%r9
  je     L17
  movzbl 0x6(%r8),%edx
  xor    0x6(%rdi),%dl
  or     %edx,%eax
L17:
  movzbl %al,%eax
  pop    %rbx
  add    $0xff,%eax
  sar    $0x8,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L56:
  xor    %eax,%eax
  ret
L140:
  movzbl (%r8),%edx
  xor    (%rdi),%dl
  or     %edx,%eax
  cmp    $0x1,%r9
  je     L168
  movzbl 0x1(%rdi),%edx
  xor    0x1(%r8),%dl
  or     %edx,%eax
  cmp    $0x2,%r9
  je     L168
  movzbl 0x2(%r8),%edx
  xor    0x2(%rdi),%dl
  or     %edx,%eax
  cmp    $0x3,%r9
  je     L168
  movzbl 0x3(%r8),%edx
  xor    0x3(%rdi),%dl
  or     %edx,%eax
  cmp    $0x4,%r9
  je     L168
  movzbl 0x4(%r8),%edx
  xor    0x4(%rdi),%dl
  or     %edx,%eax
  cmp    $0x5,%r9
  je     L168
  movzbl 0x5(%r8),%edx
  xor    0x5(%rdi),%dl
  or     %edx,%eax
  cmp    $0x6,%r9
  je     L168
  movzbl 0x6(%r8),%edx
  xor    0x6(%rdi),%dl
  or     %edx,%eax
L168:
  movzbl %al,%eax
  add    $0xff,%eax
  sar    $0x8,%eax
  ret
L118:
  mov    %rcx,%rdi
  mov    %r11,%r8
  mov    %rdx,%r9
  xor    %r10d,%r10d
  xor    %eax,%eax
  jmp    L98
```

assistant: ```c
int timingsafe_bcmp(const void *b1, const void *b2, size_t n) {
  const unsigned char *p1 = b1, *p2 = b2;
  unsigned char ret = 0;
  for (; n > 0; n--) {
    ret |= *p1++ ^ *p2++;
  }
  return (ret + 0xff) >> 8;
}
```