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

```asm
<hash_djb2>:
  endbr64
  mov    %esi,%ecx
  mov    %edx,%eax
  test   %esi,%esi
  jle    L95
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl (%rdi),%eax
  add    %edx,%eax
  cmp    $0x1,%esi
  je     L95
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0x1(%rdi),%eax
  add    %edx,%eax
  cmp    $0x2,%esi
  je     L95
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0x2(%rdi),%eax
  add    %edx,%eax
  cmp    $0x3,%esi
  jle    L70
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0x3(%rdi),%eax
  add    %edx,%eax
L70:
  cmp    $0x4,%ecx
  jle    L15
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0x4(%rdi),%eax
  add    %edx,%eax
L15:
  cmp    $0x5,%ecx
  jle    L26
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0x5(%rdi),%eax
  add    %edx,%eax
L26:
  cmp    $0x6,%ecx
  jle    L3
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0x6(%rdi),%eax
  add    %edx,%eax
L3:
  cmp    $0x7,%ecx
  jle    L126
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0x7(%rdi),%eax
  add    %edx,%eax
L126:
  cmp    $0x8,%ecx
  jle    L73
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0x8(%rdi),%eax
  add    %edx,%eax
L73:
  cmp    $0x9,%ecx
  jle    L51
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0x9(%rdi),%eax
  add    %edx,%eax
L51:
  cmp    $0xa,%ecx
  jle    L9
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0xa(%rdi),%eax
  add    %edx,%eax
L9:
  cmp    $0xb,%ecx
  jle    L155
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0xb(%rdi),%eax
  add    %edx,%eax
L155:
  cmp    $0xc,%ecx
  jle    L64
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0xc(%rdi),%eax
  add    %edx,%eax
L64:
  cmp    $0xd,%ecx
  jle    L25
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0xd(%rdi),%eax
  add    %edx,%eax
L25:
  cmp    $0xe,%ecx
  jle    L87
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0xe(%rdi),%eax
  add    %edx,%eax
L87:
  cmp    $0xf,%ecx
  jle    L95
  mov    %eax,%edx
  shl    $0x5,%edx
  add    %eax,%edx
  movsbl 0xf(%rdi),%eax
  add    %edx,%eax
L95:
  ret
```

assistant: ```c
__attribute__((always_)) uint32_t hash_djb2(const char *bytes, const int32_t length, const uint32_t oldhash) {
  uint32_t hash = oldhash;
  if (length <= 0)
    return hash;
  if (length > 0)
    hash = ((hash << 5) + hash) + bytes[0];
  if (length > 1)
    hash = ((hash << 5) + hash) + bytes[1];
  if (length > 2)
    hash = ((hash << 5) + hash) + bytes[2];
  if (length > 3)
    hash = ((hash << 5) + hash) + bytes[3];
  if (length > 4)
    hash = ((hash << 5) + hash) + bytes[4];
  if (length > 5)
    hash = ((hash << 5) + hash) + bytes[5];
  if (length > 6)
    hash = ((hash << 5) + hash) + bytes[6];
  if (length > 7)
    hash = ((hash << 5) + hash) + bytes[7];
  if (length > 8)
    hash = ((hash << 5) + hash) + bytes[8];
  if (length > 9)
    hash = ((hash << 5) + hash) + bytes[9];
  if (length > 10)
    hash = ((hash << 5) + hash) + bytes[10];
  if (length > 11)
    hash = ((hash << 5) + hash) + bytes[11];
  if (length > 12)
    hash = ((hash << 5) + hash) + bytes[12];
  if (length > 13)
    hash = ((hash << 5) + hash) + bytes[13];
  if (length > 14)
    hash = ((hash << 5) + hash) + bytes[14];
  if (length > 15)
    hash = ((hash << 5) + hash) + bytes[15];
  return hash;
}
```