// File: /workspace/github_cpp_makefile_star2_O1/fukunagatsu[P]LogicomeProfiler/logicome_profiler.cpp
// Function: LogicomeProfiler::CalcProbSecondCondition(int, int, int, double, double, double&, double&)
void LogicomeProfiler::CalcProbSecondCondition(int a,int b,int c,double logic,double threshold,double& prob2,double& prob3){
  int x = _logic_occurrence_tensor[a][b][logic];
  int y = _count_vector[c];
  int z = CountLogicOccurrence(a,b,c,logic);
   int N = _number_of_samples;
   
  if(logic == 1){
    int w1 = _logic_occurrence_tensor[a][c][1];
    int v1 = _count_vector[a];
    prob2 = CalcProb(x,w1,z,v1,threshold);
    
    int w2 = _logic_occurrence_tensor[b][c][1];
    int v2 = _count_vector[b];
    prob3 = CalcProb(x,w2,z,v2,threshold);
    
  }else if(logic == 2){
    
    int r = _logic_occurrence_tensor[a][b][1];
    int s1 = _logic_occurrence_tensor[a][c][5];
    int t = r - CountLogicOccurrence(a,b,c,1);
    int u1 =  _count_vector[a];
    prob2 = CalcProb(r,s1,t,u1,threshold);
    
    int s2 = _logic_occurrence_tensor[b][c][5];
    int u2 =  _count_vector[b];
    prob3 = CalcProb(r,s2,t,u2,threshold);
    
  }else if(logic == 3){
    
    int r = _logic_occurrence_tensor[a][b][4];
    int s1 = _logic_occurrence_tensor[a][c][4];
    int t = r - CountLogicOccurrence(a,b,c,4);
    int u1 =  _count_vector[a];
    prob2 = CalcProb(r,s1,t,N-u1,threshold);
    
    int s2 = _logic_occurrence_tensor[b][c][4];
    int u2 =  _count_vector[b];
    prob3 = CalcProb(r,s2,t,N-u2,threshold);
    
  }else if(logic == 4){
    
    int w1 = _logic_occurrence_tensor[c][a][5];
    int v1 = _count_vector[a];
    prob2 = CalcProb(x,w1,z,N-v1,threshold);
    
    int w2 = _logic_occurrence_tensor[c][b][5];
    int v2 = _count_vector[b];
    prob3 = CalcProb(x,w2,z,N-v2,threshold);
  }else if(logic == 5){
    
    int w1 = _logic_occurrence_tensor[a][c][1];
    int v1 = _count_vector[a];
    prob2 = CalcProb(x,w1,z,v1,threshold);
    
    int w2 = _logic_occurrence_tensor[c][b][5];
    int v2 = _count_vector[b];
    prob3 = CalcProb(x,w2,z,N-v2,threshold);
    
  }else if(logic == 6){
    int r = _logic_occurrence_tensor[a][b][5];
    int s1 = _logic_occurrence_tensor[a][c][5];
    int t = r - CountLogicOccurrence(a,b,c,5);
    int u1 =  _count_vector[a];
    prob2 = CalcProb(r,s1,t,u1,threshold);
    
    int s2 = _logic_occurrence_tensor[b][c][4];
    int u2 =  _count_vector[b];
    prob3 = CalcProb(r,s2,t,N-u2,threshold);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, 0x50(%rsp)
movq %r8, 0x18(%rsp)
movsd %xmm1, (%rsp)
movapd %xmm0, 0x30(%rsp)
movq %rdi, %r15
movslq %esi, %r14
movq (%rdi), %rsi
movq 0x30(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq (%r14,%r14,2), %rax
movslq %edx, %r13
movq %rsi, 0x28(%rsp)
movq %rax, 0x48(%rsp)
movq (%rsi,%rax,8), %rbp
leaq (%r13,%r13,2), %rdi
cvttsd2si %xmm0, %rax
movq %rax, %rdx
movapd %xmm0, %xmm1
subsd 0x383f(%rip), %xmm1     # 0x9048
cvttsd2si %xmm1, %rsi
sarq $0x3f, %rdx
andq %rdx, %rsi
orq %rax, %rsi
movq %rdi, 0x10(%rsp)
movq (%rbp,%rdi,8), %rbx
movl (%rbx,%rsi,4), %eax
movl %eax, 0x8(%rsp)
movslq %ecx, %r12
cvttsd2si %xmm0, %r8d
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %edx
movl %r12d, %ecx
callq 0x54a2
movapd 0x30(%rsp), %xmm1
movl %eax, %r9d
ucomisd 0x37fd(%rip), %xmm1     # 0x9050
jne 0x58ba
jp 0x58ba
shlq $0x3, %r12
leaq (%r12,%r12,2), %rbx
movq (%rbp,%rbx), %rax
movl 0x4(%rax), %edx
movq 0x20(%rsp), %rax
movl (%rax,%r14,4), %r8d
movq %r15, %rdi
movl 0x8(%rsp), %ebp
movl %ebp, %esi
movl %r9d, %ecx
movsd (%rsp), %xmm0
movl %r9d, %r14d
callq 0x5660
movq 0x18(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r15), %rax
movq 0x30(%r15), %rcx
movq 0x10(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movq (%rax,%rbx), %rax
movl 0x4(%rax), %edx
movl (%rcx,%r13,4), %r8d
movq %r15, %rdi
movl %ebp, %esi
movl %r14d, %ecx
jmp 0x5aa6
movq %rbx, %r8
movq 0x48(%rsp), %rdi
movq 0x28(%rsp), %rbx
movq %rbp, %rdx
movl 0x8(%rsp), %esi
movq %r15, %rbp
ucomisd 0x377f(%rip), %xmm1     # 0x9058
jne 0x596e
jp 0x596e
movl 0x4(%r8), %ebx
leaq (,%r12,8), %rax
leaq (%rax,%rax,2), %r15
movq (%rdx,%r15), %rax
movl 0x14(%rax), %eax
movl %eax, 0x8(%rsp)
movq %rbp, %rdi
movl %r14d, %esi
movl %r13d, %edx
movl %r12d, %ecx
movl $0x1, %r8d
callq 0x54a2
movl %ebx, %r12d
subl %eax, %r12d
movq 0x20(%rsp), %rax
movl (%rax,%r14,4), %r8d
movq %rbp, %rdi
movl %ebx, %esi
movl 0x8(%rsp), %edx
movl %r12d, %ecx
movsd (%rsp), %xmm0
callq 0x5660
movq 0x18(%rsp), %rax
movsd %xmm0, (%rax)
movq (%rbp), %rax
movq 0x30(%rbp), %rcx
movq 0x10(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movq (%rax,%r15), %rax
movl 0x14(%rax), %edx
movl (%rcx,%r13,4), %r8d
movq %rbp, %rdi
movl %ebx, %esi
movl %r12d, %ecx
jmp 0x5aa6
movq %rbp, %rax
movl 0x100(%rbp), %ebp
ucomisd 0x36e1(%rip), %xmm1     # 0x9060
movq %r13, %rcx
jne 0x5a26
jp 0x5a26
movl 0x10(%r8), %ebx
movq %rax, %r15
leaq (,%r12,8), %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0x8(%rsp)
movq (%rdx,%rax), %rax
movl 0x10(%rax), %eax
movl %eax, 0x30(%rsp)
movq %r15, %rdi
movl %r14d, %esi
movq %rcx, %r13
movl %r13d, %edx
movl %r12d, %ecx
movl $0x4, %r8d
callq 0x54a2
movl %ebx, %r12d
subl %eax, %r12d
movl %ebp, %r8d
movq 0x20(%rsp), %rax
subl (%rax,%r14,4), %r8d
movq %r15, %rdi
movl %ebx, %esi
movl 0x30(%rsp), %edx
movl %r12d, %ecx
movsd (%rsp), %xmm0
callq 0x5660
movq 0x18(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r15), %rax
movq 0x30(%r15), %rcx
movq 0x10(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movq 0x8(%rsp), %rdx
movq (%rax,%rdx), %rax
movl 0x10(%rax), %edx
subl (%rcx,%r13,4), %ebp
movq %r15, %rdi
movl %ebx, %esi
movl %r12d, %ecx
jmp 0x5aa3
ucomisd 0x363a(%rip), %xmm1     # 0x9068
jne 0x5ac8
jp 0x5ac8
shlq $0x3, %r12
leaq (%r12,%r12,2), %r15
movq %rax, %r12
movq (%rbx,%r15), %rax
movq (%rax,%rdi,8), %rax
movq %rcx, %rbx
movl 0x14(%rax), %edx
movl %ebp, %r8d
movq 0x20(%rsp), %rax
subl (%rax,%r14,4), %r8d
movq %r12, %rdi
movl %esi, %r14d
movl %r9d, %ecx
movsd (%rsp), %xmm0
movl %r9d, %r13d
callq 0x5660
movq 0x18(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r12), %rax
movq 0x30(%r12), %rcx
movq (%rax,%r15), %rax
movq 0x10(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movl 0x14(%rax), %edx
subl (%rcx,%rbx,4), %ebp
movq %r12, %rdi
movl %r14d, %esi
movl %r13d, %ecx
movl %ebp, %r8d
movsd (%rsp), %xmm0
callq 0x5660
movq 0x50(%rsp), %rax
movsd %xmm0, (%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, 0x28(%rsp)
ucomisd 0x359c(%rip), %xmm1     # 0x9070
movsd (%rsp), %xmm0
movq 0x18(%rsp), %rbp
movq 0x20(%rsp), %rcx
jne 0x5b3e
jp 0x5b3e
shlq $0x3, %r12
leaq (%r12,%r12,2), %rbx
movq %rax, %r15
movq (%rdx,%rbx), %rax
movl 0x4(%rax), %edx
movl (%rcx,%r14,4), %r8d
movq %r15, %rdi
movl %esi, %r14d
movl %r9d, %ecx
movl %r9d, %r12d
callq 0x5660
movsd %xmm0, (%rbp)
movq (%r15), %rax
movq 0x30(%r15), %rcx
movq (%rax,%rbx), %rax
movq 0x10(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movl 0x14(%rax), %edx
movl 0x28(%rsp), %r8d
subl (%rcx,%r13,4), %r8d
movq %r15, %rdi
movl %r14d, %esi
jmp 0x5966
ucomisd 0x3532(%rip), %xmm1     # 0x9078
jne 0x5ab9
jp 0x5ab9
movl 0x14(%r8), %ebx
movq %rax, %r15
leaq (,%r12,8), %rax
leaq (%rax,%rax,2), %rax
movq %rax, 0x8(%rsp)
movq (%rdx,%rax), %rax
movl 0x14(%rax), %eax
movl %eax, 0x30(%rsp)
movq %r15, %rdi
movq %rcx, %rbp
movl %r14d, %esi
movl %r13d, %edx
movl %r12d, %ecx
movl $0x5, %r8d
callq 0x54a2
movl %ebx, %r12d
subl %eax, %r12d
movl (%rbp,%r14,4), %r8d
movq %r15, %rdi
movl %ebx, %esi
movl 0x30(%rsp), %edx
movl %r12d, %ecx
movsd (%rsp), %xmm0
callq 0x5660
movq 0x18(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r15), %rax
movq 0x30(%r15), %rcx
movq 0x10(%rsp), %rdx
movq (%rax,%rdx,8), %rax
movq 0x8(%rsp), %rdx
movq (%rax,%rdx), %rax
movl 0x10(%rax), %edx
movl 0x28(%rsp), %r8d
subl (%rcx,%r13,4), %r8d
movq %r15, %rdi
jmp 0x5964