user: Translate the below assembly code into C programming language:

```asm
<fc8150_get_rssi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x18(%rbp)
  movb   $0x0,-0x1e(%rbp)
  movl   $0xffffff97,-0x14(%rbp)
  movl   $0x0,-0x1c(%rbp)
  movl   $0x5,-0x10(%rbp)
  movl   $0x2,-0xc(%rbp)
  lea    -0x22(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    $0xa3,%esi
  mov    %rax,%rdi
  call   <fc8150_read@plt>
  mov    %eax,-0x18(%rbp)
  lea    -0x21(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    $0xa4,%esi
  mov    %rax,%rdi
  call   <fc8150_read@plt>
  mov    %eax,-0x18(%rbp)
  lea    -0x20(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    $0xa8,%esi
  mov    %rax,%rdi
  call   <fc8150_read@plt>
  mov    %eax,-0x18(%rbp)
  lea    -0x1f(%rbp),%rdx
  mov    -0x38(%rbp),%rax
  mov    $0x106e,%esi
  mov    %rax,%rdi
  call   <fc8150_bb_read@plt>
  mov    %eax,-0x18(%rbp)
  cmpl   $0x0,-0x18(%rbp)
  je     L57
  mov    -0x18(%rbp),%eax
  jmp    L43
L57:
  movzbl -0x1f(%rbp),%eax
  test   %al,%al
  jns    L21
  movzbl -0x1f(%rbp),%eax
  movzbl %al,%eax
  sub    $0x101,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L49
L21:
  movzbl -0x1f(%rbp),%eax
  test   %al,%al
  js     L49
  movzbl -0x1f(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x1c(%rbp)
L49:
  movzbl -0x22(%rbp),%eax
  shr    $0x6,%al
  and    $0x1,%eax
  mov    %al,-0x1d(%rbp)
  movzbl -0x22(%rbp),%eax
  shr    $0x5,%al
  and    $0x1,%eax
  mov    %al,-0x1e(%rbp)
  movzbl -0x22(%rbp),%eax
  movzbl %al,%eax
  and    $0x7,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  movzbl -0x21(%rbp),%eax
  movzbl %al,%eax
  and    $0x1f,%eax
  lea    (%rdx,%rax,1),%ecx
  movzbl -0x20(%rbp),%eax
  movzbl %al,%eax
  and    $0x3,%eax
  mov    %eax,%edx
  movzbl -0x20(%rbp),%eax
  movzbl %al,%eax
  sar    $0x4,%eax
  and    $0x7,%eax
  add    %eax,%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  add    %eax,%eax
  add    %eax,%ecx
  mov    -0x1c(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  neg    %eax
  lea    (%rcx,%rax,1),%edx
  movzbl -0x1d(%rbp),%eax
  imul   -0x10(%rbp),%eax
  add    %eax,%edx
  movzbl -0x1e(%rbp),%eax
  imul   -0xc(%rbp),%eax
  add    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
L43:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L33
  call   <__stack_chk_fail@plt>
L33:
  leave
  ret
```

assistant: ```c
int fc8150_get_rssi(void *hDevice, int *rssi) {
  int res = 0;
  unsigned char LNA, RFVGA, CSF, PREAMP_PGA, CRNTMODE1, CRNTMODE0 = 0x00;
  int K = -105;
  int PGA = 0;
  int A2 = 5;
  int A3 = 2;
  res = fc8150_read(hDevice, 0xA3, &LNA);
  res = fc8150_read(hDevice, 0xA4, &RFVGA);
  res = fc8150_read(hDevice, 0xA8, &CSF);
  res = fc8150_bb_read(hDevice, 0x106E, &PREAMP_PGA);
  if (res != 0)
    return res;
  if (127 < PREAMP_PGA)
    PGA = -1 * ((256 - PREAMP_PGA) + 1);
  else if (PREAMP_PGA <= 127)
    PGA = PREAMP_PGA;
  CRNTMODE1 = (LNA >> 6) & 0x01;
  CRNTMODE0 = (LNA >> 5) & 0x01;
  *rssi = (LNA & 0x07) * 6 + (RFVGA & 0x1F) + ((CSF & 0x03) + ((CSF & 0x70) >> 4)) * 6 - PGA / 4 + A2 * CRNTMODE1 + A3 * CRNTMODE0 + K;
  return 0;
}
```