user: Demonstrate the C code that generates the assembly output below:

```asm
<fc8300_tuner_set_pll>:
  endbr64
  push   %r15
  mov    %edx,%eax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rdx
  mov    %rdx,0x18(%rsp)
  xor    %edx,%edx
  lea    (%rax,%rax,2),%edx
  movb   $0x0,0x17(%rsp)
  lea    0x0(,%rdx,4),%ecx
  cmp    $0x5b8d80,%ecx
  ja     L163
  mov    %eax,%ecx
  shl    $0x4,%ecx
  cmp    $0x5b8d80,%ecx
  ja     L22
  lea    0x0(,%rdx,8),%ecx
  cmp    $0x5b8d80,%ecx
  ja     L135
  mov    %eax,%ecx
  shl    $0x5,%ecx
  cmp    $0x5b8d80,%ecx
  ja     L116
  mov    %edx,%ecx
  shl    $0x4,%ecx
  cmp    $0x5b8d80,%ecx
  ja     L178
  mov    %eax,%ecx
  shl    $0x6,%ecx
  cmp    $0x5b8d80,%ecx
  ja     L0
  shl    $0x5,%edx
  movl   $0xf,0x8(%rsp)
  mov    $0x60,%ecx
  cmp    $0x5b8d80,%edx
  ja     L41
L36:
  imul   %ecx,%eax
  movb   $0x4,0xf(%rsp)
  movzwl %bx,%ebx
  lea    0x17(%rsp),%r14
  mov    %eax,%r13d
  imul   $0x1b4e81b5,%r13,%r13
  mov    %r13,%rsi
  shr    $0x2e,%r13
  shr    $0x2b,%rsi
  and    $0x20,%r13d
  imul   $0x4b00,%esi,%edx
  mov    %rsi,%r15
  movzbl %r15b,%r15d
  sub    %edx,%eax
  shl    $0x10,%eax
  imul   $0x1b4e81b5,%rax,%rax
  shr    $0x27,%rax
  movzbl %ah,%esi
  mov    %eax,%edx
  movzbl %al,%eax
  or     $0x1,%eax
  shr    $0x10,%edx
  mov    %esi,(%rsp)
  mov    %eax,0x4(%rsp)
  add    %edx,%r13d
  movzbl %r13b,%r13d
L172:
  mov    $0x40,%ecx
  mov    $0x5f,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <fc8300_write@plt>
  mov    0x8(%rsp),%ecx
  mov    $0x51,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x4,%r12d
  call   <fc8300_write@plt>
  mov    %r13d,%ecx
  mov    $0x57,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <fc8300_write@plt>
  mov    (%rsp),%ecx
  mov    $0x58,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <fc8300_write@plt>
  mov    %r15d,%ecx
  mov    $0x5a,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <fc8300_write@plt>
  mov    0x4(%rsp),%ecx
  mov    $0x59,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <fc8300_write@plt>
  mov    $0xe3,%ecx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x50,%edx
  call   <fc8300_write@plt>
  mov    $0xff,%ecx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  mov    $0x50,%edx
  call   <fc8300_write@plt>
  mov    $0x2,%edi
  call   <msWait@plt>
  xor    %ecx,%ecx
  mov    $0x5f,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <fc8300_write@plt>
L10:
  mov    $0x2,%edi
  call   <msWait@plt>
  mov    %r14,%rcx
  mov    $0x64,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <fc8300_read@plt>
  movzbl 0x17(%rsp),%eax
  and    $0x11,%eax
  cmp    $0x11,%al
  je     L147
  sub    $0x1,%r12b
  jne    L10
  mov    %r14,%rcx
  mov    $0x74,%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <fc8300_read@plt>
  movzbl 0x17(%rsp),%edx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <vco_cal@plt>
  subb   $0x1,0xf(%rsp)
  jne    L172
L147:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L81
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L163:
  mov    $0x8,%ecx
  xor    %edx,%edx
  nopl   0x0(%rax)
L3:
  lea    0x1(%rdx,%rdx,1),%edx
  movzbl %dl,%esi
  mov    %esi,0x8(%rsp)
  jmp    L36
L22:
  mov    $0xc,%ecx
  mov    $0x1,%edx
  jmp    L3
L135:
  mov    $0x10,%ecx
  mov    $0x2,%edx
  jmp    L3
L116:
  mov    $0x18,%ecx
  mov    $0x3,%edx
  jmp    L3
L178:
  mov    $0x20,%ecx
  mov    $0x4,%edx
  jmp    L3
L0:
  mov    $0x30,%ecx
  mov    $0x5,%edx
  jmp    L3
L41:
  mov    $0x40,%ecx
  mov    $0x6,%edx
  jmp    L3
L81:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int fc8300_tuner_set_pll(void *handle, unsigned short devid, unsigned int freq, unsigned int offset) {
  unsigned char data_0x51, data_0x57, lo_select;
  unsigned int f_diff, f_diff_shifted, n_val, k_val, f_vco;
  unsigned int f_vco_max = 6000000;
  unsigned char lo_divide_ratio[8] = {8, 12, 16, 24, 32, 48, 64, 96};
  unsigned char pre_shift_bits = 4;
  unsigned char lock_detect = 0;
  unsigned char lock_condition = 0x11;
  unsigned char i, j;
  for (lo_select = 0; lo_select < 7; lo_select++)
    if (f_vco_max < freq * lo_divide_ratio[lo_select + 1])
      break;
  f_vco = freq * lo_divide_ratio[lo_select];
  n_val = f_vco / 19200;
  f_diff = f_vco - 19200 * n_val;
  f_diff_shifted = f_diff << (20 - pre_shift_bits);
  k_val = f_diff_shifted / (19200 >> pre_shift_bits);
  k_val = k_val | 1;
  data_0x57 = ((n_val >> 3) & 0x20);
  data_0x57 += (k_val >> 16);
  data_0x51 = 0x00;
  data_0x51 += (lo_select * 2) + 1;
  for (j = 0; j < 4; j++) {
    fc8300_write(handle, devid, 0x5f, 0x40);
    fc8300_write(handle, devid, 0x51, data_0x51);
    fc8300_write(handle, devid, 0x57, data_0x57);
    fc8300_write(handle, devid, 0x58, (unsigned char)((k_val >> 8) & 0xff));
    fc8300_write(handle, devid, 0x5a, (unsigned char)n_val);
    fc8300_write(handle, devid, 0x59, (unsigned char)((k_val)&0xff));
    fc8300_write(handle, devid, 0x50, 0xe3);
    fc8300_write(handle, devid, 0x50, 0xff);
    msWait(2);
    fc8300_write(handle, devid, 0x5f, 0x00);
    for (i = 1; i < 5; i++) {
      msWait(2);
      fc8300_read(handle, devid, 0x64, &lock_detect);
      if ((lock_detect & lock_condition) == lock_condition)
        break;
    }
    if ((lock_detect & lock_condition) != lock_condition) {
      fc8300_read(handle, devid, 0x74, &lock_detect);
      vco_cal(handle, devid, lock_detect);
    } else {
      break;
    }
  }
  return 0;
}
```