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

```asm
<fc8080_get_rssi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  movb   $0x0,-0x17(%rbp)
  lea    -0x17(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0xab,%esi
  mov    %rax,%rdi
  call   <fc8080_read@plt>
  mov    %eax,-0xc(%rbp)
  movzbl -0x17(%rbp),%eax
  and    $0xf,%eax
  mov    %al,-0x14(%rbp)
  movzbl -0x17(%rbp),%eax
  shr    $0x7,%al
  mov    %al,-0x13(%rbp)
  lea    -0x1c(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0xac,%esi
  mov    %rax,%rdi
  call   <fc8080_read@plt>
  mov    %eax,-0xc(%rbp)
  movzbl -0x1c(%rbp),%eax
  and    $0x1f,%eax
  mov    %al,-0x1c(%rbp)
  lea    -0x1b(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0x14d,%esi
  mov    %rax,%rdi
  call   <fc8080_bb_read@plt>
  mov    %eax,-0xc(%rbp)
  movzbl -0x1b(%rbp),%eax
  and    $0x1f,%eax
  mov    %al,-0x1b(%rbp)
  lea    -0x1a(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0x14e,%esi
  mov    %rax,%rdi
  call   <fc8080_bb_read@plt>
  mov    %eax,-0xc(%rbp)
  movzbl -0x1a(%rbp),%eax
  test   %al,%al
  jns    L44
  movzbl -0x1a(%rbp),%eax
  movzbl %al,%eax
  sub    $0x101,%eax
  mov    %eax,-0x10(%rbp)
  jmp    L40
L44:
  movzbl -0x1a(%rbp),%eax
  test   %al,%al
  js     L40
  movzbl -0x1a(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x10(%rbp)
L40:
  lea    -0x19(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0xaf,%esi
  mov    %rax,%rdi
  call   <fc8080_read@plt>
  mov    %eax,-0xc(%rbp)
  lea    -0x17(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0xae,%esi
  mov    %rax,%rdi
  call   <fc8080_read@plt>
  mov    %eax,-0xc(%rbp)
  movzbl -0x17(%rbp),%eax
  and    $0xf,%eax
  mov    %al,-0x12(%rbp)
  movzbl -0x17(%rbp),%eax
  shr    $0x4,%al
  mov    %al,-0x11(%rbp)
  lea    -0x18(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0xad,%esi
  mov    %rax,%rdi
  call   <fc8080_read@plt>
  mov    %eax,-0xc(%rbp)
  movzbl -0x1b(%rbp),%eax
  cmp    $0x6,%al
  ja     L20
  movb   $0x0,-0x16(%rbp)
  movb   $0x0,-0x15(%rbp)
  jmp    L60
L20:
  movzbl -0x1b(%rbp),%eax
  cmp    $0x7,%al
  jne    L68
  movb   $0x0,-0x16(%rbp)
  movb   $0x1,-0x15(%rbp)
  jmp    L60
L68:
  movb   $0x1,-0x16(%rbp)
  movb   $0x0,-0x15(%rbp)
L60:
  movzbl -0x14(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %eax,%edx
  movzbl -0x1c(%rbp),%eax
  shr    %al
  movzbl %al,%eax
  lea    (%rdx,%rax,1),%ecx
  movzbl -0x1b(%rbp),%eax
  movzbl %al,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %eax,%ecx
  mov    -0x10(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  neg    %eax
  add    %eax,%ecx
  movzbl -0x19(%rbp),%eax
  movzbl %al,%edx
  movzbl -0x13(%rbp),%eax
  imul   %edx,%eax
  add    %eax,%ecx
  movzbl -0x12(%rbp),%edx
  movzbl -0x16(%rbp),%eax
  imul   %edx,%eax
  add    %eax,%ecx
  movzbl -0x11(%rbp),%edx
  movzbl -0x15(%rbp),%eax
  imul   %edx,%eax
  lea    (%rcx,%rax,1),%edx
  movzbl -0x18(%rbp),%eax
  movzbl %al,%eax
  sub    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0xc(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L47
  call   <__stack_chk_fail@plt>
L47:
  leave
  ret
```

assistant: ```c
int fc8080_get_rssi(void *handle, int *rssi) {
  int res = 0;
  int pga = 0;
  unsigned char lna, rfvga, filter, preamp_pga, a1, ext_lna, a2, a3, k, crntmode1, crntmode0;
  unsigned char temp = 0;
  res = fc8080_read(handle, 0xab, &temp);
  lna = temp & 0x0f;
  ext_lna = temp >> 7;
  res = fc8080_read(handle, 0xac, &rfvga);
  rfvga = rfvga & 0x1f;
  res = fc8080_bb_read(handle, 0x014d, &filter);
  filter = filter & 0x1f;
  res = fc8080_bb_read(handle, 0x014e, &preamp_pga);
  if (127 < preamp_pga)
    pga = -1 * ((256 - preamp_pga) + 1);
  else if (preamp_pga <= 127)
    pga = preamp_pga;
  res = fc8080_read(handle, 0xaf, &a1);
  res = fc8080_read(handle, 0xae, &temp);
  a2 = temp & 0x0f;
  a3 = temp >> 4;
  res = fc8080_read(handle, 0xad, &k);
  if (filter < 7) {
    crntmode1 = 0;
    crntmode0 = 0;
  } else if (filter == 7) {
    crntmode1 = 0;
    crntmode0 = 1;
  } else {
    crntmode1 = 1;
    crntmode0 = 0;
  }
  *rssi = (5 * lna + (rfvga / 2) + (6 * filter) - (pga / 4) + (a1 * ext_lna) + (a2 * crntmode1) + (a3 * crntmode0) - k);
  return res;
}
```