user: Converte this assembly snippet into its equivalent C code:

```asm
<memcmp>:
  endbr64
  mov    %rdi,%rcx
  cmp    $0x7,%rdx
  jbe    L18
  nopl   0x0(%rax)
L134:
  mov    (%rsi),%rax
  cmp    %rax,(%rcx)
  je     L59
  movzbl (%rcx),%eax
  movzbl (%rsi),%edi
  cmp    %dil,%al
  jne    L51
  movzbl 0x1(%rcx),%eax
  movzbl 0x1(%rsi),%edi
  cmp    %dil,%al
  jne    L51
  movzbl 0x2(%rcx),%eax
  movzbl 0x2(%rsi),%edi
  cmp    %dil,%al
  jne    L51
  movzbl 0x3(%rcx),%eax
  movzbl 0x3(%rsi),%edi
  cmp    %dil,%al
  jne    L51
  movzbl 0x4(%rcx),%eax
  movzbl 0x4(%rsi),%edi
  cmp    %dil,%al
  jne    L51
  movzbl 0x5(%rcx),%eax
  movzbl 0x5(%rsi),%edi
  cmp    %dil,%al
  jne    L51
  movzbl 0x6(%rcx),%eax
  movzbl 0x6(%rsi),%edi
  cmp    %dil,%al
  jne    L51
  movzbl 0x7(%rcx),%eax
  movzbl 0x7(%rsi),%edi
  cmp    %dil,%al
  jne    L51
L59:
  sub    $0x8,%rdx
  add    $0x8,%rcx
  add    $0x8,%rsi
  cmp    $0x7,%rdx
  ja     L134
L18:
  test   %rdx,%rdx
  je     L58
  xor    %edi,%edi
  jmp    L135
  nopl   0x0(%rax)
L125:
  add    $0x1,%rdi
  cmp    %rdi,%rdx
  je     L58
L135:
  movzbl (%rcx,%rdi,1),%eax
  movzbl (%rsi,%rdi,1),%r8d
  cmp    %r8b,%al
  je     L125
  sub    %r8d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L51:
  sub    %edi,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L58:
  xor    %eax,%eax
  ret
```

assistant: ```c
int memcmp(const void *m1, const void *m2, size_t n) {
  const unsigned long *im1 = (const unsigned long *)m1;
  const unsigned long *im2 = (const unsigned long *)m2;
  const unsigned char *cm1;
  const unsigned char *cm2;
  for (; n >= sizeof(unsigned long); n -= sizeof(unsigned long)) {
    if (*im1 != *im2) {
      cm1 = (const unsigned char *)im1;
      cm2 = (const unsigned char *)im2;
      switch (sizeof(unsigned long)) {
      case 1:
        do {
          if (cm1[0] != cm2[0])
            return (cm1[0] - cm2[0]);
        } while (0);
      case 2:
        do {
          if (cm1[0] != cm2[0])
            return (cm1[0] - cm2[0]);
          if (cm1[1] != cm2[1])
            return (cm1[1] - cm2[1]);
        } while (0);
        break;
      case 4:
        do {
          if (cm1[0] != cm2[0])
            return (cm1[0] - cm2[0]);
          if (cm1[1] != cm2[1])
            return (cm1[1] - cm2[1]);
          if (cm1[2] != cm2[2])
            return (cm1[2] - cm2[2]);
          if (cm1[3] != cm2[3])
            return (cm1[3] - cm2[3]);
        } while (0);
        break;
      case 8:
        do {
          if (cm1[0] != cm2[0])
            return (cm1[0] - cm2[0]);
          if (cm1[1] != cm2[1])
            return (cm1[1] - cm2[1]);
          if (cm1[2] != cm2[2])
            return (cm1[2] - cm2[2]);
          if (cm1[3] != cm2[3])
            return (cm1[3] - cm2[3]);
          if (cm1[4] != cm2[4])
            return (cm1[4] - cm2[4]);
          if (cm1[5] != cm2[5])
            return (cm1[5] - cm2[5]);
          if (cm1[6] != cm2[6])
            return (cm1[6] - cm2[6]);
          if (cm1[7] != cm2[7])
            return (cm1[7] - cm2[7]);
        } while (0);
        break;
      default:
        do {
          unsigned long i;
          for (i = 0; i < sizeof(unsigned long); ++i) {
            if (cm1[i] != cm2[i])
              return (cm1[i] - cm2[i]);
          }
        } while (0);
        break;
      }
    }
    im1++;
    im2++;
  }
  cm1 = (const unsigned char *)im1;
  cm2 = (const unsigned char *)im2;
  for (; n--; cm1++, cm2++) {
    if (*cm1 != *cm2)
      return (*cm1 - *cm2);
  }
  return (0);
}
```