user: 请从给定的汇编指令推导出C源代码：

```asm
<hash>:
  endbr64
  test   %rsi,%rsi
  je     L55
  mov    %rdi,%r8
  test   %rdi,%rdi
  je     L55
  mov    %esi,%r9d
  mov    %esi,%edx
  push   %rbp
  and    $0x3,%r9d
  shr    $0x2,%rsi
  push   %rbx
  je     L90
  lea    -0x1(%rsi),%rax
  cmp    $0x1,%rax
  jbe    L118
  lea    -0x3(%rsi),%rax
  mov    0x2(%rdi),%rbx
  mov    (%rdi),%r11
  lea    -0x2(%rsi),%rdi
  and    $0xfffffffffffffffe,%rax
  mov    %rsi,%r10
  mov    %r8,%rcx
  sub    %rax,%rdi
L46:
  mov    0x8(%rcx),%rbp
  sub    $0x2,%r10
  add    $0x10,%rcx
  mov    %ebp,%eax
  shl    $0x8,%eax
  add    %r11d,%eax
  add    %edx,%eax
  mov    -0x6(%rcx),%rdx
  mov    %edx,%r11d
  shl    $0x8,%r11d
  add    %ebx,%r11d
  shl    $0xb,%r11d
  xor    %eax,%r11d
  shl    $0x10,%eax
  xor    %r11d,%eax
  mov    (%rcx),%r11
  mov    %eax,%ebx
  sar    $0xb,%ebx
  add    %eax,%ebx
  mov    %r11d,%eax
  shl    $0x8,%eax
  add    %ebp,%eax
  add    %ebx,%eax
  mov    0x2(%rcx),%rbx
  mov    %ebx,%ebp
  shl    $0x8,%ebp
  add    %ebp,%edx
  shl    $0xb,%edx
  xor    %eax,%edx
  shl    $0x10,%eax
  xor    %edx,%eax
  mov    %eax,%edx
  sar    $0xb,%edx
  add    %eax,%edx
  cmp    %r10,%rdi
  jne    L46
  xchg   %ax,%ax
L1:
  mov    0x8(%rcx),%eax
  add    $0x8,%rcx
  shl    $0x8,%eax
  add    -0x8(%rcx),%eax
  add    %edx,%eax
  mov    0x2(%rcx),%edx
  shl    $0x8,%edx
  add    -0x6(%rcx),%edx
  shl    $0xb,%edx
  xor    %eax,%edx
  shl    $0x10,%eax
  xor    %edx,%eax
  mov    %eax,%edx
  sar    $0xb,%edx
  add    %eax,%edx
  sub    $0x1,%rdi
  jne    L1
  lea    (%r8,%rsi,8),%r8
L90:
  cmp    $0x2,%r9d
  je     L115
  cmp    $0x3,%r9d
  je     L4
  cmp    $0x1,%r9d
  je     L43
L8:
  lea    0x0(,%rdx,8),%eax
  pop    %rbx
  pop    %rbp
  xor    %eax,%edx
  mov    %edx,%eax
  sar    $0x5,%eax
  add    %edx,%eax
  mov    %eax,%edx
  shl    $0x4,%edx
  xor    %eax,%edx
  mov    %edx,%eax
  sar    $0x11,%eax
  add    %edx,%eax
  mov    %eax,%edx
  shl    $0x19,%edx
  xor    %eax,%edx
  mov    %edx,%eax
  sar    $0x6,%eax
  add    %edx,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L55:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L43:
  movsbl (%r8),%eax
  add    %eax,%edx
  mov    %edx,%eax
  shl    $0xa,%eax
  xor    %edx,%eax
  mov    %eax,%edx
  sar    %edx
  add    %eax,%edx
  jmp    L8
  nopl   (%rax)
L4:
  mov    0x8(%r8),%eax
  shl    $0x8,%eax
  add    (%r8),%eax
  add    %edx,%eax
  movsbl 0x4(%r8),%edx
  mov    %eax,%ecx
  shl    $0x12,%edx
  shl    $0x10,%ecx
  xor    %edx,%eax
  xor    %ecx,%eax
  mov    %eax,%edx
  sar    $0xb,%edx
  add    %eax,%edx
  jmp    L8
  cs nopw 0x0(%rax,%rax,1)
L115:
  mov    0x8(%r8),%eax
  shl    $0x8,%eax
  add    (%r8),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shl    $0xb,%edx
  xor    %edx,%eax
  mov    %eax,%edx
  sar    $0x11,%edx
  add    %eax,%edx
  jmp    L8
L118:
  mov    %rsi,%rdi
  mov    %r8,%rcx
  jmp    L1
```

assistant: ```c
uint32_t hash(const char *data, size_t len) {
  uint32_t hash = len, tmp;
  int rem;
  if (len <= 0 || data == NULL)
    return 0;
  rem = len & 3;
  len >>= 2;
  for (; len > 0; len--) {
    hash += ((((uint32_t)(((const uint8_t *)(data))[1])) << 8) + (uint32_t)(((const uint8_t *)(data))[0]));
    tmp = (((((uint32_t)(((const uint8_t *)(data + 2))[1])) << 8) + (uint32_t)(((const uint8_t *)(data + 2))[0])) << 11) ^ hash;
    hash = (hash << 16) ^ tmp;
    data += 2 * sizeof(uint16_t);
    hash += hash >> 11;
  }
  switch (rem) {
  case 3:
    hash += ((((uint32_t)(((const uint8_t *)(data))[1])) << 8) + (uint32_t)(((const uint8_t *)(data))[0]));
    hash ^= hash << 16;
    hash ^= data[sizeof(uint16_t)] << 18;
    hash += hash >> 11;
    break;
  case 2:
    hash += ((((uint32_t)(((const uint8_t *)(data))[1])) << 8) + (uint32_t)(((const uint8_t *)(data))[0]));
    hash ^= hash << 11;
    hash += hash >> 17;
    break;
  case 1:
    hash += *data;
    hash ^= hash << 10;
    hash += hash >> 1;
  }
  hash ^= hash << 3;
  hash += hash >> 5;
  hash ^= hash << 4;
  hash += hash >> 17;
  hash ^= hash << 25;
  hash += hash >> 6;
  return hash;
}
```