// File: 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
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movsd %xmm0, -0x20(%rbp)
movsd %xmm1, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
movslq -0xc(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movsd -0x20(%rbp), %xmm0
movsd 0xe9ce(%rip), %xmm2     # 0x16038
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rax
cvttsd2si %xmm0, %rsi
movq %rsi, %rcx
sarq $0x3f, %rcx
andq %rcx, %rax
orq %rax, %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
addq $0x30, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
cvttsd2si -0x20(%rbp), %r8d
callq 0x6e90
movl %eax, %ecx
movq -0xc8(%rbp), %rax
movl %ecx, -0x44(%rbp)
movl 0x100(%rax), %eax
movl %eax, -0x48(%rbp)
movsd -0x20(%rbp), %xmm0
movsd 0xe948(%rip), %xmm1     # 0x16030
ucomisd %xmm1, %xmm0
jne 0x77d7
jp 0x77d7
movq -0xc8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x1, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x4c(%rbp)
addq $0x30, %rdi
movslq -0xc(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x50(%rbp)
movl -0x3c(%rbp), %esi
movl -0x4c(%rbp), %edx
movl -0x44(%rbp), %ecx
movl -0x50(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0xc8(%rbp), %rdi
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movslq -0x10(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x1, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x54(%rbp)
addq $0x30, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x58(%rbp)
movl -0x3c(%rbp), %esi
movl -0x54(%rbp), %edx
movl -0x44(%rbp), %ecx
movl -0x58(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x7e66
movsd -0x20(%rbp), %xmm0
movsd 0xe85c(%rip), %xmm1     # 0x16040
ucomisd %xmm1, %xmm0
jne 0x7932
jp 0x7932
movq -0xc8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x1, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
movslq -0xc(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x5, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x60(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0xcc(%rbp)
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl $0x1, %r8d
callq 0x6e90
movq -0xc8(%rbp), %rdi
movl %eax, %ecx
movl -0xcc(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x64(%rbp)
addq $0x30, %rdi
movslq -0xc(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x68(%rbp)
movl -0x5c(%rbp), %esi
movl -0x60(%rbp), %edx
movl -0x64(%rbp), %ecx
movl -0x68(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0xc8(%rbp), %rdi
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movslq -0x10(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x5, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
addq $0x30, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x70(%rbp)
movl -0x5c(%rbp), %esi
movl -0x6c(%rbp), %edx
movl -0x64(%rbp), %ecx
movl -0x70(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x7e64
movsd -0x20(%rbp), %xmm0
movsd 0xe709(%rip), %xmm1     # 0x16048
ucomisd %xmm1, %xmm0
jne 0x7aa1
jp 0x7aa1
movq -0xc8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x4, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x74(%rbp)
movslq -0xc(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x4, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x78(%rbp)
movl -0x74(%rbp), %eax
movl %eax, -0xd0(%rbp)
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl $0x4, %r8d
callq 0x6e90
movq -0xc8(%rbp), %rdi
movl %eax, %ecx
movl -0xd0(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x7c(%rbp)
addq $0x30, %rdi
movslq -0xc(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x80(%rbp)
movl -0x74(%rbp), %esi
movl -0x78(%rbp), %edx
movl -0x7c(%rbp), %ecx
movl -0x48(%rbp), %r8d
subl -0x80(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0xc8(%rbp), %rdi
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movslq -0x10(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x4, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x84(%rbp)
addq $0x30, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x88(%rbp)
movl -0x74(%rbp), %esi
movl -0x84(%rbp), %edx
movl -0x7c(%rbp), %ecx
movl -0x48(%rbp), %r8d
subl -0x88(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x7e62
movsd -0x20(%rbp), %xmm0
movsd 0xe5a2(%rip), %xmm1     # 0x16050
ucomisd %xmm1, %xmm0
jne 0x7bbd
jp 0x7bbd
movq -0xc8(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0xc(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x5, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
addq $0x30, %rdi
movslq -0xc(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x90(%rbp)
movl -0x3c(%rbp), %esi
movl -0x8c(%rbp), %edx
movl -0x44(%rbp), %ecx
movl -0x48(%rbp), %r8d
subl -0x90(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0xc8(%rbp), %rdi
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movslq -0x14(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x5, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x94(%rbp)
addq $0x30, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x98(%rbp)
movl -0x3c(%rbp), %esi
movl -0x94(%rbp), %edx
movl -0x44(%rbp), %ecx
movl -0x48(%rbp), %r8d
subl -0x98(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x7e60
movsd -0x20(%rbp), %xmm0
movsd 0xe48e(%rip), %xmm1     # 0x16058
ucomisd %xmm1, %xmm0
jne 0x7cd5
jp 0x7cd5
movq -0xc8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x1, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x9c(%rbp)
addq $0x30, %rdi
movslq -0xc(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xa0(%rbp)
movl -0x3c(%rbp), %esi
movl -0x9c(%rbp), %edx
movl -0x44(%rbp), %ecx
movl -0xa0(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0xc8(%rbp), %rdi
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movslq -0x14(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x5, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xa4(%rbp)
addq $0x30, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xa8(%rbp)
movl -0x3c(%rbp), %esi
movl -0xa4(%rbp), %edx
movl -0x44(%rbp), %ecx
movl -0x48(%rbp), %r8d
subl -0xa8(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x7e5e
movsd -0x20(%rbp), %xmm0
movsd 0xe37e(%rip), %xmm1     # 0x16060
ucomisd %xmm1, %xmm0
jne 0x7e5c
jp 0x7e5c
movq -0xc8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x5, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xac(%rbp)
movslq -0xc(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x5, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xb0(%rbp)
movl -0xac(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
movl $0x5, %r8d
callq 0x6e90
movq -0xc8(%rbp), %rdi
movl %eax, %ecx
movl -0xd4(%rbp), %eax
subl %ecx, %eax
movl %eax, -0xb4(%rbp)
addq $0x30, %rdi
movslq -0xc(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xb8(%rbp)
movl -0xac(%rbp), %esi
movl -0xb0(%rbp), %edx
movl -0xb4(%rbp), %ecx
movl -0xb8(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0xc8(%rbp), %rdi
movq -0x30(%rbp), %rax
movsd %xmm0, (%rax)
movslq -0x10(%rbp), %rsi
callq 0x8680
movq %rax, %rdi
movslq -0x14(%rbp), %rsi
callq 0x86a0
movq %rax, %rdi
movl $0x4, %esi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xbc(%rbp)
addq $0x30, %rdi
movslq -0x10(%rbp), %rsi
callq 0x86c0
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0xc0(%rbp)
movl -0xac(%rbp), %esi
movl -0xbc(%rbp), %edx
movl -0xb4(%rbp), %ecx
movl -0x48(%rbp), %r8d
subl -0xc0(%rbp), %r8d
movsd -0x28(%rbp), %xmm0
callq 0x74d0
movq -0x38(%rbp), %rax
movsd %xmm0, (%rax)
jmp 0x7e5e
jmp 0x7e60
jmp 0x7e62
jmp 0x7e64
jmp 0x7e66
addq $0xe0, %rsp
popq %rbp
retq
nop