// File: leonn[P]neuralNet/data/test_analysis/source/analysis.cpp
// Function: main
int main(int argc, char const *argv[]){
	ifstream testFile;
	int tests_cases=0, success=0;

	testFile.open(argv[1]);

	stringstream ss;
	while (!testFile.eof()) {

	 	string line;
	    string label;
	    int target;
	    long double output;

	    getline(testFile, line);
	    if (line.length()<2)
	   		continue;
		getline(testFile, line);
		ss.str(line);
	    ss >> label;
	    if (label.compare("Target_Output:") != 0) {
	        abort();
	    }

	    ss >> target;

		getline(testFile, line);
		ss.str(line);
	    ss >> label;
	    if (label.compare("Output:") != 0) {
	        abort();
	    }
	    ss >> output;

		output=sqrt(output*output);
		if (target==(int)round(output,1))
	    	success++;

	    tests_cases++;
    }
    cout<<success<<" of "<<tests_cases<<endl;

    cout<<"Accuracy = "<<((double)success/(double)tests_cases)*100<<"%"<<endl;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4b0, %rsp            # imm = 0x4B0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x218(%rbp), %rdi
movq %rdi, -0x428(%rbp)
callq 0x2110
movq -0x428(%rbp), %rdi
movl $0x0, -0x21c(%rbp)
movl $0x0, -0x220(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x8, %edx
callq 0x20b0
jmp 0x23bb
leaq -0x3b8(%rbp), %rdi
callq 0x20c0
jmp 0x23c9
jmp 0x23cb
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x218(%rbp,%rax), %rdi
callq 0x21a0
movb %al, -0x429(%rbp)
jmp 0x23eb
movb -0x429(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x23fc
jmp 0x2677
leaq -0x3d8(%rbp), %rdi
movq %rdi, -0x438(%rbp)
callq 0x2140
leaq -0x3f8(%rbp), %rdi
callq 0x2140
movq -0x438(%rbp), %rsi
leaq -0x218(%rbp), %rdi
callq 0x2030
jmp 0x2430
leaq -0x3d8(%rbp), %rdi
callq 0x2160
cmpq $0x2, %rax
jae 0x24ae
movl $0x2, -0x414(%rbp)
jmp 0x2649
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x27a1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x2795
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x3f8(%rbp), %rdi
callq 0x20a0
leaq -0x3d8(%rbp), %rdi
callq 0x20a0
jmp 0x2795
leaq -0x218(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x2030
jmp 0x24c3
leaq -0x3b8(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x2120
jmp 0x24d8
leaq -0x3b8(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x2130
jmp 0x24ed
leaq -0x3f8(%rbp), %rdi
leaq 0xb15(%rip), %rsi       # 0x3010
callq 0x2060
cmpl $0x0, %eax
je 0x250a
callq 0x2080
leaq -0x3b8(%rbp), %rdi
leaq -0x3fc(%rbp), %rsi
callq 0x2090
jmp 0x251f
leaq -0x218(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x2030
jmp 0x2534
leaq -0x3b8(%rbp), %rdi
leaq -0x3d8(%rbp), %rsi
callq 0x2120
jmp 0x2549
leaq -0x3b8(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x2130
jmp 0x255e
leaq -0x3f8(%rbp), %rdi
leaq 0xaab(%rip), %rsi       # 0x3017
callq 0x2060
cmpl $0x0, %eax
je 0x257b
callq 0x2080
leaq -0x3b8(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0x2050
jmp 0x2590
fldt -0x410(%rbp)
fmul %st, %st(0)
movq %rsp, %rax
fstpt (%rax)
callq 0x27f0
fstpt -0x444(%rbp)
jmp 0x25aa
fldt -0x444(%rbp)
fstpt -0x410(%rbp)
movl -0x3fc(%rbp), %eax
movl %eax, -0x454(%rbp)
fldt -0x410(%rbp)
movq %rsp, %rax
fld1
fstpt 0x10(%rax)
fstpt (%rax)
callq 0x2300
fstpt -0x450(%rbp)
jmp 0x25df
movl -0x454(%rbp), %eax
fldt -0x450(%rbp)
fnstcw -0x41a(%rbp)
movzwl -0x41a(%rbp), %ecx
orl $0xc00, %ecx            # imm = 0xC00
movw %cx, -0x41c(%rbp)
fldcw -0x41c(%rbp)
fistpl -0x418(%rbp)
fldcw -0x41a(%rbp)
movl -0x418(%rbp), %ecx
cmpl %ecx, %eax
jne 0x2630
movl -0x220(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x220(%rbp)
movl -0x21c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x21c(%rbp)
movl $0x0, -0x414(%rbp)
leaq -0x3f8(%rbp), %rdi
callq 0x20a0
leaq -0x3d8(%rbp), %rdi
callq 0x20a0
movl -0x414(%rbp), %eax
testl %eax, %eax
je 0x2672
jmp 0x266d
jmp 0x23cb
jmp 0x23cb
movl -0x220(%rbp), %esi
movq 0x2954(%rip), %rdi      # 0x4fd8
callq 0x2180
movq %rax, -0x460(%rbp)
jmp 0x2692
movq -0x460(%rbp), %rdi
leaq 0x97f(%rip), %rsi       # 0x301f
callq 0x20f0
movq %rax, -0x468(%rbp)
jmp 0x26ae
movq -0x468(%rbp), %rdi
movl -0x21c(%rbp), %esi
callq 0x2180
movq %rax, -0x470(%rbp)
jmp 0x26c9
movq -0x470(%rbp), %rdi
movq 0x28f1(%rip), %rsi      # 0x4fc8
callq 0x2100
jmp 0x26de
movq 0x28f3(%rip), %rdi      # 0x4fd8
leaq 0x938(%rip), %rsi       # 0x3024
callq 0x20f0
movq %rax, -0x478(%rbp)
jmp 0x26fa
movq -0x478(%rbp), %rdi
cvtsi2sdl -0x220(%rbp), %xmm0
cvtsi2sdl -0x21c(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd 0x8eb(%rip), %xmm1      # 0x3008
mulsd %xmm1, %xmm0
callq 0x21b0
movq %rax, -0x480(%rbp)
jmp 0x272f
movq -0x480(%rbp), %rdi
leaq 0x8f3(%rip), %rsi       # 0x3030
callq 0x20f0
movq %rax, -0x488(%rbp)
jmp 0x274b
movq -0x488(%rbp), %rdi
movq 0x286f(%rip), %rsi      # 0x4fc8
callq 0x2100
jmp 0x2760
movl $0x0, -0x4(%rbp)
movl $0x1, -0x414(%rbp)
leaq -0x3b8(%rbp), %rdi
callq 0x20d0
leaq -0x218(%rbp), %rdi
callq 0x2040
movl -0x4(%rbp), %eax
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbp
retq
leaq -0x3b8(%rbp), %rdi
callq 0x20d0
leaq -0x218(%rbp), %rdi
callq 0x2040
movq -0x228(%rbp), %rdi
callq 0x2190
nopl (%rax)