// File: /workspace/github_c_makefile_star2_O2/codeplea[P]tinyexpr/smoke.c
// Function: test_variables
void test_variables() {

    double x, y, test;
    te_variable lookup[] = {{"x", &x}, {"y", &y}, {"te_st", &test}};

    int err;

    te_expr *expr1 = te_compile("cos x + sin y", lookup, 2, &err);
    lok(expr1);
    lok(!err);

    te_expr *expr2 = te_compile("x+x+x-y", lookup, 2, &err);
    lok(expr2);
    lok(!err);

    te_expr *expr3 = te_compile("x*y^3", lookup, 2, &err);
    lok(expr3);
    lok(!err);

    te_expr *expr4 = te_compile("te_st+5", lookup, 3, &err);
    lok(expr4);
    lok(!err);

    for (y = 2; y < 3; ++y) {
        for (x = 0; x < 5; ++x) {
            double ev;

            ev = te_eval(expr1);
            lfequal(ev, cos(x) + sin(y));

            ev = te_eval(expr2);
            lfequal(ev, x+x+x-y);

            ev = te_eval(expr3);
            lfequal(ev, x*y*y*y);

            test = x;
            ev = te_eval(expr4);
            lfequal(ev, x+5);
        }
    }

    te_free(expr1);
    te_free(expr2);
    te_free(expr3);
    te_free(expr4);



    te_expr *expr5 = te_compile("xx*y^3", lookup, 2, &err);
    lok(!expr5);
    lok(err);

    te_expr *expr6 = te_compile("tes", lookup, 3, &err);
    lok(!expr6);
    lok(err);

    te_expr *expr7 = te_compile("sinn x", lookup, 2, &err);
    lok(!expr7);
    lok(err);

    te_expr *expr8 = te_compile("si x", lookup, 2, &err);
    lok(!expr8);
    lok(err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
leaq 0x4d10(%rip), %rax      # 0x8597
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x8(%rsp), %rax
movq %rax, 0x8(%rsi)
andl $0x0, 0x10(%rsi)
andq $0x0, 0x18(%rsi)
leaq 0x4c84(%rip), %rax      # 0x852c
movq %rax, 0x20(%rsi)
leaq 0x10(%rsp), %rax
movq %rax, 0x28(%rsi)
andl $0x0, 0x30(%rsi)
andq $0x0, 0x38(%rsi)
leaq 0x4c55(%rip), %rax      # 0x851a
movq %rax, 0x40(%rsi)
leaq 0x28(%rsp), %rax
movq %rax, 0x48(%rsi)
andl $0x0, 0x50(%rsi)
andq $0x0, 0x58(%rsi)
leaq 0x4c3e(%rip), %rdi      # 0x8520
pushq $0x2
popq %rdx
leaq 0x4(%rsp), %rcx
callq 0x6b26
movq %rax, %rbx
movl 0x8804(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x87fc(%rip)      # 0xc0fc
testq %rbx, %rbx
jne 0x392b
incl 0x87f5(%rip)            # 0xc100
leaq 0x4aa3(%rip), %rdi      # 0x83b5
leaq 0x4aaa(%rip), %rsi      # 0x83c3
movl $0x11f, %edx            # imm = 0x11F
xorl %eax, %eax
callq 0x3090
movl 0x87d1(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x87c9(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
je 0x395a
incl 0x87c0(%rip)            # 0xc100
leaq 0x4a6e(%rip), %rdi      # 0x83b5
leaq 0x4a75(%rip), %rsi      # 0x83c3
movl $0x120, %edx            # imm = 0x120
xorl %eax, %eax
callq 0x3090
leaq 0x4bcd(%rip), %rdi      # 0x852e
leaq 0x30(%rsp), %rsi
pushq $0x2
popq %rdx
leaq 0x4(%rsp), %rcx
callq 0x6b26
movq %rax, %r14
movl 0x8780(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x8778(%rip)      # 0xc0fc
testq %r14, %r14
jne 0x39af
incl 0x8771(%rip)            # 0xc100
leaq 0x4a1f(%rip), %rdi      # 0x83b5
leaq 0x4a26(%rip), %rsi      # 0x83c3
movl $0x123, %edx            # imm = 0x123
xorl %eax, %eax
callq 0x3090
movl 0x874d(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x8745(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
je 0x39de
incl 0x873c(%rip)            # 0xc100
leaq 0x49ea(%rip), %rdi      # 0x83b5
leaq 0x49f1(%rip), %rsi      # 0x83c3
movl $0x124, %edx            # imm = 0x124
xorl %eax, %eax
callq 0x3090
leaq 0x4b5a(%rip), %rdi      # 0x853f
leaq 0x30(%rsp), %rsi
pushq $0x2
popq %rdx
leaq 0x4(%rsp), %rcx
callq 0x6b26
movq %rax, %r15
movl 0x86fc(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x86f4(%rip)      # 0xc0fc
testq %r15, %r15
jne 0x3a33
incl 0x86ed(%rip)            # 0xc100
leaq 0x499b(%rip), %rdi      # 0x83b5
leaq 0x49a2(%rip), %rsi      # 0x83c3
movl $0x127, %edx            # imm = 0x127
xorl %eax, %eax
callq 0x3090
movl 0x86c9(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x86c1(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
je 0x3a62
incl 0x86b8(%rip)            # 0xc100
leaq 0x4966(%rip), %rdi      # 0x83b5
leaq 0x496d(%rip), %rsi      # 0x83c3
movl $0x128, %edx            # imm = 0x128
xorl %eax, %eax
callq 0x3090
leaq 0x4acd(%rip), %rdi      # 0x8536
leaq 0x30(%rsp), %rsi
pushq $0x3
popq %rdx
leaq 0x4(%rsp), %rcx
callq 0x6b26
movq %rax, %r12
movl 0x8678(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x8670(%rip)      # 0xc0fc
testq %r12, %r12
jne 0x3ab7
incl 0x8669(%rip)            # 0xc100
leaq 0x4917(%rip), %rdi      # 0x83b5
leaq 0x491e(%rip), %rsi      # 0x83c3
movl $0x12b, %edx            # imm = 0x12B
xorl %eax, %eax
callq 0x3090
movl 0x8645(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x863d(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
je 0x3ae6
incl 0x8634(%rip)            # 0xc100
leaq 0x48e2(%rip), %rdi      # 0x83b5
leaq 0x48e9(%rip), %rsi      # 0x83c3
movl $0x12c, %edx            # imm = 0x12C
xorl %eax, %eax
callq 0x3090
movsd 0x4562(%rip), %xmm0     # 0x8050
leaq 0x48d6(%rip), %r13      # 0x83cb
leaq 0x48c7(%rip), %rbp      # 0x83c3
movsd %xmm0, 0x10(%rsp)
movsd 0x454e(%rip), %xmm1     # 0x8058
ucomisd %xmm0, %xmm1
jbe 0x3d26
xorpd %xmm2, %xmm2
movsd %xmm2, 0x8(%rsp)
movsd 0x453a(%rip), %xmm0     # 0x8060
ucomisd %xmm2, %xmm0
jbe 0x3d13
movq %rbx, %rdi
callq 0x652d
movsd %xmm0, 0x20(%rsp)
incl 0x85b8(%rip)            # 0xc0fc
movsd 0x8(%rsp), %xmm0
callq 0x30b0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x3150
addsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
andpd 0x4494(%rip), %xmm0     # 0x8010
ucomisd 0x44bc(%rip), %xmm0     # 0x8040
ja 0x3b8c
ucomisd %xmm1, %xmm1
jnp 0x3bd0
incl 0x856e(%rip)            # 0xc100
movsd 0x8(%rsp), %xmm0
callq 0x30b0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x3150
movsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
movq %r13, %rdi
movq %rbp, %rsi
movl $0x133, %edx            # imm = 0x133
movsd 0x20(%rsp), %xmm0
movb $0x2, %al
callq 0x3090
movq %r14, %rdi
callq 0x652d
incl 0x851e(%rip)            # 0xc0fc
movsd 0x8(%rsp), %xmm2
movapd %xmm2, %xmm1
addsd %xmm2, %xmm1
addsd %xmm2, %xmm1
subsd 0x10(%rsp), %xmm1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
movapd %xmm2, %xmm3
andpd 0x4406(%rip), %xmm3     # 0x8010
ucomisd 0x442e(%rip), %xmm3     # 0x8040
ja 0x3c1a
ucomisd %xmm2, %xmm2
jnp 0x3c32
incl 0x84e0(%rip)            # 0xc100
movq %r13, %rdi
movq %rbp, %rsi
movl $0x136, %edx            # imm = 0x136
movb $0x2, %al
callq 0x3090
movq %r15, %rdi
callq 0x652d
incl 0x84bc(%rip)            # 0xc0fc
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm3
movapd %xmm3, %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm3, %xmm1
mulsd %xmm3, %xmm1
movapd %xmm0, %xmm3
subsd %xmm1, %xmm3
movapd %xmm3, %xmm4
andpd 0x43a0(%rip), %xmm4     # 0x8010
ucomisd 0x43c8(%rip), %xmm4     # 0x8040
ja 0x3c80
ucomisd %xmm3, %xmm3
jnp 0x3c9e
incl 0x847a(%rip)            # 0xc100
movq %r13, %rdi
movq %rbp, %rsi
movl $0x139, %edx            # imm = 0x139
movb $0x2, %al
callq 0x3090
movsd 0x8(%rsp), %xmm2
movsd %xmm2, 0x28(%rsp)
movq %r12, %rdi
callq 0x652d
incl 0x844a(%rip)            # 0xc0fc
movsd 0x8(%rsp), %xmm2
movapd %xmm2, %xmm1
addsd 0x439c(%rip), %xmm1     # 0x8060
movapd %xmm0, %xmm3
subsd %xmm1, %xmm3
movapd %xmm3, %xmm4
andpd 0x4338(%rip), %xmm4     # 0x8010
ucomisd 0x4360(%rip), %xmm4     # 0x8040
ja 0x3ce8
ucomisd %xmm3, %xmm3
jnp 0x3d06
incl 0x8412(%rip)            # 0xc100
movq %r13, %rdi
movq %rbp, %rsi
movl $0x13d, %edx            # imm = 0x13D
movb $0x2, %al
callq 0x3090
movsd 0x8(%rsp), %xmm2
addsd 0x433a(%rip), %xmm2     # 0x8048
jmp 0x3b18
movsd 0x10(%rsp), %xmm0
addsd 0x4327(%rip), %xmm0     # 0x8048
jmp 0x3afc
movq %rbx, %rdi
callq 0x6224
movq %r14, %rdi
callq 0x6224
movq %r15, %rdi
callq 0x6224
movq %r12, %rdi
callq 0x6224
leaq 0x47f1(%rip), %rdi      # 0x853e
leaq 0x30(%rsp), %rsi
pushq $0x2
popq %rdx
leaq 0x4(%rsp), %rcx
callq 0x6b26
movl 0x8397(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x838f(%rip)      # 0xc0fc
testq %rax, %rax
je 0x3d98
incl 0x8388(%rip)            # 0xc100
leaq 0x4636(%rip), %rdi      # 0x83b5
leaq 0x463d(%rip), %rsi      # 0x83c3
movl $0x149, %edx            # imm = 0x149
xorl %eax, %eax
callq 0x3090
movl 0x8364(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x835c(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
jne 0x3dc7
incl 0x8353(%rip)            # 0xc100
leaq 0x4601(%rip), %rdi      # 0x83b5
leaq 0x4608(%rip), %rsi      # 0x83c3
movl $0x14a, %edx            # imm = 0x14A
xorl %eax, %eax
callq 0x3090
leaq 0x4777(%rip), %rdi      # 0x8545
leaq 0x30(%rsp), %rsi
pushq $0x3
popq %rdx
leaq 0x4(%rsp), %rcx
callq 0x6b26
movl 0x8316(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x830e(%rip)      # 0xc0fc
testq %rax, %rax
je 0x3e19
incl 0x8307(%rip)            # 0xc100
leaq 0x45b5(%rip), %rdi      # 0x83b5
leaq 0x45bc(%rip), %rsi      # 0x83c3
movl $0x14d, %edx            # imm = 0x14D
xorl %eax, %eax
callq 0x3090
movl 0x82e3(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x82db(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
jne 0x3e48
incl 0x82d2(%rip)            # 0xc100
leaq 0x4580(%rip), %rdi      # 0x83b5
leaq 0x4587(%rip), %rsi      # 0x83c3
movl $0x14e, %edx            # imm = 0x14E
xorl %eax, %eax
callq 0x3090
leaq 0x46fa(%rip), %rdi      # 0x8549
leaq 0x30(%rsp), %rsi
pushq $0x2
popq %rdx
leaq 0x4(%rsp), %rcx
callq 0x6b26
movl 0x8295(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x828d(%rip)      # 0xc0fc
testq %rax, %rax
je 0x3e9a
incl 0x8286(%rip)            # 0xc100
leaq 0x4534(%rip), %rdi      # 0x83b5
leaq 0x453b(%rip), %rsi      # 0x83c3
movl $0x151, %edx            # imm = 0x151
xorl %eax, %eax
callq 0x3090
movl 0x8262(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x825a(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
jne 0x3ec9
incl 0x8251(%rip)            # 0xc100
leaq 0x44ff(%rip), %rdi      # 0x83b5
leaq 0x4506(%rip), %rsi      # 0x83c3
movl $0x152, %edx            # imm = 0x152
xorl %eax, %eax
callq 0x3090
leaq 0x4680(%rip), %rdi      # 0x8550
leaq 0x30(%rsp), %rsi
pushq $0x2
popq %rdx
leaq 0x4(%rsp), %rcx
callq 0x6b26
movl 0x8214(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x820c(%rip)      # 0xc0fc
testq %rax, %rax
je 0x3f1b
incl 0x8205(%rip)            # 0xc100
leaq 0x44b3(%rip), %rdi      # 0x83b5
leaq 0x44ba(%rip), %rsi      # 0x83c3
movl $0x155, %edx            # imm = 0x155
xorl %eax, %eax
callq 0x3090
movl 0x81e1(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x81d9(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
jne 0x3f4a
incl 0x81d0(%rip)            # 0xc100
leaq 0x447e(%rip), %rdi      # 0x83b5
leaq 0x4485(%rip), %rsi      # 0x83c3
movl $0x156, %edx            # imm = 0x156
xorl %eax, %eax
callq 0x3090
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq