// File: /workspace/github_cpp_makefile_star2_O3/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 0x2386a1(%rip), %rax    # 0x33f6c0
xorl %edx, %edx
movq %rdx, (%rax)
leaq 0x238685(%rip), %rcx    # 0x33f6b0
movabsq $0x4000000000000000, %rsi # imm = 0x4000000000000000
movq %rsi, (%rcx)
movq %rdx, 0x34e841(%rip)    # 0x455880
movq %rdx, 0x34e842(%rip)    # 0x455888
movq %rdx, 0x34e843(%rip)    # 0x455890
movq %rdx, 0x34e7fc(%rip)    # 0x455850
leaq 0x238631(%rip), %rdx    # 0x33f68c
movl $0x0, (%rdx)
cmpl $0x3, %edi
ja 0x1071ad
movl %edi, %esi
leaq 0x2450d(%rip), %rdi     # 0x12b580
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
leaq 0x23861d(%rip), %rdx    # 0x33f6a0
movabsq $0x3fb999999999999a, %rsi # imm = 0x3FB999999999999A
movq %rsi, (%rdx)
leaq 0x238611(%rip), %rdx    # 0x33f6a8
movq $0x0, (%rdx)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, (%rcx)
leaq 0x238606(%rip), %rcx    # 0x33f6b8
movq %rdx, (%rcx)
movabsq $0x4049000000000000, %rcx # imm = 0x4049000000000000
jmp 0x10716c
leaq 0x2385d5(%rip), %rsi    # 0x33f6a0
movabsq $0x3f9eb851eb851eb8, %rdi # imm = 0x3F9EB851EB851EB8
movq %rdi, (%rsi)
leaq 0x2385c9(%rip), %rsi    # 0x33f6a8
movq $0x0, (%rsi)
movabsq $0x4059000000000000, %rsi # imm = 0x4059000000000000
movq %rsi, (%rcx)
leaq 0x2385be(%rip), %rcx    # 0x33f6b8
movabsq $0x407f400000000000, %rsi # imm = 0x407F400000000000
movq %rsi, (%rcx)
movabsq $0x4044000000000000, %rcx # imm = 0x4044000000000000
movq %rcx, (%rax)
movl $0x64, (%rdx)
jmp 0x1071ad
leaq 0x23857a(%rip), %rdx    # 0x33f6a0
movabsq $0x3faeb851eb851eb8, %rsi # imm = 0x3FAEB851EB851EB8
movq %rsi, (%rdx)
leaq 0x23856e(%rip), %rdx    # 0x33f6a8
movq $0x0, (%rdx)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, (%rcx)
leaq 0x238563(%rip), %rcx    # 0x33f6b8
movabsq $0x406f400000000000, %rdx # imm = 0x406F400000000000
movq %rdx, (%rcx)
movabsq $0x4051800000000000, %rcx # imm = 0x4051800000000000
movq %rcx, (%rax)
jmp 0x1071ad
leaq 0x238528(%rip), %rdx    # 0x33f6a0
movabsq $0x3fb999999999999a, %rsi # imm = 0x3FB999999999999A
movq %rsi, (%rdx)
leaq 0x23851c(%rip), %rdx    # 0x33f6a8
movq $0x0, (%rdx)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, (%rcx)
leaq 0x238511(%rip), %rcx    # 0x33f6b8
movq %rdx, (%rcx)
movq %rdx, (%rax)
pushq %rbp
movq %rsp, %rbp
callq 0x106f94
popq %rbp
jmp 0x106cb3