// File: melop[P]admixem/testexpression.cpp
// Function: UITestExpression()
void UITestExpression() {

	Parser p("");
	
	
	p["chr1_30"] = 1;
	p["chr1_20"] = 0;
	
	
	double result = p.Evaluate ("if(chr1_30==chr1_20, 10000 , chr1_30 + chr1_20 * 2)");   // use in expression 
    
	cout << ( p.symbols_.find("chr1_31") == p.symbols_.end()? "true": "false") << endl;
	
	cout << result << endl;
	
	result = p.Evaluate ("if(chr1_30==0, sqrt(20000) , chr1_30 + chr1_10 * 2)");   // use in expression 
    
	cout << result << endl;

	result = p.Evaluate ("(chr1_30 == chr1_20)*3");   // use in expression 
    
	cout << result << endl;
	
	
	for(std::map<std::string,double>::iterator it = p.symbols_.begin(); it != p.symbols_.end(); ++it) 
	{
		
		cout << (it->first) << "\n"; //list all keys
	}


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0x8870
movq -0x1f0(%rbp), %rdx
leaq 0x2602(%rip), %rsi      # 0x772be
leaq -0xb8(%rbp), %rdi
callq 0xcb30
jmp 0x74cca
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2b2c0
jmp 0x74cdf
leaq -0xb8(%rbp), %rdi
callq 0x82e0
leaq -0xb9(%rbp), %rdi
callq 0x8540
leaq -0xf1(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x8870
movq -0x1f8(%rbp), %rdx
leaq 0x48db(%rip), %rsi      # 0x795f3
leaq -0xf0(%rbp), %rdi
callq 0xcb30
jmp 0x74d26
leaq -0x98(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x75360
movq %rax, -0x200(%rbp)
jmp 0x74d42
movq -0x200(%rbp), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
leaq -0xf0(%rbp), %rdi
callq 0x82e0
leaq -0xf1(%rbp), %rdi
callq 0x8540
leaq -0x119(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x8870
movq -0x208(%rbp), %rdx
leaq 0x486c(%rip), %rsi      # 0x795fb
leaq -0x118(%rbp), %rdi
callq 0xcb30
jmp 0x74d9d
leaq -0x98(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x75360
movq %rax, -0x210(%rbp)
jmp 0x74db9
movq -0x210(%rbp), %rax
movq $0x0, (%rax)
leaq -0x118(%rbp), %rdi
callq 0x82e0
leaq -0x119(%rbp), %rdi
callq 0x8540
leaq -0x149(%rbp), %rdi
movq %rdi, -0x218(%rbp)
callq 0x8870
movq -0x218(%rbp), %rdx
leaq 0x4803(%rip), %rsi      # 0x79603
leaq -0x148(%rbp), %rdi
callq 0xcb30
jmp 0x74e0e
leaq -0x98(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0xc2c0
movsd %xmm0, -0x220(%rbp)
jmp 0x74e2b
leaq -0x148(%rbp), %rdi
callq 0x82e0
leaq -0x149(%rbp), %rdi
callq 0x8540
movsd -0x220(%rbp), %xmm0
movsd %xmm0, -0x128(%rbp)
leaq -0x30(%rbp), %rax
movq %rax, -0x230(%rbp)
leaq -0x179(%rbp), %rdi
movq %rdi, -0x228(%rbp)
callq 0x8870
movq -0x228(%rbp), %rdx
leaq 0x47b8(%rip), %rsi      # 0x79637
leaq -0x178(%rbp), %rdi
callq 0xcb30
jmp 0x74e8d
movq -0x230(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x2da90
movq %rax, -0x238(%rbp)
jmp 0x74ea9
movq -0x238(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x107a0
movq %rax, -0x188(%rbp)
leaq -0x158(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x10770
movb %al, %cl
leaq 0x475c(%rip), %rax      # 0x7963f
leaq 0x2c37(%rip), %rsi      # 0x77b21
testb %cl, %cl
cmovneq %rax, %rsi
movq 0x35091(%rip), %rdi     # 0xa9f88
callq 0x84a0
movq %rax, -0x240(%rbp)
jmp 0x74f05
movq -0x240(%rbp), %rdi
movq 0x3501d(%rip), %rsi     # 0xa9f30
callq 0x8520
jmp 0x74f1a
leaq -0x178(%rbp), %rdi
callq 0x82e0
leaq -0x179(%rbp), %rdi
callq 0x8540
movsd -0x128(%rbp), %xmm0
movq 0x35047(%rip), %rdi     # 0xa9f88
callq 0x88c0
movq %rax, -0x248(%rbp)
jmp 0x74f4f
movq -0x248(%rbp), %rdi
movq 0x34fd3(%rip), %rsi     # 0xa9f30
callq 0x8520
jmp 0x74f64
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x8870
movq -0x250(%rbp), %rdx
leaq 0x46bf(%rip), %rsi      # 0x79644
leaq -0x1a8(%rbp), %rdi
callq 0xcb30
jmp 0x74f93
leaq -0x98(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
callq 0xc2c0
movsd %xmm0, -0x258(%rbp)
jmp 0x74fb0
movsd -0x258(%rbp), %xmm0
movsd %xmm0, -0x128(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x82e0
leaq -0x1a9(%rbp), %rdi
callq 0x8540
movsd -0x128(%rbp), %xmm0
movq 0x34fa1(%rip), %rdi     # 0xa9f88
callq 0x88c0
movq %rax, -0x260(%rbp)
jmp 0x74ff5
movq -0x260(%rbp), %rdi
movq 0x34f2d(%rip), %rsi     # 0xa9f30
callq 0x8520
jmp 0x7500a
leaq -0x1d1(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0x8870
movq -0x268(%rbp), %rdx
leaq 0x464d(%rip), %rsi      # 0x79678
leaq -0x1d0(%rbp), %rdi
callq 0xcb30
jmp 0x75039
leaq -0x98(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0xc2c0
movsd %xmm0, -0x270(%rbp)
jmp 0x75056
movsd -0x270(%rbp), %xmm0
movsd %xmm0, -0x128(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x82e0
leaq -0x1d1(%rbp), %rdi
callq 0x8540
movsd -0x128(%rbp), %xmm0
movq 0x34efb(%rip), %rdi     # 0xa9f88
callq 0x88c0
movq %rax, -0x278(%rbp)
jmp 0x7509b
movq -0x278(%rbp), %rdi
movq 0x34e87(%rip), %rsi     # 0xa9f30
callq 0x8520
jmp 0x750b0
leaq -0x98(%rbp), %rdi
addq $0x68, %rdi
callq 0x2b540
movq %rax, -0x1e0(%rbp)
leaq -0x98(%rbp), %rdi
addq $0x68, %rdi
callq 0x107a0
movq %rax, -0x1e8(%rbp)
leaq -0x1e0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x2b570
testb $0x1, %al
jne 0x750fa
jmp 0x75329
leaq -0x1e0(%rbp), %rdi
callq 0x2b5a0
movq %rax, %rsi
movq 0x34e78(%rip), %rdi     # 0xa9f88
callq 0x8410
movq %rax, -0x280(%rbp)
jmp 0x7511e
movq -0x280(%rbp), %rdi
leaq 0x20f0(%rip), %rsi      # 0x7721c
callq 0x84a0
jmp 0x75133
jmp 0x75135
leaq -0x1e0(%rbp), %rdi
callq 0x11700
jmp 0x750c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x75175
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x82e0
leaq -0xb9(%rbp), %rdi
callq 0x8540
jmp 0x7534a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x751b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x82e0
leaq -0xf1(%rbp), %rdi
callq 0x8540
jmp 0x7533e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x751fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x82e0
leaq -0x119(%rbp), %rdi
callq 0x8540
jmp 0x7533e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x7523e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x82e0
leaq -0x149(%rbp), %rdi
callq 0x8540
jmp 0x7533e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x75281
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x82e0
leaq -0x179(%rbp), %rdi
callq 0x8540
jmp 0x7533e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x7533e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x752db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x82e0
leaq -0x1a9(%rbp), %rdi
callq 0x8540
jmp 0x7533e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
jmp 0x7531b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc8(%rbp)
movl %eax, -0xcc(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x82e0
leaq -0x1d1(%rbp), %rdi
callq 0x8540
jmp 0x7533e
leaq -0x98(%rbp), %rdi
callq 0x2c990
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
leaq -0x98(%rbp), %rdi
callq 0x2c990
movq -0xc8(%rbp), %rdi
callq 0x8860
nopw %cs:(%rax,%rax)