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

```asm
<count_words>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xb8,%rsp
  mov    %rsi,0x60(%rsp)
  test   %rsi,%rsi
  je     L114
  movq   $0x0,0x60(%rsp)
  lea    (%rdi,%rsi,8),%rax
  mov    %rax,0x78(%rsp)
L56:
  mov    0x78(%rsp),%rax
  mov    (%rax),%rdx
  mov    %rdx,%rax
  mov    %rdx,0x90(%rsp)
  and    $0x2,%eax
  cmp    $0x1,%rax
  mov    %rdx,%rax
  sbbq   $0xffffffffffffffff,0x60(%rsp)
  shr    $0xa,%rax
  and    $0x3fffff,%eax
  je     L4
  movq   $0x0,0x68(%rsp)
  lea    (%rdi,%rax,8),%rax
  mov    %rax,0x80(%rsp)
L61:
  mov    0x80(%rsp),%rax
  mov    (%rax),%rdx
  mov    %rdx,%rax
  mov    %rdx,0x98(%rsp)
  and    $0x2,%eax
  cmp    $0x1,%rax
  mov    %rdx,%rax
  sbbq   $0xffffffffffffffff,0x68(%rsp)
  shr    $0xa,%rax
  and    $0x3fffff,%eax
  je     L99
  movq   $0x0,0x70(%rsp)
  lea    (%rdi,%rax,8),%rax
  mov    %rax,0x88(%rsp)
L134:
  mov    0x88(%rsp),%rax
  mov    (%rax),%rdx
  mov    %rdx,%rax
  mov    %rdx,0xa0(%rsp)
  and    $0x2,%eax
  cmp    $0x1,%rax
  mov    %rdx,%rax
  sbbq   $0xffffffffffffffff,0x70(%rsp)
  shr    $0xa,%rax
  and    $0x3fffff,%eax
  je     L57
  movq   $0x0,0x30(%rsp)
  lea    (%rdi,%rax,8),%rax
  mov    %rax,0x20(%rsp)
L109:
  mov    0x20(%rsp),%rax
  mov    (%rax),%rsi
  mov    %rsi,%rax
  mov    %rsi,0x28(%rsp)
  and    $0x2,%eax
  cmp    $0x1,%rax
  mov    %rsi,%rax
  sbbq   $0xffffffffffffffff,0x30(%rsp)
  shr    $0xa,%rax
  and    $0x3fffff,%eax
  je     L34
  lea    (%rdi,%rax,8),%r10
  xor    %r15d,%r15d
  mov    %r10,%r11
L67:
  mov    (%r11),%r10
  mov    %r10,%rax
  and    $0x2,%eax
  cmp    $0x1,%rax
  mov    %r10,%rax
  sbb    $0xffffffffffffffff,%r15
  shr    $0xa,%rax
  and    $0x3fffff,%eax
  je     L80
  mov    %r10,(%rsp)
  lea    (%rdi,%rax,8),%r12
  xor    %r13d,%r13d
  mov    %r11,0x8(%rsp)
  mov    %r15,%r11
L62:
  mov    (%r12),%rbx
  mov    %rbx,%rax
  and    $0x2,%eax
  cmp    $0x1,%rax
  mov    %rbx,%rax
  sbb    $0xffffffffffffffff,%r13
  shr    $0xa,%rax
  and    $0x3fffff,%eax
  je     L76
  mov    %r11,0x38(%rsp)
  lea    (%rdi,%rax,8),%r15
  xor    %ebp,%ebp
  mov    %r13,0x48(%rsp)
  mov    %rbx,0x40(%rsp)
  mov    %r15,%rbx
  mov    %r12,0x50(%rsp)
  mov    %rdi,%r12
L20:
  mov    (%rbx),%r14
  mov    %r14,%rax
  and    $0x2,%eax
  cmp    $0x1,%rax
  mov    %r14,%rax
  sbb    $0xffffffffffffffff,%rbp
  shr    $0xa,%rax
  and    $0x3fffff,%eax
  je     L128
  lea    (%r12,%rax,8),%r15
  mov    %r14,%rdx
  xor    %r13d,%r13d
  mov    %rbp,%rcx
  mov    %rbx,%r8
  mov    %r15,%r14
L162:
  mov    (%r14),%rsi
  mov    %rsi,%rax
  mov    %rsi,0xa8(%rsp)
  and    $0x2,%eax
  cmp    $0x1,%rax
  mov    %rsi,%rax
  sbb    $0xffffffffffffffff,%r13
  shr    $0xa,%rax
  and    $0x3fffff,%eax
  je     L96
  mov    %r14,0x58(%rsp)
  lea    (%r12,%rax,8),%rbx
  mov    %r13,%r14
  xor    %r15d,%r15d
  mov    %rcx,%r13
  mov    %r12,%rcx
  mov    %rdx,%r12
L123:
  mov    (%rbx),%rbp
  mov    %rcx,%rdi
  mov    %r8,0x18(%rsp)
  mov    %rcx,0x10(%rsp)
  mov    %rbp,%rax
  mov    %rbp,%rsi
  and    $0x2,%eax
  cmp    $0x1,%rax
  sbb    $0xffffffffffffffff,%r15
  shr    $0xa,%rsi
  add    $0x8,%rbx
  and    $0x3fffff,%esi
  call   <count_words>
  mov    0x10(%rsp),%rcx
  mov    0x18(%rsp),%r8
  add    %rax,%r15
  and    $0x1,%ebp
  je     L123
  mov    %r12,%rdx
  mov    %rcx,%r12
  mov    %r13,%rcx
  mov    %r14,%r13
  mov    0x58(%rsp),%r14
  add    %r15,%r13
  nop
L96:
  add    $0x8,%r14
  testb  $0x1,0xa8(%rsp)
  je     L162
  mov    %rcx,%rbp
  mov    %rdx,%r14
  mov    %r8,%rbx
  add    %r13,%rbp
L128:
  add    $0x8,%rbx
  and    $0x1,%r14d
  je     L20
  mov    0x48(%rsp),%r13
  mov    %r12,%rdi
  mov    0x38(%rsp),%r11
  mov    0x40(%rsp),%rbx
  mov    0x50(%rsp),%r12
  add    %rbp,%r13
L76:
  add    $0x8,%r12
  and    $0x1,%ebx
  je     L62
  mov    %r11,%r15
  mov    (%rsp),%r10
  mov    0x8(%rsp),%r11
  add    %r13,%r15
L80:
  add    $0x8,%r11
  and    $0x1,%r10d
  je     L67
  add    %r15,0x30(%rsp)
L34:
  addq   $0x8,0x20(%rsp)
  testb  $0x1,0x28(%rsp)
  je     L109
  mov    0x30(%rsp),%rcx
  add    %rcx,0x70(%rsp)
L57:
  addq   $0x8,0x88(%rsp)
  testb  $0x1,0xa0(%rsp)
  je     L134
  mov    0x70(%rsp),%rcx
  add    %rcx,0x68(%rsp)
L99:
  addq   $0x8,0x80(%rsp)
  testb  $0x1,0x98(%rsp)
  je     L61
  mov    0x68(%rsp),%rdx
  add    %rdx,0x60(%rsp)
L4:
  addq   $0x8,0x78(%rsp)
  testb  $0x1,0x90(%rsp)
  je     L56
L114:
  mov    0x60(%rsp),%rax
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
uint32_t count_words(const uint32_t *transitions, uint32_t pos) {
  uint32_t count = 0;
  if (!pos)
    return 0;
  do {
    if (((transitions[pos]) & 0x2))
      count++;
    count += count_words(transitions, (uint32_t)(((transitions[pos]) >> 10) & ((1 << 22) - 1)));
  } while (!((transitions[pos++]) & 0x1));
  return count;
}
```