// File: /workspace/github_cpp_makefile_star2_O3/WinChua[P]MLDemo/DecisionTree.cpp
// Function: TreeNode::test(File&)
double TreeNode::test(File &test_file)
{
    std::cout << "the size of test set is " << test_file.records.size() << std::endl;
    float tp=0, tn=0, fp=0, fn=0;
    for(auto record : test_file.records) {
        if(record.label == test(record))
            if(record.label == 1)
                tp += 1;
            else
                tn += 1;
        else
            if(record.label == 1)
                fp += 1;
            else
                fn += 1;
    }
    std::cout << "the true_positive is " << tp / (tp+fp) << std::endl;
    std::cout << "the false_positive is " << tn / (tn + fn) << std::endl;
    std::cout << "the recall is " << tp / (tp + fn) << std::endl;
    return tp / (tp+tn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0x61cd(%rip), %r14      # 0x8fd8
leaq 0x323d(%rip), %rsi      # 0x604f
movl $0x18, %edx
movq %r14, %rdi
callq 0x21d0
movq 0x28(%r15), %rax
subq 0x20(%r15), %rax
sarq $0x3, %rax
movabsq $0x6db6db6db6db6db7, %rsi # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %rsi
movq %r14, %rdi
callq 0x2110
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movq 0x20(%r15), %r14
movq 0x28(%r15), %r13
xorps %xmm0, %xmm0
cmpq %r13, %r14
je 0x2f42
movss %xmm0, (%rsp)
leaq 0x18(%rsp), %r15
leaq 0x10(%rsp), %r12
movss %xmm0, 0x4(%rsp)
movss %xmm0, 0xc(%rsp)
movss %xmm0, 0x8(%rsp)
movl (%r14), %eax
movl %eax, 0x10(%rsp)
addq $0x8, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x38ec
movl 0x10(%rsp), %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2d24
movl 0x10(%rsp), %ecx
cmpl %eax, %ebp
jne 0x2ee6
cmpl $0x1, %ecx
jne 0x2f01
movss (%rsp), %xmm0
addss 0x3161(%rip), %xmm0     # 0x6040
movss %xmm0, (%rsp)
jmp 0x2f2b
cmpl $0x1, %ecx
jne 0x2f17
movss 0xc(%rsp), %xmm0
addss 0x3147(%rip), %xmm0     # 0x6040
movss %xmm0, 0xc(%rsp)
jmp 0x2f2b
movss 0x4(%rsp), %xmm0
addss 0x3131(%rip), %xmm0     # 0x6040
movss %xmm0, 0x4(%rsp)
jmp 0x2f2b
movss 0x8(%rsp), %xmm0
addss 0x311b(%rip), %xmm0     # 0x6040
movss %xmm0, 0x8(%rsp)
movq %r15, %rdi
callq 0x3b7a
addq $0x30, %r14
cmpq %r13, %r14
jne 0x2ea0
jmp 0x2f59
movss %xmm0, 0x8(%rsp)
movss %xmm0, 0xc(%rsp)
movss %xmm0, 0x4(%rsp)
movss %xmm0, (%rsp)
movq 0x6078(%rip), %rbx      # 0x8fd8
leaq 0x3101(%rip), %rsi      # 0x6068
movl $0x15, %edx
movq %rbx, %rdi
callq 0x21d0
movss (%rsp), %xmm0
movss %xmm0, (%rsp)
movss 0xc(%rsp), %xmm1
addss %xmm0, %xmm1
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x2240
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
leaq 0x30b5(%rip), %rsi      # 0x607e
movl $0x16, %edx
movq %rbx, %rdi
callq 0x21d0
movss 0x8(%rsp), %xmm0
movss 0x4(%rsp), %xmm1
movss %xmm1, 0x4(%rsp)
addss %xmm1, %xmm0
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
movq %rbx, %rdi
callq 0x2240
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
leaq 0x3065(%rip), %rsi      # 0x6095
movl $0xe, %edx
movq %rbx, %rdi
callq 0x21d0
movss (%rsp), %xmm0
movss 0x8(%rsp), %xmm2
addss %xmm0, %xmm2
divss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x2240
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2120
movss 0x4(%rsp), %xmm0
movss (%rsp), %xmm1
addss %xmm1, %xmm0
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x3b7a
movq %rbx, %rdi
callq 0x2290