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

```asm
<compare258>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  cmpl   $0x102,-0x24(%rbp)
  jle    L7
  movl   $0x102,-0x24(%rbp)
L7:
  mov    -0x24(%rbp),%eax
  and    $0xfffffff8,%eax
  mov    %eax,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L178
L3:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <load_u64@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <load_u64@plt>
  xor    %eax,-0x4(%rbp)
  cmpl   $0x0,-0x4(%rbp)
  je     L126
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <tzbytecnt@plt>
  mov    -0xc(%rbp),%edx
  add    %edx,%eax
  jmp    L44
L126:
  addq   $0x20,-0x18(%rbp)
  addq   $0x20,-0x20(%rbp)
  addl   $0x8,-0xc(%rbp)
L178:
  mov    -0xc(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  jl     L3
  mov    -0x24(%rbp),%eax
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %edx,%eax
  cmp    $0x7,%eax
  ja     L5
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D5(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D5(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%eax
  cmp    %eax,%ecx
  je     L143
  mov    -0xc(%rbp),%eax
  jmp    L44
L143:
  addl   $0x1,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%eax
  cmp    %eax,%ecx
  je     L180
  mov    -0xc(%rbp),%eax
  jmp    L44
L180:
  addl   $0x1,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%eax
  cmp    %eax,%ecx
  je     L28
  mov    -0xc(%rbp),%eax
  jmp    L44
L28:
  addl   $0x1,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%eax
  cmp    %eax,%ecx
  je     L97
  mov    -0xc(%rbp),%eax
  jmp    L44
L97:
  addl   $0x1,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%eax
  cmp    %eax,%ecx
  je     L8
  mov    -0xc(%rbp),%eax
  jmp    L44
L8:
  addl   $0x1,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    (%rax),%ecx
  mov    -0x20(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x20(%rbp)
  mov    (%rax),%eax
  cmp    %eax,%ecx
  je     L25
  mov    -0xc(%rbp),%eax
  jmp    L44
L25:
  addl   $0x1,-0xc(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  je     L89
  mov    -0xc(%rbp),%eax
  jmp    L44
L89:
  addl   $0x1,-0xc(%rbp)
L5:
  mov    -0xc(%rbp),%eax
L44:
  leave
  ret
```

assistant: ```c
int compare258(uint8_t *str1, uint8_t *str2, uint32_t max_length) {
  uint32_t count;
  uint64_t test;
  uint64_t loop_length;
  if (max_length > 258)
    max_length = 258;
  loop_length = max_length & ~0x7;
  for (count = 0; count < loop_length; count += 8) {
    test = load_u64(str1);
    test ^= load_u64(str2);
    if (test != 0)
      return count + tzbytecnt(test);
    str1 += 8;
    str2 += 8;
  }
  switch (max_length % 8) {
  case 7:
    if (*str1++ != *str2++)
      return count;
    count++;
  case 6:
    if (*str1++ != *str2++)
      return count;
    count++;
  case 5:
    if (*str1++ != *str2++)
      return count;
    count++;
  case 4:
    if (*str1++ != *str2++)
      return count;
    count++;
  case 3:
    if (*str1++ != *str2++)
      return count;
    count++;
  case 2:
    if (*str1++ != *str2++)
      return count;
    count++;
  case 1:
    if (*str1 != *str2)
      return count;
    count++;
  }
  return count;
}
```