user: Please show me the C implementation that matches the assembly code listed below:

```asm
<fc8080_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
  mov    $0x0,%edx
  mov    $0x0,%esi
  call   <fc8080_write@plt>
  mov    $0x11,%edx
  mov    $0x2,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_set_filter@plt>
  mov    $0x78,%edx
  mov    $0xb3,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x9c,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x1,%edx
  mov    $0x9d,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x2,%edx
  mov    $0x9e,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xa,%edx
  mov    $0x9f,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x2a,%edx
  mov    $0xa0,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x32,%edx
  mov    $0xa1,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x52,%edx
  mov    $0xa2,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x56,%edx
  mov    $0xa3,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x76,%edx
  mov    $0xa4,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x7e,%edx
  mov    $0xa5,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x7f,%edx
  mov    $0xa6,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x9f,%edx
  mov    $0xa7,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xc0,%edx
  mov    $0xa8,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0xd0,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_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
L19:
  mov    %rbp,%rdx
  mov    $0xd8,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_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    L19
  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
  mov    $0x0,%eax
  call   <fc8080_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
L13:
  mov    %rbp,%rdx
  mov    $0xd6,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_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    L13
  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
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x26,%edx
  mov    $0x79,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x21,%edx
  mov    $0x7a,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xff,%edx
  mov    $0x7b,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x1b,%edx
  mov    $0x7c,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x18,%edx
  mov    $0x7d,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x84,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xd,%edx
  mov    $0x85,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x86,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x10,%edx
  mov    $0x87,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x88,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xe,%edx
  mov    $0x89,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x8a,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xe,%edx
  mov    $0x8b,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x3,%edx
  mov    $0x8c,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x10,%edx
  mov    $0x8d,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x8e,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x10,%edx
  mov    $0x8f,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x4,%edx
  mov    $0x90,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x10,%edx
  mov    $0x91,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x92,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x93,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x94,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xe,%edx
  mov    $0x95,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x96,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xe,%edx
  mov    $0x97,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x98,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xe,%edx
  mov    $0x99,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0x9a,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xe,%edx
  mov    $0x9b,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x3d,%edx
  mov    $0x80,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x20,%edx
  mov    $0x81,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x25,%edx
  mov    $0x82,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xa,%edx
  mov    $0x83,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0xd0,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x1d,%edx
  mov    $0xd2,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x33,%edx
  mov    $0xd4,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x36,%edx
  mov    $0xae,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x8b,%edx
  mov    $0xad,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x63,%edx
  mov    $0x14,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x2,%edx
  mov    $0x15,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x43,%edx
  mov    $0x18,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x21,%edx
  mov    $0x19,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x82,%edx
  mov    $0x27,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x33,%edx
  mov    $0x28,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x43,%edx
  mov    $0x33,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x41,%edx
  mov    $0x53,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x1,%edx
  mov    $0x54,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xf6,%edx
  mov    $0x66,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x14,%edx
  mov    $0xaf,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0x0,%edx
  mov    $0xb6,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xb0,%edx
  mov    $0xb8,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    $0xc4,%edx
  mov    $0xb9,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <fc8080_write@plt>
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L17
  mov    $0x0,%eax
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L17:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int fc8080_tuner_init(void *handle, unsigned int band) {
  int i;
  int n_rfagc_pd1_avg, n_rfagc_pd2_avg;
  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;
  fc8080_write(handle, 0x00, 0x00);
  fc8080_write(handle, 0x02, 0x11);
  fc8080_set_filter(handle);
  fc8080_write(handle, 0xb3, 0x78);
  fc8080_write(handle, 0x9c, 0x00);
  fc8080_write(handle, 0x9d, 0x01);
  fc8080_write(handle, 0x9e, 0x02);
  fc8080_write(handle, 0x9f, 0x0a);
  fc8080_write(handle, 0xa0, 0x2a);
  fc8080_write(handle, 0xa1, 0x32);
  fc8080_write(handle, 0xa2, 0x52);
  fc8080_write(handle, 0xa3, 0x56);
  fc8080_write(handle, 0xa4, 0x76);
  fc8080_write(handle, 0xa5, 0x7e);
  fc8080_write(handle, 0xa6, 0x7f);
  fc8080_write(handle, 0xa7, 0x9f);
  fc8080_write(handle, 0xa8, 0xc0);
  fc8080_write(handle, 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++) {
    fc8080_read(handle, 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;
  fc8080_write(handle, 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++) {
    fc8080_read(handle, 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;
  fc8080_write(handle, 0x7e, rfagc_pd2_avg);
  fc8080_write(handle, 0x79, 0x26);
  fc8080_write(handle, 0x7a, 0x21);
  fc8080_write(handle, 0x7b, 0xff);
  fc8080_write(handle, 0x7c, 0x1b);
  fc8080_write(handle, 0x7d, 0x18);
  fc8080_write(handle, 0x84, 0x00);
  fc8080_write(handle, 0x85, 0x0d);
  fc8080_write(handle, 0x86, 0x00);
  fc8080_write(handle, 0x87, 0x10);
  fc8080_write(handle, 0x88, 0x00);
  fc8080_write(handle, 0x89, 0x0e);
  fc8080_write(handle, 0x8a, 0x00);
  fc8080_write(handle, 0x8b, 0x0e);
  fc8080_write(handle, 0x8c, 0x03);
  fc8080_write(handle, 0x8d, 0x10);
  fc8080_write(handle, 0x8e, 0x00);
  fc8080_write(handle, 0x8f, 0x10);
  fc8080_write(handle, 0x90, 0x04);
  fc8080_write(handle, 0x91, 0x10);
  fc8080_write(handle, 0x92, 0x00);
  fc8080_write(handle, 0x93, 0x00);
  fc8080_write(handle, 0x94, 0x00);
  fc8080_write(handle, 0x95, 0x0e);
  fc8080_write(handle, 0x96, 0x00);
  fc8080_write(handle, 0x97, 0x0e);
  fc8080_write(handle, 0x98, 0x00);
  fc8080_write(handle, 0x99, 0x0e);
  fc8080_write(handle, 0x9a, 0x00);
  fc8080_write(handle, 0x9b, 0x0e);
  fc8080_write(handle, 0x80, 0x3d);
  fc8080_write(handle, 0x81, 0x20);
  fc8080_write(handle, 0x82, 0x25);
  fc8080_write(handle, 0x83, 0x0a);
  fc8080_write(handle, 0xd0, 0x00);
  fc8080_write(handle, 0xd2, 0x1d);
  fc8080_write(handle, 0xd4, 0x33);
  fc8080_write(handle, 0xae, 0x36);
  fc8080_write(handle, 0xad, 0x8b);
  fc8080_write(handle, 0x14, 0x63);
  fc8080_write(handle, 0x15, 0x02);
  fc8080_write(handle, 0x18, 0x43);
  fc8080_write(handle, 0x19, 0x21);
  fc8080_write(handle, 0x27, 0x82);
  fc8080_write(handle, 0x28, 0x33);
  fc8080_write(handle, 0x33, 0x43);
  fc8080_write(handle, 0x53, 0x41);
  fc8080_write(handle, 0x54, 0x01);
  fc8080_write(handle, 0x66, 0xf6);
  fc8080_write(handle, 0xaf, 0x14);
  fc8080_write(handle, 0xb6, 0x00);
  fc8080_write(handle, 0xb8, 0xb0);
  fc8080_write(handle, 0xb9, 0xc4);
  return 0;
}
```