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

```asm
<recompute_rec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8,-0x40(%rbp)
  mov    %r9,-0x48(%rbp)
  cmpl   $0x0,-0x28(%rbp)
  js     L35
  mov    -0x24(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jg     L35
  cmpq   $0x0,-0x38(%rbp)
  je     L35
  mov    -0x40(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jbe    L91
L35:
  mov    $0x1,%eax
  jmp    L100
L91:
  cmpl   $0x0,-0x28(%rbp)
  je     L41
  cmpl   $0x0,0x10(%rbp)
  jne    L147
  mov    -0x28(%rbp),%eax
  cltd
  shr    $0x1f,%edx
  add    %edx,%eax
  and    $0x1,%eax
  sub    %edx,%eax
  cmp    $0x1,%eax
  jne    L78
L147:
  mov    $0x1,%eax
  jmp    L9
L78:
  mov    $0x0,%eax
L9:
  mov    %eax,-0x14(%rbp)
  mov    -0x24(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L57
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  je     L81
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  cmp    %eax,-0x28(%rbp)
  jne    L107
  cmpl   $0x0,0x10(%rbp)
  jne    L107
L81:
  mov    -0x28(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r11d
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r10d
  mov    -0x48(%rbp),%rdi
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  sub    $0x8,%rsp
  mov    -0x14(%rbp),%ecx
  push   %rcx
  mov    %rdi,%r9
  mov    %rsi,%r8
  mov    %rdx,%rcx
  mov    %rax,%rdx
  mov    %r11d,%esi
  mov    %r10d,%edi
  call   <recompute_rec>
  add    $0x10,%rsp
  jmp    L100
L107:
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x48(%rbp),%rdx
  mov    -0x8(%rbp),%rcx
  mov    -0x48(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <compress@plt>
  mov    -0x40(%rbp),%rax
  lea    0x1(%rax),%rdi
  mov    -0x28(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r11d
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r10d
  mov    -0x48(%rbp),%rsi
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  sub    $0x8,%rsp
  mov    -0x14(%rbp),%ecx
  push   %rcx
  mov    %rsi,%r9
  mov    %rdi,%r8
  mov    %rdx,%rcx
  mov    %rax,%rdx
  mov    %r11d,%esi
  mov    %r10d,%edi
  call   <recompute_rec>
  add    $0x10,%rsp
  jmp    L100
L57:
  mov    -0x40(%rbp),%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x48(%rbp),%rdx
  mov    -0x48(%rbp),%rcx
  mov    -0x10(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <compress@plt>
  mov    -0x40(%rbp),%rax
  lea    0x1(%rax),%rdi
  mov    -0x28(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r11d
  mov    -0x24(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%r10d
  mov    -0x48(%rbp),%rsi
  mov    -0x38(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  sub    $0x8,%rsp
  mov    -0x14(%rbp),%ecx
  push   %rcx
  mov    %rsi,%r9
  mov    %rdi,%r8
  mov    %rdx,%rcx
  mov    %rax,%rdx
  mov    %r11d,%esi
  mov    %r10d,%edi
  call   <recompute_rec>
  add    $0x10,%rsp
  jmp    L100
L41:
  mov    $0x0,%eax
L100:
  leave
  ret
```

assistant: ```c
int recompute_rec(uint32_t i, uint32_t n, uint8_t *const *path, size_t path_len, size_t pi, uint8_t *tag, int actd) {
  if (n < 0 || i > n || path_len == 0 || pi < 0 || pi > path_len)
    return 1;
  if (n != 0) {
    int nactd = actd || n % 2 == 1;
    if (i % 2 == 0) {
      if (n == i || ((n == i + 1) && !actd))
        return recompute_rec(i / 2, n / 2, path, path_len, pi, tag, nactd);
      const uint8_t *phash = path[pi];
      compress(tag, phash, tag);
      return recompute_rec(i / 2, n / 2, path, path_len, pi + 1, tag, nactd);
    } else {
      const uint8_t *phash = path[pi];
      compress(phash, tag, tag);
    }
    return recompute_rec(i / 2, n / 2, path, path_len, pi + 1, tag, nactd);
  }
  return 0;
}
```