// File: fukunagatsu[P]LogicomeProfiler/logicome_profiler.cpp
// Function: LogicomeProfiler::ReadData()
void LogicomeProfiler::ReadData(){
  ifstream fp;
  fp.open(_input_data_file_name.c_str(), ios::in);
  if (!fp) {
    cout << "Cannot open " + _input_data_file_name << endl;
    exit(1);
  }
  char buf[1000000];
  fp.getline(buf, 1000000);
  char* tp;
  tp = strtok(buf, " ");
  _number_of_samples = atoi(tp);
  tp = strtok(NULL, " ");
  _number_of_elements = atoi(tp);
  _name_vector.reserve(_number_of_elements);
  fp.getline(buf, 1000000);
  
  _dataset.resize(_number_of_samples, vector<bool>(_number_of_elements, 0));
  for (int i = 0; i < _number_of_elements; i++){
    fp.getline(buf, 1000000);
    tp = strtok(buf, " ");
    _name_vector.push_back(string(tp));
    for(int j = 0; j < _number_of_samples; j++){
      tp = strtok(NULL, " ");
      _dataset[j][i] = atoi(tp) == 1 ? true : false;
    }
  }
  fp.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf4570, %rsp          # imm = 0xF4570
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf4500(%rbp)
leaq -0x210(%rbp), %rdi
movq %rdi, -0xf44f8(%rbp)
callq 0x2290
movq -0xf4500(%rbp), %rdi
addq $0xc0, %rdi
callq 0x20f0
movq -0xf44f8(%rbp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x2190
jmp 0x4b36
movq -0x210(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x210(%rbp,%rax), %rdi
callq 0x2120
movb %al, -0xf4501(%rbp)
jmp 0x4b56
movb -0xf4501(%rbp), %al
testb $0x1, %al
jne 0x4b65
jmp 0x4c09
movq -0xf4500(%rbp), %rdx
addq $0xc0, %rdx
leaq 0x115d7(%rip), %rsi     # 0x16151
leaq -0x240(%rbp), %rdi
callq 0x94f0
jmp 0x4b88
movq 0x1c449(%rip), %rdi     # 0x20fd8
leaq -0x240(%rbp), %rsi
callq 0x2210
movq %rax, -0xf4510(%rbp)
jmp 0x4ba4
movq -0xf4510(%rbp), %rdi
movq 0x1c416(%rip), %rsi     # 0x20fc8
callq 0x2260
jmp 0x4bb9
leaq -0x240(%rbp), %rdi
callq 0x2180
movl $0x1, %edi
callq 0x22a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x4fc8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x2180
jmp 0x4fc8
leaq -0x210(%rbp), %rdi
leaq -0xf4480(%rbp), %rsi
movl $0xf4240, %edx          # imm = 0xF4240
callq 0x20b0
jmp 0x4c23
leaq 0x11483(%rip), %rsi     # 0x160ad
movq %rsi, -0xf4518(%rbp)
leaq -0xf4480(%rbp), %rdi
callq 0x2340
movq %rax, -0xf4488(%rbp)
movq -0xf4488(%rbp), %rdi
callq 0x2330
movq -0xf4518(%rbp), %rsi
movl %eax, %ecx
movq -0xf4500(%rbp), %rax
movl %ecx, 0x100(%rax)
xorl %eax, %eax
movl %eax, %edi
callq 0x2340
movq %rax, -0xf4488(%rbp)
movq -0xf4488(%rbp), %rdi
callq 0x2330
movl %eax, %ecx
movq -0xf4500(%rbp), %rax
movl %ecx, 0x104(%rax)
movq %rax, %rdi
addq $0xa8, %rdi
movslq 0x104(%rax), %rsi
callq 0x9600
jmp 0x4ca9
leaq -0x210(%rbp), %rdi
leaq -0xf4480(%rbp), %rsi
movl $0xf4240, %edx          # imm = 0xF4240
callq 0x20b0
jmp 0x4cc3
movq -0xf4500(%rbp), %rax
movq %rax, %rcx
addq $0x18, %rcx
movq %rcx, -0xf4538(%rbp)
movslq 0x100(%rax), %rcx
movq %rcx, -0xf4530(%rbp)
movslq 0x104(%rax), %rax
movq %rax, -0xf4528(%rbp)
movb $0x0, -0xf44b1(%rbp)
leaq -0xf44b2(%rbp), %rdi
movq %rdi, -0xf4520(%rbp)
callq 0x97b0
movq -0xf4528(%rbp), %rsi
movq -0xf4520(%rbp), %rcx
leaq -0xf44b0(%rbp), %rdi
leaq -0xf44b1(%rbp), %rdx
callq 0x97d0
jmp 0x4d31
movq -0xf4530(%rbp), %rsi
movq -0xf4538(%rbp), %rdi
leaq -0xf44b0(%rbp), %rdx
callq 0x9700
jmp 0x4d4d
leaq -0xf44b0(%rbp), %rdi
callq 0x4220
leaq -0xf44b2(%rbp), %rdi
callq 0x9850
movl $0x0, -0xf44b8(%rbp)
movq -0xf4500(%rbp), %rcx
movl -0xf44b8(%rbp), %eax
cmpl 0x104(%rcx), %eax
jge 0x4fa5
leaq -0x210(%rbp), %rdi
leaq -0xf4480(%rbp), %rsi
movl $0xf4240, %edx          # imm = 0xF4240
callq 0x20b0
jmp 0x4da2
leaq 0x11304(%rip), %rsi     # 0x160ad
leaq -0xf4480(%rbp), %rdi
callq 0x2340
movq %rax, %rcx
movq -0xf4500(%rbp), %rax
movq %rcx, -0xf4488(%rbp)
addq $0xa8, %rax
movq %rax, -0xf4550(%rbp)
movq -0xf4488(%rbp), %rax
movq %rax, -0xf4548(%rbp)
leaq -0xf44d9(%rbp), %rdi
movq %rdi, -0xf4540(%rbp)
callq 0x23c0
movq -0xf4548(%rbp), %rsi
movq -0xf4540(%rbp), %rdx
leaq -0xf44d8(%rbp), %rdi
callq 0x22d0
jmp 0x4e10
movq -0xf4550(%rbp), %rdi
leaq -0xf44d8(%rbp), %rsi
callq 0x9870
jmp 0x4e25
leaq -0xf44d8(%rbp), %rdi
callq 0x2180
leaq -0xf44d9(%rbp), %rdi
callq 0x2270
movl $0x0, -0xf44e0(%rbp)
movq -0xf4500(%rbp), %rcx
movl -0xf44e0(%rbp), %eax
cmpl 0x100(%rcx), %eax
jge 0x4f8f
leaq 0x11246(%rip), %rsi     # 0x160ad
xorl %eax, %eax
movl %eax, %edi
callq 0x2340
movq %rax, -0xf4488(%rbp)
movq -0xf4488(%rbp), %rdi
callq 0x2330
movq -0xf4500(%rbp), %rdi
subl $0x1, %eax
sete %al
negb %al
movb %al, -0xf4561(%rbp)
addq $0x18, %rdi
movslq -0xf44e0(%rbp), %rsi
callq 0x90a0
movq %rax, %rdi
movslq -0xf44b8(%rbp), %rsi
callq 0x90c0
movq %rdx, -0xf4560(%rbp)
movq %rax, -0xf4558(%rbp)
jmp 0x4ec7
movb -0xf4561(%rbp), %al
movq -0xf4560(%rbp), %rcx
movq -0xf4558(%rbp), %rdx
movq %rdx, -0xf44f0(%rbp)
movq %rcx, -0xf44e8(%rbp)
movzbl %al, %esi
andl $0x1, %esi
leaq -0xf44f0(%rbp), %rdi
callq 0x98a0
movl -0xf44e0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf44e0(%rbp)
jmp 0x4e47
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x4f41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0xf44b0(%rbp), %rdi
callq 0x4220
leaq -0xf44b2(%rbp), %rdi
callq 0x9850
jmp 0x4fc8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
jmp 0x4f81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x218(%rbp)
movl %eax, -0x21c(%rbp)
leaq -0xf44d8(%rbp), %rdi
callq 0x2180
leaq -0xf44d9(%rbp), %rdi
callq 0x2270
jmp 0x4fc8
jmp 0x4f91
movl -0xf44b8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf44b8(%rbp)
jmp 0x4d6f
leaq -0x210(%rbp), %rdi
callq 0x2070
jmp 0x4fb3
leaq -0x210(%rbp), %rdi
callq 0x2090
addq $0xf4570, %rsp          # imm = 0xF4570
popq %rbp
retq
leaq -0x210(%rbp), %rdi
callq 0x2090
movq -0x218(%rbp), %rdi
callq 0x23b0