// File: /workspace/github_c_makefile_star2_O3/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 0x139f3
movq 0x28(%r14), %rax
cmpq %rax, 0x30(%r14)
je 0x1389d
movq %rax, 0x30(%r14)
movq 0x40(%r14), %rax
cmpq %rax, 0x48(%r14)
je 0x138ab
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 0x13948
movl 0x4(%rsp), %esi
leal 0x1(%rsi), %eax
cmpl $0x1b, %eax
jae 0x1396e
movq 0x30(%r14), %rax
cmpq 0x38(%r14), %rax
je 0x13910
movl %esi, (%rax)
addq $0x4, %rax
movq %rax, 0x30(%r14)
jmp 0x13920
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x4500
movq 0x48(%r14), %rsi
cmpq 0x50(%r14), %rsi
je 0x13939
movl (%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x48(%r14)
jmp 0x13944
movq %r12, %rdi
movq %r15, %rdx
callq 0x4500
incl %ebx
jmp 0x138ca
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 0xd65b(%rip), %rdi      # 0x20fd0
callq 0x3560
movq %rax, %r14
leaq 0x36cc(%rip), %rsi      # 0x17050
movl $0x1, %edx
movq %rax, %rdi
callq 0x3340
movl (%rsp), %esi
movq %r14, %rdi
callq 0x3560
movq %rax, %r14
leaq 0x36aa(%rip), %rsi      # 0x17050
movl $0x1, %edx
movq %rax, %rdi
callq 0x3340
movq %r14, %rdi
movl %ebx, %esi
callq 0x3560
movq %rax, %rdi
callq 0x3160
movq 0xd604(%rip), %rdi      # 0x20fd0
leaq 0x6037(%rip), %rsi      # 0x19a0a
movl $0x30, %edx
callq 0x3340
movq 0xd5ec(%rip), %rdi      # 0x20fd0
callq 0x3160
movl $0x1, %edi
callq 0x3370
movq 0xd5d6(%rip), %rdi      # 0x20fd0
leaq 0x5ff6(%rip), %rsi      # 0x199f7
movl $0x12, %edx
callq 0x3340
movq 0xd5be(%rip), %rdi      # 0x20fd0
movq %rbx, %rsi
callq 0x32c0
movq %rax, %rdi
callq 0x3160
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3370
jmp 0x13a30
jmp 0x13a30
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x3570
nop