// File: jkingan[P]ladyheather/heathmsc.cpp
// Function: set_default_osc_pid(int)
void set_default_osc_pid(int pid_num)
{
   // standard filter constants
   OSC_FILTER_OFFSET = 0.0;
   OSC_FILTER_TC = 2.0;
   osc_k6 = 0.0;
   osc_k7 = 0.0;
   osc_k8 = 0.0;
   osc_integrator = 0.0;
   osc_postfilter = 0;

   if(pid_num == 0) {        // slower PPS recovery
      OSC_P_GAIN = 0.1;     
      OSC_D_TC = 0.0;         
      OSC_FILTER_TC = 100.0; 
      OSC_I_TC = 100.0;      
      OSC_FILTER_OFFSET = 50.0;
   }
   else if(pid_num == 1) {   // faster, noiser PPS recovery
      OSC_P_GAIN = 0.1;     
      OSC_D_TC = 0.0;         
      OSC_FILTER_TC = 100.0; 
      OSC_I_TC = 100.0;      
      OSC_FILTER_OFFSET = 100.0;
   }
   else if(pid_num == 2) {   // John's fancy pants oscillator
      OSC_P_GAIN = 0.03;    
      OSC_D_TC = 0.0;         
      OSC_FILTER_TC = 100.0; 
      OSC_I_TC = 500.0;      
      OSC_FILTER_OFFSET = 40.0;
      osc_postfilter = 100;
   }
   else if(pid_num == 3) {   // TBD
      OSC_P_GAIN = 0.06;    
      OSC_D_TC = 0.0;         
      OSC_FILTER_TC = 100.0; 
      OSC_I_TC = 250.0;      
      OSC_FILTER_OFFSET = 70.0;
   }

   new_postfilter();
   calc_osc_k_factors();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
leaq 0x23344e(%rip), %rax    # 0x39e8a0
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x233430(%rip), %rax    # 0x39e890
movsd 0x3ce8(%rip), %xmm0     # 0x16f150
movsd %xmm0, (%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x3499f9(%rip)   # 0x4b4e70
xorps %xmm0, %xmm0
movsd %xmm0, 0x3499f6(%rip)   # 0x4b4e78
xorps %xmm0, %xmm0
movsd %xmm0, 0x3499f3(%rip)   # 0x4b4e80
xorps %xmm0, %xmm0
movsd %xmm0, 0x3499a8(%rip)   # 0x4b4e40
leaq 0x2333cd(%rip), %rax    # 0x39e86c
movl $0x0, (%rax)
cmpl $0x0, -0x4(%rbp)
jne 0x16b50a
leaq 0x2333ce(%rip), %rax    # 0x39e880
movsd 0x3c6e(%rip), %xmm0     # 0x16f128
movsd %xmm0, (%rax)
leaq 0x2333c3(%rip), %rax    # 0x39e888
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x2333bd(%rip), %rax    # 0x39e890
movsd 0x3b75(%rip), %xmm0     # 0x16f050
movsd %xmm0, (%rax)
leaq 0x2333b2(%rip), %rax    # 0x39e898
movsd 0x3b62(%rip), %xmm0     # 0x16f050
movsd %xmm0, (%rax)
leaq 0x2333a7(%rip), %rax    # 0x39e8a0
movsd 0x3cc7(%rip), %xmm0     # 0x16f1c8
movsd %xmm0, (%rax)
jmp 0x16b644
cmpl $0x1, -0x4(%rbp)
jne 0x16b56f
leaq 0x233369(%rip), %rax    # 0x39e880
movsd 0x3c09(%rip), %xmm0     # 0x16f128
movsd %xmm0, (%rax)
leaq 0x23335e(%rip), %rax    # 0x39e888
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x233358(%rip), %rax    # 0x39e890
movsd 0x3b10(%rip), %xmm0     # 0x16f050
movsd %xmm0, (%rax)
leaq 0x23334d(%rip), %rax    # 0x39e898
movsd 0x3afd(%rip), %xmm0     # 0x16f050
movsd %xmm0, (%rax)
leaq 0x233342(%rip), %rax    # 0x39e8a0
movsd 0x3aea(%rip), %xmm0     # 0x16f050
movsd %xmm0, (%rax)
jmp 0x16b642
cmpl $0x2, -0x4(%rbp)
jne 0x16b5de
leaq 0x233304(%rip), %rax    # 0x39e880
movsd 0x17924(%rip), %xmm0    # 0x182ea8
movsd %xmm0, (%rax)
leaq 0x2332f9(%rip), %rax    # 0x39e888
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x2332f3(%rip), %rax    # 0x39e890
movsd 0x3aab(%rip), %xmm0     # 0x16f050
movsd %xmm0, (%rax)
leaq 0x2332e8(%rip), %rax    # 0x39e898
movsd 0x3c38(%rip), %xmm0     # 0x16f1f0
movsd %xmm0, (%rax)
leaq 0x2332dd(%rip), %rax    # 0x39e8a0
movsd 0x3c95(%rip), %xmm0     # 0x16f260
movsd %xmm0, (%rax)
leaq 0x233296(%rip), %rax    # 0x39e86c
movl $0x64, (%rax)
jmp 0x16b640
cmpl $0x3, -0x4(%rbp)
jne 0x16b63e
leaq 0x233295(%rip), %rax    # 0x39e880
movsd 0x178c5(%rip), %xmm0    # 0x182eb8
movsd %xmm0, (%rax)
leaq 0x23328a(%rip), %rax    # 0x39e888
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
leaq 0x233284(%rip), %rax    # 0x39e890
movsd 0x3a3c(%rip), %xmm0     # 0x16f050
movsd %xmm0, (%rax)
leaq 0x233279(%rip), %rax    # 0x39e898
movsd 0x3a21(%rip), %xmm0     # 0x16f048
movsd %xmm0, (%rax)
leaq 0x23326e(%rip), %rax    # 0x39e8a0
movsd 0x17c76(%rip), %xmm0    # 0x1832b0
movsd %xmm0, (%rax)
jmp 0x16b640
jmp 0x16b642
jmp 0x16b644
callq 0x16b380
callq 0x16af10
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)