// File: /workspace/github_cpp_makefile_star2_O2/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:
leaq 0x2390a2(%rip), %rax    # 0x3296c0
andq $0x0, (%rax)
leaq 0x239087(%rip), %rcx    # 0x3296b0
andq $0x0, 0x34f24f(%rip)    # 0x43f880
movabsq $0x4000000000000000, %rdx # imm = 0x4000000000000000
andq $0x0, 0x34f245(%rip)    # 0x43f888
movq %rdx, (%rcx)
andq $0x0, 0x34f242(%rip)    # 0x43f890
andq $0x0, 0x34f1fa(%rip)    # 0x43f850
leaq 0x23902f(%rip), %rdx    # 0x32968c
andl $0x0, (%rdx)
cmpl $0x3, %edi
ja 0xf07a0
movl %edi, %esi
leaq 0x24d5e(%rip), %rdi     # 0x1153d0
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
leaq 0x23901e(%rip), %rdx    # 0x3296a0
leaq 0x23901f(%rip), %rsi    # 0x3296a8
andq $0x0, (%rsi)
movabsq $0x3fb999999999999a, %rsi # imm = 0x3FB999999999999A
movq %rsi, (%rdx)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, (%rcx)
leaq 0x23900a(%rip), %rcx    # 0x3296b8
movq %rdx, (%rcx)
movabsq $0x4049000000000000, %rcx # imm = 0x4049000000000000
jmp 0xf0762
leaq 0x238fd9(%rip), %rsi    # 0x3296a0
movabsq $0x3f9eb851eb851eb8, %rdi # imm = 0x3F9EB851EB851EB8
movq %rdi, (%rsi)
leaq 0x238fcd(%rip), %rsi    # 0x3296a8
andq $0x0, (%rsi)
movabsq $0x4059000000000000, %rsi # imm = 0x4059000000000000
movq %rsi, (%rcx)
leaq 0x238fc5(%rip), %rcx    # 0x3296b8
movabsq $0x407f400000000000, %rsi # imm = 0x407F400000000000
movq %rsi, (%rcx)
movabsq $0x4044000000000000, %rcx # imm = 0x4044000000000000
movq %rcx, (%rax)
movl $0x64, (%rdx)
jmp 0xf07a0
leaq 0x238f81(%rip), %rdx    # 0x3296a0
leaq 0x238f82(%rip), %rsi    # 0x3296a8
andq $0x0, (%rsi)
movabsq $0x3faeb851eb851eb8, %rsi # imm = 0x3FAEB851EB851EB8
movq %rsi, (%rdx)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, (%rcx)
leaq 0x238f6d(%rip), %rcx    # 0x3296b8
movabsq $0x406f400000000000, %rdx # imm = 0x406F400000000000
movq %rdx, (%rcx)
movabsq $0x4051800000000000, %rcx # imm = 0x4051800000000000
movq %rcx, (%rax)
jmp 0xf07a0
leaq 0x238f32(%rip), %rdx    # 0x3296a0
movabsq $0x3fb999999999999a, %rsi # imm = 0x3FB999999999999A
movq %rsi, (%rdx)
leaq 0x238f26(%rip), %rdx    # 0x3296a8
andq $0x0, (%rdx)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, (%rcx)
leaq 0x238f1e(%rip), %rcx    # 0x3296b8
movq %rdx, (%rcx)
movq %rdx, (%rax)
pushq %rbp
movq %rsp, %rbp
callq 0xf0596
popq %rbp
jmp 0xf02f3