// File: /workspace/github_cpp_makefile_star2_O2/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 $0x38, %rsp
movq %r9, 0x30(%rsp)
movq %r8, 0x10(%rsp)
movsd %xmm1, (%rsp)
movapd %xmm0, 0x20(%rsp)
movq %rdi, %r13
movslq %esi, %r12
movq (%rdi), %rax
imulq $0x18, %r12, %r14
movslq %edx, %rbp
movq (%rax,%r14), %rax
imulq $0x18, %rbp, %rbx
cvttsd2si %xmm0, %rdx
movq %rdx, %rsi
movapd %xmm0, %xmm1
subsd 0x3f13(%rip), %xmm1     # 0x8048
cvttsd2si %xmm1, %rdi
sarq $0x3f, %rsi
andq %rsi, %rdi
orq %rdx, %rdi
movq (%rax,%rbx), %rax
movl (%rax,%rdi,4), %eax
movl %eax, 0x8(%rsp)
movslq %ecx, %r15
cvttsd2si %xmm0, %r8d
movq %r13, %rdi
movl %r12d, %esi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x3eea
movapd 0x20(%rsp), %xmm1
ucomisd 0x3edb(%rip), %xmm1     # 0x8050
jne 0x41d9
jp 0x41d9
movq (%r13), %rdx
movq 0x30(%r13), %rcx
movq (%rdx,%r14), %rdx
imulq $0x18, %r15, %r15
movq (%rdx,%r15), %rdx
movl 0x4(%rdx), %edx
movl (%rcx,%r12,4), %r8d
movq %r13, %rdi
movl 0x8(%rsp), %r14d
movl %r14d, %esi
movl %eax, %ecx
movsd (%rsp), %xmm0
movl %eax, %r12d
callq 0x4034
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r13), %rax
movq 0x30(%r13), %rcx
movq (%rax,%rbx), %rax
movq (%rax,%r15), %rax
movl 0x4(%rax), %edx
movl (%rcx,%rbp,4), %r8d
movq %r13, %rdi
movl %r14d, %esi
jmp 0x427d
movq %r12, %r9
movl 0x8(%rsp), %r11d
ucomisd 0x3e6f(%rip), %xmm1     # 0x8058
movq %rbx, 0x18(%rsp)
jne 0x42a2
jp 0x42a2
movq (%r13), %rax
movq (%rax,%r14), %rax
movq (%rax,%rbx), %rcx
movl 0x4(%rcx), %ebx
movq %r15, %rcx
imulq $0x18, %r15, %r15
movq (%rax,%r15), %rax
movl 0x14(%rax), %eax
movl %eax, 0x8(%rsp)
pushq $0x1
popq %r8
movq %r13, %rdi
movq %r9, %r14
movl %r14d, %esi
movl %ebp, %edx
callq 0x3eea
movl %ebx, %r12d
subl %eax, %r12d
movq 0x30(%r13), %rax
movl (%rax,%r14,4), %r8d
movq %r13, %rdi
movl %ebx, %esi
movl 0x8(%rsp), %edx
movl %r12d, %ecx
movsd (%rsp), %xmm0
callq 0x4034
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r13), %rax
movq 0x30(%r13), %rcx
movq 0x18(%rsp), %rdx
movq (%rax,%rdx), %rax
movq (%rax,%r15), %rax
movl 0x14(%rax), %edx
movl (%rcx,%rbp,4), %r8d
movq %r13, %rdi
movl %ebx, %esi
movl %r12d, %ecx
movsd (%rsp), %xmm0
callq 0x4034
movq 0x30(%rsp), %rax
movsd %xmm0, (%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x100(%r13), %edi
ucomisd 0x3daf(%rip), %xmm1     # 0x8060
movq %rbp, %rdx
movq %r15, %rcx
movq %r14, %r10
jne 0x4367
jp 0x4367
movq %r13, %r12
movq (%r13), %rax
movq (%rax,%r10), %rax
movq (%rax,%rbx), %rsi
movl 0x10(%rsi), %ebx
imulq $0x18, %rcx, %rsi
movq %rsi, 0x8(%rsp)
movq (%rax,%rsi), %rax
movl 0x10(%rax), %eax
movl %eax, 0x20(%rsp)
movl %edi, %r15d
pushq $0x4
popq %r8
movq %r13, %rdi
movq %r9, %r14
movl %r14d, %esi
movq %rdx, %rbp
callq 0x3eea
movl %ebx, %r13d
subl %eax, %r13d
movq 0x30(%r12), %rax
movl %r15d, %r8d
subl (%rax,%r14,4), %r8d
movq %r12, %rdi
movl %ebx, %esi
movl 0x20(%rsp), %edx
movl %r13d, %ecx
movsd (%rsp), %xmm0
callq 0x4034
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r12), %rax
movq 0x30(%r12), %rcx
movq 0x18(%rsp), %rdx
movq (%rax,%rdx), %rax
movq 0x8(%rsp), %rdx
movq (%rax,%rdx), %rax
movl 0x10(%rax), %edx
subl (%rcx,%rbp,4), %r15d
movq %r12, %rdi
movl %ebx, %esi
movl %r13d, %ecx
movl %r15d, %r8d
jmp 0x4280
ucomisd 0x3cf9(%rip), %xmm1     # 0x8068
jne 0x43e4
jp 0x43e4
imulq $0x18, %rcx, %r12
movq %r13, %r14
movq (%r13), %rsi
movq 0x30(%r13), %rcx
movq (%rsi,%r12), %rsi
movq (%rsi,%r10), %rsi
movq %rdx, %r15
movl 0x14(%rsi), %edx
movl %edi, %ebp
movl %edi, %r8d
subl (%rcx,%r9,4), %r8d
movq %r13, %rdi
movl %r11d, %r13d
movl %r11d, %esi
movl %eax, %ecx
movsd (%rsp), %xmm0
movl %eax, %ebx
callq 0x4034
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r14), %rax
movq 0x30(%r14), %rcx
movq (%rax,%r12), %rax
movq 0x18(%rsp), %rdx
movq (%rax,%rdx), %rax
movl 0x14(%rax), %edx
subl (%rcx,%r15,4), %ebp
movq %r14, %rdi
movl %r13d, %esi
movl %ebx, %ecx
movl %ebp, %r8d
jmp 0x4280
ucomisd 0x3c84(%rip), %xmm1     # 0x8070
movsd (%rsp), %xmm0
movq %r13, %r14
jne 0x445a
jp 0x445a
movl %r11d, %esi
movq (%r14), %rdx
movq 0x30(%r14), %r8
movq (%rdx,%r10), %rdx
imulq $0x18, %rcx, %r15
movq (%rdx,%r15), %rdx
movl 0x4(%rdx), %edx
movl %edi, %r12d
movl (%r8,%r9,4), %r8d
movq %r14, %rdi
movl %eax, %ecx
movl %r11d, %r13d
movl %eax, 0x20(%rsp)
callq 0x4034
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r14), %rax
movq 0x30(%r14), %rcx
movq (%rax,%r15), %rax
movq (%rax,%rbx), %rax
movl 0x14(%rax), %edx
subl (%rcx,%rbp,4), %r12d
movq %r14, %rdi
movl %r13d, %esi
movl 0x20(%rsp), %ecx
movl %r12d, %r8d
jmp 0x4280
ucomisd 0x3c16(%rip), %xmm1     # 0x8078
jne 0x4293
jp 0x4293
movq %r9, %r13
movq (%r14), %rax
movq (%rax,%r10), %rax
movq (%rax,%rbx), %rdx
movl 0x14(%rdx), %ebx
imulq $0x18, %rcx, %rdx
movq %rdx, 0x8(%rsp)
movq (%rax,%rdx), %rax
movl 0x14(%rax), %eax
movl %eax, 0x20(%rsp)
movl %edi, %r15d
pushq $0x5
popq %r8
movq %r14, %rdi
movl %r13d, %esi
movl %ebp, %edx
callq 0x3eea
movl %ebx, %r12d
subl %eax, %r12d
movq 0x30(%r14), %rax
movl (%rax,%r13,4), %r8d
movq %r14, %rdi
movl %ebx, %esi
movl 0x20(%rsp), %edx
movl %r12d, %ecx
movsd (%rsp), %xmm0
callq 0x4034
movq 0x10(%rsp), %rax
movsd %xmm0, (%rax)
movq (%r14), %rax
movq 0x30(%r14), %rcx
movq 0x18(%rsp), %rdx
movq (%rax,%rdx), %rax
movq 0x8(%rsp), %rdx
movq (%rax,%rdx), %rax
movl 0x10(%rax), %edx
subl (%rcx,%rbp,4), %r15d
movq %r14, %rdi
movl %ebx, %esi
movl %r12d, %ecx
jmp 0x435f
nop