user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<fc8080_get_rssi>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rsi,%r12
  mov    $0xab,%esi
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x7(%rsp),%r15
  movb   $0x0,0x7(%rsp)
  mov    %r15,%rdx
  call   <fc8080_read@plt>
  lea    0x2(%rsp),%rdx
  mov    $0xac,%esi
  mov    %rbp,%rdi
  movzbl 0x7(%rsp),%ebx
  call   <fc8080_read@plt>
  lea    0x3(%rsp),%rdx
  mov    $0x14d,%esi
  mov    %rbp,%rdi
  andb   $0x1f,0x2(%rsp)
  mov    %ebx,%r13d
  shr    $0x7,%bl
  call   <fc8080_bb_read@plt>
  lea    0x4(%rsp),%rdx
  mov    $0x14e,%esi
  mov    %rbp,%rdi
  andb   $0x1f,0x3(%rsp)
  and    $0xf,%r13d
  call   <fc8080_bb_read@plt>
  movzbl 0x4(%rsp),%r14d
  mov    $0xaf,%esi
  mov    %rbp,%rdi
  test   %r14b,%r14b
  lea    -0x101(%r14),%edx
  cmovs  %edx,%r14d
  lea    0x5(%rsp),%rdx
  call   <fc8080_read@plt>
  mov    %r15,%rdx
  mov    $0xae,%esi
  mov    %rbp,%rdi
  call   <fc8080_read@plt>
  lea    0x6(%rsp),%rdx
  mov    $0xad,%esi
  mov    %rbp,%rdi
  movzbl 0x7(%rsp),%r15d
  call   <fc8080_read@plt>
  movzbl 0x3(%rsp),%edx
  mov    %eax,%r8d
  cmp    $0x6,%dl
  jbe    L25
  cmp    $0x7,%dl
  je     L40
  mov    %r15d,%ecx
  xor    %r15d,%r15d
  and    $0xf,%ecx
  jmp    L47
  nopl   (%rax)
L25:
  xor    %r15d,%r15d
  xor    %ecx,%ecx
L47:
  movzbl 0x2(%rsp),%eax
  movzbl %r13b,%r13d
  lea    (%rdx,%rdx,2),%edx
  movzbl %bl,%ebx
  lea    0x0(%r13,%r13,4),%esi
  shr    %al
  movzbl %al,%eax
  add    %esi,%eax
  test   %r14d,%r14d
  lea    (%rax,%rdx,2),%eax
  lea    0x3(%r14),%edx
  cmovns %r14d,%edx
  sar    $0x2,%edx
  sub    %edx,%eax
  movzbl 0x5(%rsp),%edx
  imul   %edx,%ebx
  movzbl 0x6(%rsp),%edx
  add    %ebx,%eax
  add    %ecx,%eax
  add    %r15d,%eax
  sub    %edx,%eax
  mov    %eax,(%r12)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L22
  add    $0x18,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L40:
  shr    $0x4,%r15b
  xor    %ecx,%ecx
  movzbl %r15b,%r15d
  jmp    L47
L22:
  call   <__stack_chk_fail@plt>
```

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;
}
```