user: Please show me the C implementation that matches the assembly code listed below:

```asm
<pstw__hash>:
  endbr64
  movsbl (%rdi),%r8d
  test   %r8d,%r8d
  je     L38
  mov    %rdi,%rdx
  xor    %ecx,%ecx
  jmp    L54
  nopl   0x0(%rax,%rax,1)
L59:
  shl    $0x8,%eax
  add    %ecx,%eax
  movsbl 0x2(%rdx),%ecx
  test   %ecx,%ecx
  je     L29
  shl    $0x10,%ecx
  add    %eax,%ecx
  movsbl 0x3(%rdx),%eax
  test   %eax,%eax
  je     L21
  shl    $0x18,%eax
  add    %ecx,%eax
  movsbl 0x4(%rdx),%ecx
  test   %ecx,%ecx
  je     L58
  shl    $0x4,%ecx
  add    %eax,%ecx
  movsbl 0x5(%rdx),%eax
  test   %eax,%eax
  je     L96
  shl    $0xc,%eax
  lea    0x7(%rdx),%r9
  add    %ecx,%eax
  movsbl 0x6(%rdx),%ecx
  test   %ecx,%ecx
  je     L91
  movsbl 0x7(%rdx),%r8d
  shl    $0x14,%ecx
  add    %eax,%ecx
  test   %r8d,%r8d
  je     L50
  mov    %r9,%rdx
L54:
  movsbl 0x1(%rdx),%eax
  add    %r8d,%ecx
  test   %eax,%eax
  jne    L59
  movslq %ecx,%r8
  mov    %ecx,%eax
  sub    %edi,%edx
  imul   $0x2af31cc1,%r8,%r8
  sar    $0x1f,%eax
  sar    $0x36,%r8
  sub    %eax,%r8d
  imul   $0x17d7849,%r8d,%eax
  sub    %eax,%ecx
  lea    0x1(%rdx),%eax
  mov    %ecx,%r8d
L7:
  mov    %r8d,(%rsi)
  ret
  nopl   (%rax)
L29:
  movslq %eax,%r8
  mov    %eax,%ecx
  sub    %edi,%edx
  imul   $0x2af31cc1,%r8,%r8
  sar    $0x1f,%ecx
  sar    $0x36,%r8
  sub    %ecx,%r8d
  imul   $0x17d7849,%r8d,%ecx
  sub    %ecx,%eax
  mov    %eax,%r8d
  lea    0x2(%rdx),%eax
  mov    %r8d,(%rsi)
  ret
  nopl   0x0(%rax,%rax,1)
L21:
  movslq %ecx,%r8
  mov    %ecx,%eax
  sub    %edi,%edx
  imul   $0x2af31cc1,%r8,%r8
  sar    $0x1f,%eax
  sar    $0x36,%r8
  sub    %eax,%r8d
  imul   $0x17d7849,%r8d,%eax
  sub    %eax,%ecx
  lea    0x3(%rdx),%eax
  mov    %ecx,%r8d
  mov    %r8d,(%rsi)
  ret
  nopl   0x0(%rax,%rax,1)
L58:
  movslq %eax,%r8
  mov    %eax,%ecx
  sub    %edi,%edx
  imul   $0x2af31cc1,%r8,%r8
  sar    $0x1f,%ecx
  sar    $0x36,%r8
  sub    %ecx,%r8d
  imul   $0x17d7849,%r8d,%ecx
  sub    %ecx,%eax
  mov    %eax,%r8d
  lea    0x4(%rdx),%eax
  mov    %r8d,(%rsi)
  ret
  nopl   0x0(%rax,%rax,1)
L96:
  movslq %ecx,%r8
  mov    %ecx,%eax
  sub    %edi,%edx
  imul   $0x2af31cc1,%r8,%r8
  sar    $0x1f,%eax
  sar    $0x36,%r8
  sub    %eax,%r8d
  imul   $0x17d7849,%r8d,%eax
  sub    %eax,%ecx
  lea    0x5(%rdx),%eax
  mov    %ecx,%r8d
  mov    %r8d,(%rsi)
  ret
  nopl   0x0(%rax,%rax,1)
L91:
  movslq %eax,%r8
  cltd
  sub    %rdi,%r9
  imul   $0x2af31cc1,%r8,%r8
  sar    $0x36,%r8
  sub    %edx,%r8d
  imul   $0x17d7849,%r8d,%edx
  sub    %edx,%eax
  mov    %eax,%r8d
  lea    -0x1(%r9),%eax
  mov    %r8d,(%rsi)
  ret
  nopl   0x0(%rax)
L50:
  movslq %ecx,%r8
  mov    %ecx,%eax
  sub    %edi,%edx
  imul   $0x2af31cc1,%r8,%r8
  sar    $0x1f,%eax
  sar    $0x36,%r8
  sub    %eax,%r8d
  imul   $0x17d7849,%r8d,%eax
  sub    %eax,%ecx
  lea    0x7(%rdx),%eax
  mov    %ecx,%r8d
  mov    %r8d,(%rsi)
  ret
L38:
  xor    %eax,%eax
  jmp    L7
```

assistant: ```c
uint32_t pstw__hash(const char *str, int *hash) {
  uint32_t c, h;
  const char *s;
  s = str;
  h = 0;
  for (;;) {
    if ((c = *s++) == 0)
      break;
    h += c;
    if ((c = *s++) == 0)
      break;
    h += c << 8;
    if ((c = *s++) == 0)
      break;
    h += c << 16;
    if ((c = *s++) == 0)
      break;
    h += c << 24;
    if ((c = *s++) == 0)
      break;
    h += c << 4;
    if ((c = *s++) == 0)
      break;
    h += c << 12;
    if ((c = *s++) == 0)
      break;
    h += c << 20;
  }
  *hash = h % 25000009;
  return (uint32_t)(s - str - 1);
}
```