// File: /workspace/github_cpp_makefile_star2_O1/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 0x238da6(%rip), %rax    # 0x33f6c0
xorl %edx, %edx
movq %rdx, (%rax)
leaq 0x238d8a(%rip), %rcx    # 0x33f6b0
movabsq $0x4000000000000000, %rsi # imm = 0x4000000000000000
movq %rsi, (%rcx)
movq %rdx, 0x34f026(%rip)    # 0x455960
movq %rdx, 0x34f027(%rip)    # 0x455968
movq %rdx, 0x34f028(%rip)    # 0x455970
movq %rdx, 0x34efe1(%rip)    # 0x455930
leaq 0x238d36(%rip), %rdx    # 0x33f68c
movl $0x0, (%rdx)
cmpl $0x3, %edi
ja 0x106aa8
movl %edi, %esi
leaq 0x24b42(%rip), %rdi     # 0x12b4b0
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
leaq 0x238d22(%rip), %rdx    # 0x33f6a0
movabsq $0x3fb999999999999a, %rsi # imm = 0x3FB999999999999A
movq %rsi, (%rdx)
leaq 0x238d16(%rip), %rdx    # 0x33f6a8
movq $0x0, (%rdx)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, (%rcx)
leaq 0x238d0b(%rip), %rcx    # 0x33f6b8
movq %rdx, (%rcx)
movabsq $0x4049000000000000, %rcx # imm = 0x4049000000000000
jmp 0x106a67
leaq 0x238cda(%rip), %rsi    # 0x33f6a0
movabsq $0x3f9eb851eb851eb8, %rdi # imm = 0x3F9EB851EB851EB8
movq %rdi, (%rsi)
leaq 0x238cce(%rip), %rsi    # 0x33f6a8
movq $0x0, (%rsi)
movabsq $0x4059000000000000, %rsi # imm = 0x4059000000000000
movq %rsi, (%rcx)
leaq 0x238cc3(%rip), %rcx    # 0x33f6b8
movabsq $0x407f400000000000, %rsi # imm = 0x407F400000000000
movq %rsi, (%rcx)
movabsq $0x4044000000000000, %rcx # imm = 0x4044000000000000
movq %rcx, (%rax)
movl $0x64, (%rdx)
jmp 0x106aa8
leaq 0x238c7f(%rip), %rdx    # 0x33f6a0
movabsq $0x3faeb851eb851eb8, %rsi # imm = 0x3FAEB851EB851EB8
movq %rsi, (%rdx)
leaq 0x238c73(%rip), %rdx    # 0x33f6a8
movq $0x0, (%rdx)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, (%rcx)
leaq 0x238c68(%rip), %rcx    # 0x33f6b8
movabsq $0x406f400000000000, %rdx # imm = 0x406F400000000000
movq %rdx, (%rcx)
movabsq $0x4051800000000000, %rcx # imm = 0x4051800000000000
movq %rcx, (%rax)
jmp 0x106aa8
leaq 0x238c2d(%rip), %rdx    # 0x33f6a0
movabsq $0x3fb999999999999a, %rsi # imm = 0x3FB999999999999A
movq %rsi, (%rdx)
leaq 0x238c21(%rip), %rdx    # 0x33f6a8
movq $0x0, (%rdx)
movabsq $0x4059000000000000, %rdx # imm = 0x4059000000000000
movq %rdx, (%rcx)
leaq 0x238c16(%rip), %rcx    # 0x33f6b8
movq %rdx, (%rcx)
movq %rdx, (%rax)
pushq %rbp
movq %rsp, %rbp
callq 0x10688f
popq %rbp
jmp 0x10659d