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

```asm
<setbits>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  sub    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x30(%rbp),%eax
  and    -0x18(%rbp),%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x28(%rbp),%eax
  add    $0x1,%eax
  sub    -0x2c(%rbp),%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  mov    -0x14(%rbp),%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x10(%rbp),%eax
  mov    -0x18(%rbp),%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  not    %eax
  mov    %eax,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  and    -0x24(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  lea    D33(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x18(%rbp),%eax
  mov    %eax,%edi
  call   <dec2bin@plt>
  lea    D63(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x30(%rbp),%eax
  mov    %eax,%edi
  call   <dec2bin@plt>
  lea    D60(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x14(%rbp),%eax
  mov    %eax,%edi
  call   <dec2bin@plt>
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <dec2bin@plt>
  lea    D22(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x24(%rbp),%eax
  mov    %eax,%edi
  call   <dec2bin@plt>
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x8(%rbp),%eax
  mov    %eax,%edi
  call   <dec2bin@plt>
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x4(%rbp),%eax
  mov    %eax,%edi
  call   <dec2bin@plt>
  lea    D77(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x4(%rbp),%eax
  or     -0xc(%rbp),%eax
  mov    %eax,%edi
  call   <dec2bin@plt>
  mov    -0x4(%rbp),%eax
  or     -0xc(%rbp),%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D33
type_guessed: string
name: unpack_data
arguments: data_label: D63
type_guessed: string
name: unpack_data
arguments: data_label: D60
type_guessed: string
name: unpack_data
arguments: data_label: D35
type_guessed: string
name: unpack_data
arguments: data_label: D22
type_guessed: string
name: unpack_data
arguments: data_label: D42
type_guessed: string
name: unpack_data
arguments: data_label: D55
type_guessed: string
name: unpack_data
arguments: data_label: D77
type_guessed: string

tool: D33: r = 

tool: D63: y = 

tool: D60: rightmost_nbits_y = 

tool: D35: rhs = 

tool: D22: x = 

tool: D42: x_bitmask = 

tool: D55: lhs = 

tool: D77: lhs | rhs = 

assistant: ```c
unsigned setbits(unsigned x, int p, int n, int y) {
  int r, rightmost_nbits_y, shift_value, x_bitmask, lhs, rhs;
  r = (1 << n) - 1;
  rightmost_nbits_y = y & r;
  shift_value = (p + 1 - n);
  rhs = rightmost_nbits_y << shift_value;
  x_bitmask = ~(r << shift_value);
  lhs = x & x_bitmask;
  printf("r = ");
  dec2bin(r);
  printf("y = ");
  dec2bin(y);
  printf("rightmost_nbits_y = ");
  dec2bin(rightmost_nbits_y);
  printf("rhs = ");
  dec2bin(rhs);
  printf("x = ");
  dec2bin(x);
  printf("x_bitmask = ");
  dec2bin(x_bitmask);
  printf("lhs = ");
  dec2bin(lhs);
  printf("lhs | rhs = ");
  dec2bin(lhs | rhs);
  return lhs | rhs;
}
```