// File: /workspace/github_cpp_makefile_star2_O2/fukunagatsu[P]LogicomeProfiler/logicome_profiler.cpp
// Function: LogicomeProfiler::SecondScreeningForFWER()
void LogicomeProfiler::SecondScreeningForFWER(){
  int N = _number_of_samples;
  long long int ne = _number_of_elements;
  long long int max_size_count = 4*ne*(ne-1)*(ne-2); 
  double threshold = _alpha/max_size_count;
  ofstream ofs(_output_file_name.c_str());
  ofs << "significance_level " << threshold << endl;
  ofs << "Logic_formula Pv_of_condition_a Pv_of_condition_b Pv_of_condition_c Logic_type"<< endl;
  
  for(vector<Node>::iterator it = _result_vector.begin(); it != _result_vector.end(); ++it){    
    int a  = it->a;
    int b  = it->b;
    int c  = it->c;
    int logic = it->l;
    double prob2 = 0.0;
    double prob3 = 0.0;
    CalcProbSecondCondition(a,b,c,logic,threshold,prob2,prob3);

    if(prob2 < threshold && prob3 < threshold){
      ofs << _name_vector[c] << "=" << _name_vector[a] << "," << _name_vector[b] << " " << it->pv << " "<< prob2 << " "<< prob3 << " " << logic << endl;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, %rbx
movslq 0x104(%rdi), %r15
movsd 0x108(%rdi), %xmm0
movsd %xmm0, (%rsp)
movq 0xe0(%rdi), %rsi
leaq 0x28(%rsp), %r14
pushq $0x10
popq %rdx
movq %r14, %rdi
callq 0x21e0
leaq 0x4f8d(%rip), %rsi      # 0x80b3
movq %r14, %rdi
callq 0x21b0
leaq -0x1(%r15), %rcx
imulq %r15, %rcx
addq $-0x2, %r15
imulq %rcx, %r15
shlq $0x2, %r15
cvtsi2sd %r15, %xmm1
movsd (%rsp), %xmm0
divsd %xmm1, %xmm0
movq %rax, %rdi
movsd %xmm0, (%rsp)
callq 0x22d0
movq %rax, %rdi
callq 0x2100
leaq 0x4fae(%rip), %rsi      # 0x811a
leaq 0x28(%rsp), %rdi
callq 0x21b0
movq %rax, %rdi
callq 0x2100
movq 0x48(%rbx), %r12
cmpq 0x50(%rbx), %r12
je 0x32ea
movl (%r12), %r14d
movl 0x4(%r12), %ebp
movl 0x8(%r12), %r15d
movl 0xc(%r12), %r13d
andq $0x0, 0x10(%rsp)
andq $0x0, 0x8(%rsp)
cvtsi2sd %r13d, %xmm0
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %r15d, %ecx
movsd (%rsp), %xmm1
leaq 0x10(%rsp), %r8
leaq 0x8(%rsp), %r9
callq 0x40e6
movsd 0x10(%rsp), %xmm1
movsd (%rsp), %xmm0
movsd %xmm1, 0x20(%rsp)
ucomisd %xmm1, %xmm0
jbe 0x32e1
movsd 0x8(%rsp), %xmm1
movsd (%rsp), %xmm0
movsd %xmm1, 0x18(%rsp)
ucomisd %xmm1, %xmm0
jbe 0x32e1
movslq %r15d, %rsi
shlq $0x5, %rsi
addq 0xa8(%rbx), %rsi
leaq 0x28(%rsp), %rdi
callq 0x2190
movq %rax, %rdi
leaq 0x4eef(%rip), %rsi      # 0x8116
callq 0x21b0
movslq %r14d, %rsi
shlq $0x5, %rsi
addq 0xa8(%rbx), %rsi
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
leaq 0x4ecc(%rip), %rsi      # 0x8118
callq 0x21b0
movslq %ebp, %rsi
shlq $0x5, %rsi
addq 0xa8(%rbx), %rsi
movq %rax, %rdi
callq 0x2190
movq %rax, %rdi
leaq 0x4e54(%rip), %rsi      # 0x80c5
callq 0x21b0
movsd 0x10(%r12), %xmm0
movq %rax, %rdi
callq 0x22d0
movq %rax, %rdi
leaq 0x4e36(%rip), %rsi      # 0x80c5
callq 0x21b0
movq %rax, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x22d0
movq %rax, %rdi
leaq 0x4e19(%rip), %rsi      # 0x80c5
callq 0x21b0
movq %rax, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x22d0
movq %rax, %rdi
leaq 0x4dfc(%rip), %rsi      # 0x80c5
callq 0x21b0
movq %rax, %rdi
movl %r13d, %esi
callq 0x2300
movq %rax, %rdi
callq 0x2100
addq $0x18, %r12
jmp 0x3182
leaq 0x28(%rsp), %rdi
callq 0x2270
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3308
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2270
movq %rbx, %rdi
callq 0x2310
nop