// File: /workspace/github_cpp_makefile_star2_O3/liujan[P]randomforest/RandomForest.cpp
// Function: RandomForest::readTestSample(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool RandomForest::readTestSample(string file){
    ifstream test("test.csv");
    if (!test.is_open()){
        cout << "[Error] : Failed to open file " << file << endl;
        return false;
    }
    cout << "reading test sample ..." << endl;
    test_samples.clear();
    string s;
    getline(test, s); //过滤掉第一行标签
    
    double value;
    char dot;
    int id;
    
    while (true) {
        test >> id;
        if (test.eof())
            break;
        
        vector<double> features;
        for (int i = 0; i < numOfFeatures; i++){
            test >> dot;
            test >> value;
            features.push_back(value);
        }
        
        test_samples.push_back(make_pair(id, features));
        
        if (test.peek() == '\n')
            test.get();
    }
    
    test.close();
    cout << "reading test sample successful" << endl;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rsi, %r15
movq %rdi, %r12
leaq 0x1c4a(%rip), %rsi      # 0x7205
leaq -0x2a8(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x22b0
leaq -0x230(%rbp), %rdi
callq 0x2060
movl %eax, %r14d
testb %al, %al
je 0x5789
movq 0x49eb(%rip), %r15      # 0x9fd8
leaq 0x1c1a(%rip), %rsi      # 0x720e
movl $0x17, %edx
movq %r15, %rdi
callq 0x21e0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x49b9(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x2120
movb %r14b, -0x29(%rbp)
movq 0x18(%r12), %rsi
addq $0x18, %r12
movq %r12, -0x58(%rbp)
movq %r12, %rdi
callq 0x5c5c
leaq -0x70(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq -0x2a8(%rbp), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %edx
leaq -0x2a8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x22c0
leaq -0x2a8(%rbp), %r12
leaq -0x2a(%rbp), %rbx
leaq -0x60(%rbp), %r15
leaq -0x50(%rbp), %r13
movq %r12, %rdi
leaq -0x30(%rbp), %rsi
callq 0x2100
movq -0x2a8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x2, -0x288(%rbp,%rax)
jne 0x57e0
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x269, %r14d           # imm = 0x269
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2210
movq %r12, %rdi
movq %r15, %rsi
callq 0x2110
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x5703
movsd -0x60(%rbp), %xmm0
movsd %xmm0, (%rsi)
addq $0x8, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x570e
movq %r13, %rdi
movq %r15, %rdx
callq 0x596a
decl %r14d
jne 0x56d0
movl -0x30(%rbp), %eax
movl %eax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
movq %r13, %rsi
callq 0x293c
movq -0x58(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x5a90
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x5756
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq %r12, %rdi
callq 0x20c0
cmpl $0xa, %eax
jne 0x576b
movq %r12, %rdi
callq 0x2200
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x5696
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
jmp 0x5696
movq 0x4848(%rip), %rdi      # 0x9fd8
leaq 0x1a22(%rip), %rsi      # 0x71b9
movl $0x1e, %edx
callq 0x21e0
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq 0x4829(%rip), %rdi      # 0x9fd8
callq 0x21e0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
jmp 0x584f
leaq -0x2a8(%rbp), %rdi
callq 0x2050
movq 0x47e5(%rip), %rbx      # 0x9fd8
leaq 0x1a2c(%rip), %rsi      # 0x7226
movl $0x1e, %edx
movq %rbx, %rdi
callq 0x21e0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x47b3(%rip), %rdi      # 0x9fd8
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
movb -0x29(%rbp), %r14b
je 0x584f
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0x2a8(%rbp), %rdi
callq 0x2070
movl %r14d, %eax
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x589b
jmp 0x589b
movq %rax, %rbx
jmp 0x58d3
movq %rax, %rbx
movq -0x98(%rbp), %rdi
testq %rdi, %rdi
je 0x58a5
movq -0x88(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
jmp 0x58a5
jmp 0x58a2
movq %rax, %rbx
jmp 0x58ba
jmp 0x58a2
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x58ba
movq -0x40(%rbp), %rsi
subq %rdi, %rsi
callq 0x21b0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x58d3
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x21b0
leaq -0x2a8(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2290
nop