user: What is the c source code of the assembly code below:

```asm
<fc8150_tuner_init>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  lea    D0(%rip),%rsi
  call   <PRINTF@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x81,%edx
  mov    $0x2,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x2,%edx
  mov    $0x15,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x33,%edx
  mov    $0x20,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x62,%edx
  mov    $0x28,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0xaa,%edx
  mov    $0x35,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x28,%edx
  mov    $0x38,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x1,%edx
  mov    $0x3b,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    %rbx,%rdi
  call   <fc8150_set_filter@plt>
  mov    $0x0,%edx
  mov    $0x3b,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x1,%edx
  mov    $0x56,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x86,%edx
  mov    $0x57,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0xa7,%edx
  mov    $0x58,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x4d,%edx
  mov    $0x59,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x17,%edx
  mov    $0x80,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x48,%edx
  mov    $0xab,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0xc0,%edx
  mov    $0xa0,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x0,%edx
  mov    $0xd0,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  movb   $0x0,0x12(%rsp)
  movb   $0x0,0x13(%rsp)
  movb   $0x0,0x14(%rsp)
  movb   $0x0,0x15(%rsp)
  movb   $0x0,0x16(%rsp)
  movb   $0x0,0x17(%rsp)
  lea    0x12(%rsp),%rbp
  lea    0x18(%rsp),%r14
  mov    $0xffffffff,%r12d
  mov    $0x0,%r13d
L49:
  mov    %rbp,%rdx
  mov    $0xd8,%esi
  mov    %rbx,%rdi
  call   <fc8150_read@plt>
  movzbl 0x0(%rbp),%eax
  cmp    %al,%r13b
  cmovb  %eax,%r13d
  cmp    %al,%r12b
  cmova  %eax,%r12d
  add    $0x1,%rbp
  cmp    %rbp,%r14
  jne    L49
  movzbl 0x12(%rsp),%eax
  movzbl 0x13(%rsp),%edx
  add    %edx,%eax
  movzbl 0x14(%rsp),%edx
  add    %edx,%eax
  movzbl 0x15(%rsp),%edx
  add    %edx,%eax
  movzbl 0x16(%rsp),%edx
  add    %edx,%eax
  movzbl 0x17(%rsp),%edx
  add    %edx,%eax
  movzbl %r13b,%r13d
  sub    %r13d,%eax
  movzbl %r12b,%r12d
  sub    %r12d,%eax
  lea    0x3(%rax),%edx
  cmovns %eax,%edx
  sar    $0x2,%edx
  movzbl %dl,%edx
  mov    $0x7f,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  movb   $0x0,0xc(%rsp)
  movb   $0x0,0xd(%rsp)
  movb   $0x0,0xe(%rsp)
  movb   $0x0,0xf(%rsp)
  movb   $0x0,0x10(%rsp)
  movb   $0x0,0x11(%rsp)
  lea    0xc(%rsp),%rbp
  lea    0x12(%rsp),%r14
  mov    $0xffffffff,%r12d
  mov    $0x0,%r13d
L2:
  mov    %rbp,%rdx
  mov    $0xd6,%esi
  mov    %rbx,%rdi
  call   <fc8150_read@plt>
  movzbl 0x0(%rbp),%eax
  cmp    %al,%r13b
  cmovb  %eax,%r13d
  cmp    %al,%r12b
  cmova  %eax,%r12d
  add    $0x1,%rbp
  cmp    %r14,%rbp
  jne    L2
  movzbl 0xc(%rsp),%eax
  movzbl 0xd(%rsp),%edx
  add    %edx,%eax
  movzbl 0xe(%rsp),%edx
  add    %edx,%eax
  movzbl 0xf(%rsp),%edx
  add    %edx,%eax
  movzbl 0x10(%rsp),%edx
  add    %edx,%eax
  movzbl 0x11(%rsp),%edx
  add    %edx,%eax
  movzbl %r13b,%r13d
  sub    %r13d,%eax
  movzbl %r12b,%r12d
  sub    %r12d,%eax
  lea    0x3(%rax),%edx
  cmovns %eax,%edx
  sar    $0x2,%edx
  movzbl %dl,%edx
  mov    $0x7e,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  lea    0xb(%rsp),%rdx
  mov    $0xd6,%esi
  mov    %rbx,%rdi
  call   <fc8150_read@plt>
  cmpb   $0x0,0xb(%rsp)
  js     L18
  mov    $0x88,%edx
  mov    $0x7b,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
L17:
  mov    $0x32,%edx
  mov    $0x79,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x2c,%edx
  mov    $0x7a,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x12,%edx
  mov    $0x7c,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0xc,%edx
  mov    $0x7d,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0xa,%edx
  mov    $0x81,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x0,%edx
  mov    $0x84,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x0,%edx
  mov    $0x92,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0xc,%edx
  mov    $0x93,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x69,%edx
  mov    $0xa5,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x25,%edx
  mov    $0xa6,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    $0x81,%edx
  mov    $0x2,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L12
  mov    $0x0,%eax
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L18:
  mov    $0x8f,%edx
  mov    $0x7b,%esi
  mov    %rbx,%rdi
  call   <fc8150_write@plt>
  jmp    L17
L12:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D0
type_guessed: string

tool: D0: fc8150_init


assistant: ```c
int fc8150_tuner_init(void *hDevice, unsigned int band) {
  int i;
  int n_RFAGC_PD1_AVG, n_RFAGC_PD2_AVG;
  unsigned char RFPD_REF;
  unsigned char RFAGC_PD2[6], RFAGC_PD2_AVG, RFAGC_PD2_MAX, RFAGC_PD2_MIN;
  unsigned char RFAGC_PD1[6], RFAGC_PD1_AVG, RFAGC_PD1_MAX, RFAGC_PD1_MIN;
  PRINTF(hDevice, "fc8150_init\n");
  fc8150_write(hDevice, 0x00, 0x00);
  fc8150_write(hDevice, 0x02, 0x81);
  fc8150_write(hDevice, 0x15, 0x02);
  fc8150_write(hDevice, 0x20, 0x33);
  fc8150_write(hDevice, 0x28, 0x62);
  fc8150_write(hDevice, 0x35, 0xAA);
  fc8150_write(hDevice, 0x38, 0x28);
  fc8150_write(hDevice, 0x3B, 0x01);
  fc8150_set_filter(hDevice);
  fc8150_write(hDevice, 0x3B, 0x00);
  fc8150_write(hDevice, 0x56, 0x01);
  fc8150_write(hDevice, 0x57, 0x86);
  fc8150_write(hDevice, 0x58, 0xA7);
  fc8150_write(hDevice, 0x59, 0x4D);
  fc8150_write(hDevice, 0x80, 0x17);
  fc8150_write(hDevice, 0xAB, 0x48);
  fc8150_write(hDevice, 0xA0, 0xC0);
  fc8150_write(hDevice, 0xD0, 0x00);
  RFAGC_PD1[0] = 0;
  RFAGC_PD1[1] = 0;
  RFAGC_PD1[2] = 0;
  RFAGC_PD1[3] = 0;
  RFAGC_PD1[4] = 0;
  RFAGC_PD1[5] = 0;
  RFAGC_PD1_MAX = 0;
  RFAGC_PD1_MIN = 255;
  for (i = 0; i < 6; i++) {
    fc8150_read(hDevice, 0xD8, &RFAGC_PD1[i]);
    if (RFAGC_PD1[i] >= RFAGC_PD1_MAX)
      RFAGC_PD1_MAX = RFAGC_PD1[i];
    if (RFAGC_PD1[i] <= RFAGC_PD1_MIN)
      RFAGC_PD1_MIN = RFAGC_PD1[i];
  }
  n_RFAGC_PD1_AVG = (RFAGC_PD1[0] + RFAGC_PD1[1] + RFAGC_PD1[2] + RFAGC_PD1[3] + RFAGC_PD1[4] + RFAGC_PD1[5] - RFAGC_PD1_MAX - RFAGC_PD1_MIN) / 4;
  RFAGC_PD1_AVG = (unsigned char)n_RFAGC_PD1_AVG;
  fc8150_write(hDevice, 0x7F, RFAGC_PD1_AVG);
  RFAGC_PD2[0] = 0;
  RFAGC_PD2[1] = 0;
  RFAGC_PD2[2] = 0;
  RFAGC_PD2[3] = 0;
  RFAGC_PD2[4] = 0;
  RFAGC_PD2[5] = 0;
  RFAGC_PD2_MAX = 0;
  RFAGC_PD2_MIN = 255;
  for (i = 0; i < 6; i++) {
    fc8150_read(hDevice, 0xD6, &RFAGC_PD2[i]);
    if (RFAGC_PD2[i] >= RFAGC_PD2_MAX)
      RFAGC_PD2_MAX = RFAGC_PD2[i];
    if (RFAGC_PD2[i] <= RFAGC_PD2_MIN)
      RFAGC_PD2_MIN = RFAGC_PD2[i];
  }
  n_RFAGC_PD2_AVG = (RFAGC_PD2[0] + RFAGC_PD2[1] + RFAGC_PD2[2] + RFAGC_PD2[3] + RFAGC_PD2[4] + RFAGC_PD2[5] - RFAGC_PD2_MAX - RFAGC_PD2_MIN) / 4;
  RFAGC_PD2_AVG = (unsigned char)n_RFAGC_PD2_AVG;
  fc8150_write(hDevice, 0x7E, RFAGC_PD2_AVG);
  fc8150_read(hDevice, 0xD6, &RFPD_REF);
  if (0x80 <= RFPD_REF)
    fc8150_write(hDevice, 0x7B, 0x8F);
  else if (RFPD_REF < 0x80)
    fc8150_write(hDevice, 0x7B, 0x88);
  fc8150_write(hDevice, 0x79, 0x32);
  fc8150_write(hDevice, 0x7A, 0x2C);
  fc8150_write(hDevice, 0x7C, 0x12);
  fc8150_write(hDevice, 0x7D, 0x0C);
  fc8150_write(hDevice, 0x81, 0x0A);
  fc8150_write(hDevice, 0x84, 0x00);
  fc8150_write(hDevice, 0x92, 0x00);
  fc8150_write(hDevice, 0x93, 0x0C);
  fc8150_write(hDevice, 0xA5, 0x69);
  fc8150_write(hDevice, 0xA6, 0x25);
  fc8150_write(hDevice, 0x02, 0x81);
  return 0;
}
```