// File: /workspace/github_c_makefile_star2_O1/stonezwr[P]SpiKL-IP/readout.C
// Function: Readout::LoadData(char*)
void Readout::LoadData(char * filename){ //Load the data from the file of speech results into multidata 
    ifstream f_in(filename);
    if(f_in.is_open() == false){
        cout<<"Cannot open file: "<<filename<<endl;
        exit(-1);
    }
    // string neuron_idx, t;

    // while(f_in>>neuron_index>>t){
    // 	int neuron_index = atoi(neuron_idx.c_str());
    // 	int time_f = atoi(t.c_str());
    multidata1.clear();
    multidata2.clear();
    int neuron_index, time_f;
    int count = 1;
    while(f_in>>neuron_index>>time_f){
        if(!(neuron_index >= -1 && neuron_index <= 25)){
            cout<<neuron_index<<"\t"<<time_f<<"\t"<<count<<endl;
            cout<<"The neuron index is possily out of bound!\n Exit!"<<endl;
            exit(EXIT_FAILURE);
        }

        assert(neuron_index >= -1 && neuron_index <= 25);
        multidata1.push_back(neuron_index);
        multidata2.push_back(time_f);
        count++;
    }
    f_in.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %rdi
movl $0x8, %edx
callq 0x35d0
leaq 0x88(%rsp), %rdi
callq 0x30b0
testb %al, %al
je 0x13d5f
movq 0x28(%r14), %rax
cmpq %rax, 0x30(%r14)
je 0x13c09
movq %rax, 0x30(%r14)
movq 0x40(%r14), %rax
cmpq %rax, 0x48(%r14)
je 0x13c17
movq %rax, 0x48(%r14)
leaq 0x28(%r14), %rax
movq %rax, 0x8(%rsp)
leaq 0x40(%r14), %r12
movl $0x1, %ebx
leaq 0x10(%rsp), %r13
leaq 0x4(%rsp), %rbp
movq %rsp, %r15
movq %r13, %rdi
movq %rbp, %rsi
callq 0x31a0
movq %rax, %rdi
movq %r15, %rsi
callq 0x31a0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x13cb4
movl 0x4(%rsp), %esi
leal 0x1(%rsi), %eax
cmpl $0x1b, %eax
jae 0x13cda
movq 0x30(%r14), %rax
cmpq 0x38(%r14), %rax
je 0x13c7c
movl %esi, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%r14)
jmp 0x13c8c
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x4476
movq 0x48(%r14), %rsi
cmpq 0x50(%r14), %rsi
je 0x13ca5
movl (%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%r14)
jmp 0x13cb0
movq %r12, %rdi
movq %r15, %rdx
callq 0x4476
incl %ebx
jmp 0x13c36
leaq 0x10(%rsp), %rdi
callq 0x30a0
leaq 0x10(%rsp), %rdi
callq 0x30d0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd2ef(%rip), %rdi      # 0x20fd0
callq 0x3560
movq %rax, %r14
leaq 0x3340(%rip), %rsi      # 0x17030
movl $0x1, %edx
movq %rax, %rdi
callq 0x3340
movl (%rsp), %esi
movq %r14, %rdi
callq 0x3560
movq %rax, %r14
leaq 0x331e(%rip), %rsi      # 0x17030
movl $0x1, %edx
movq %rax, %rdi
callq 0x3340
movq %r14, %rdi
movl %ebx, %esi
callq 0x3560
movq %rax, %rdi
callq 0x3160
movq 0xd298(%rip), %rdi      # 0x20fd0
leaq 0x5c2b(%rip), %rsi      # 0x1996a
movl $0x30, %edx
callq 0x3340
movq 0xd280(%rip), %rdi      # 0x20fd0
callq 0x3160
movl $0x1, %edi
callq 0x3370
movq 0xd26a(%rip), %rdi      # 0x20fd0
leaq 0x5bea(%rip), %rsi      # 0x19957
movl $0x12, %edx
callq 0x3340
movq 0xd252(%rip), %rdi      # 0x20fd0
movq %rbx, %rsi
callq 0x32c0
movq %rax, %rdi
callq 0x3160
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3370
jmp 0x13d9c
jmp 0x13d9c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x3570
nop