// File: /workspace/github_cpp_makefile_star2_O3/fukunagatsu[P]LogicomeProfiler/logicome_profiler.cpp
// Function: LogicomeProfiler::CountLogicOccurrence(int, int, int, int)
int LogicomeProfiler::CountLogicOccurrence(int a, int b, int c, int l){
  int z  = 0;
  for(int i = 0; i < _number_of_samples;i++){
    switch(l){
    case 1:
      if(_dataset[i][a]==true && _dataset[i][b]==true && _dataset[i][c]==true){
	z += 1;
      }
      break;
    case 2:
      if(!(_dataset[i][a]==true && _dataset[i][b]==true) && _dataset[i][c]==true){
	z += 1;
      }
      break;
    case 3:
      if((_dataset[i][a]==true || _dataset[i][b]==true) && _dataset[i][c]==true){
	z += 1;
      }
      break;
    case 4:
      if((!(_dataset[i][a]==true || _dataset[i][b]==true)) && _dataset[i][c]==true){
	z += 1;
      }
      break;
    case 5:
      if(_dataset[i][a]==true && _dataset[i][b]!=true && _dataset[i][c]==true){
	z += 1;
      }
      break;
    case 6:
      if((_dataset[i][a]!=true || _dataset[i][b]==true) && _dataset[i][c]==true){
	z += 1;
      }
      break;
    }
  }
  return z;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x100(%rdi), %r12
testq %r12, %r12
jle 0x55d0
movl %ecx, %eax
movq 0x18(%rdi), %rdi
movslq %esi, %rcx
leal 0x3f(%rcx), %esi
testl %ecx, %ecx
cmovnsl %ecx, %esi
sarl $0x6, %esi
movslq %esi, %rsi
movabsq $-0x8000000000000000, %r15 # imm = 0x8000000000000000
leaq 0x3f(%r15), %r13
movq %rcx, %r9
andq %r13, %r9
xorl %r10d, %r10d
cmpq %r15, %r9
setbe %r10b
leaq -0x8(,%r10,8), %r9
movl $0x1, %r10d
shlq %cl, %r10
movl $0x1, %r11d
movslq %edx, %rcx
leal 0x3f(%rcx), %edx
testl %ecx, %ecx
cmovnsl %ecx, %edx
sarl $0x6, %edx
movslq %edx, %rdx
movq %rdx, -0x10(%rsp)
movq %rcx, %rdx
andq %r13, %rdx
xorl %r14d, %r14d
cmpq %r15, %rdx
setbe %r14b
movl $0x1, %ebx
shlq %cl, %rbx
movslq %eax, %rcx
leal 0x3f(%rcx), %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
leaq -0x8(,%r14,8), %rdx
movq %rdx, -0x18(%rsp)
sarl $0x6, %eax
movq %rcx, %rdx
andq %r13, %rdx
xorl %r13d, %r13d
cmpq %r15, %rdx
setbe %r13b
shlq %cl, %r11
movq %r11, %r14
cltq
movq %rax, -0x8(%rsp)
leaq -0x8(,%r13,8), %r15
shlq $0x3, %r12
leaq (%r12,%r12,4), %r12
xorl %r13d, %r13d
decl %r8d
leaq 0x3b95(%rip), %rbp      # 0x90a0
xorl %eax, %eax
cmpl $0x5, %r8d
ja 0x55c1
movslq (%rbp,%r8,4), %rdx
addq %rbp, %rdx
jmpq *%rdx
movq (%rdi,%r13), %rdx
leaq (%rdx,%rsi,8), %r11
testq %r10, (%r9,%r11)
jne 0x5596
jmp 0x55c1
movq (%rdi,%r13), %rdx
leaq (%rdx,%rsi,8), %r11
testq %r10, (%r9,%r11)
jne 0x5572
jmp 0x55c1
movq (%rdi,%r13), %rdx
leaq (%rdx,%rsi,8), %r11
testq %r10, (%r9,%r11)
jne 0x55aa
jmp 0x5596
movq (%rdi,%r13), %rdx
leaq (%rdx,%rsi,8), %r11
testq %r10, (%r9,%r11)
jne 0x55c1
jmp 0x5572
movq (%rdi,%r13), %rdx
leaq (%rdx,%rsi,8), %r11
testq %r10, (%r9,%r11)
je 0x55aa
movq -0x10(%rsp), %r11
leaq (%rdx,%r11,8), %r11
movq -0x18(%rsp), %rcx
testq %rbx, (%rcx,%r11)
jne 0x55c1
jmp 0x55aa
movq (%rdi,%r13), %rdx
leaq (%rdx,%rsi,8), %r11
testq %r10, (%r9,%r11)
je 0x55aa
movq -0x10(%rsp), %r11
leaq (%rdx,%r11,8), %r11
movq -0x18(%rsp), %rcx
testq %rbx, (%rcx,%r11)
je 0x55c1
movq -0x8(%rsp), %rcx
leaq (%rdx,%rcx,8), %rdx
movq (%r15,%rdx), %rdx
andq %r14, %rdx
cmpq $0x1, %rdx
sbbl $-0x1, %eax
addq $0x28, %r13
cmpq %r13, %r12
jne 0x550d
jmp 0x55d2
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop