// File: /workspace/github_c_makefile_star2_O3/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 0x4d18(%rip), %rax      # 0x858f
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x8(%rsp), %rax
movq %rax, 0x8(%rsi)
xorl %eax, %eax
movl %eax, 0x10(%rsi)
movq %rax, 0x18(%rsi)
leaq 0x4c8c(%rip), %rcx      # 0x8524
movq %rcx, 0x20(%rsi)
leaq 0x10(%rsp), %rcx
movq %rcx, 0x28(%rsi)
movl %eax, 0x30(%rsi)
movq %rax, 0x38(%rsi)
leaq 0x4c5f(%rip), %rcx      # 0x8512
movq %rcx, 0x40(%rsi)
leaq 0x28(%rsp), %rcx
movq %rcx, 0x48(%rsi)
movl %eax, 0x50(%rsi)
movq %rax, 0x58(%rsi)
leaq 0x4c4a(%rip), %rdi      # 0x8518
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6c46
movq %rax, %rbx
movl 0x8816(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x880e(%rip)      # 0xc0fc
testq %rbx, %rbx
jne 0x3919
incl 0x8807(%rip)            # 0xc100
leaq 0x4aad(%rip), %rdi      # 0x83ad
leaq 0x4ab4(%rip), %rsi      # 0x83bb
movl $0x11f, %edx            # imm = 0x11F
xorl %eax, %eax
callq 0x3090
movl 0x87e3(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x87db(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
je 0x3948
incl 0x87d2(%rip)            # 0xc100
leaq 0x4a78(%rip), %rdi      # 0x83ad
leaq 0x4a7f(%rip), %rsi      # 0x83bb
movl $0x120, %edx            # imm = 0x120
xorl %eax, %eax
callq 0x3090
leaq 0x4bd7(%rip), %rdi      # 0x8526
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6c46
movq %rax, %r14
movl 0x8790(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x8788(%rip)      # 0xc0fc
testq %r14, %r14
jne 0x399f
incl 0x8781(%rip)            # 0xc100
leaq 0x4a27(%rip), %rdi      # 0x83ad
leaq 0x4a2e(%rip), %rsi      # 0x83bb
movl $0x123, %edx            # imm = 0x123
xorl %eax, %eax
callq 0x3090
movl 0x875d(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x8755(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
je 0x39ce
incl 0x874c(%rip)            # 0xc100
leaq 0x49f2(%rip), %rdi      # 0x83ad
leaq 0x49f9(%rip), %rsi      # 0x83bb
movl $0x124, %edx            # imm = 0x124
xorl %eax, %eax
callq 0x3090
leaq 0x4b62(%rip), %rdi      # 0x8537
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6c46
movq %rax, %r15
movl 0x870a(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x8702(%rip)      # 0xc0fc
testq %r15, %r15
jne 0x3a25
incl 0x86fb(%rip)            # 0xc100
leaq 0x49a1(%rip), %rdi      # 0x83ad
leaq 0x49a8(%rip), %rsi      # 0x83bb
movl $0x127, %edx            # imm = 0x127
xorl %eax, %eax
callq 0x3090
movl 0x86d7(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x86cf(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
je 0x3a54
incl 0x86c6(%rip)            # 0xc100
leaq 0x496c(%rip), %rdi      # 0x83ad
leaq 0x4973(%rip), %rsi      # 0x83bb
movl $0x128, %edx            # imm = 0x128
xorl %eax, %eax
callq 0x3090
leaq 0x4ad3(%rip), %rdi      # 0x852e
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x3, %edx
callq 0x6c46
movq %rax, %r12
movl 0x8684(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x867c(%rip)      # 0xc0fc
testq %r12, %r12
jne 0x3aab
incl 0x8675(%rip)            # 0xc100
leaq 0x491b(%rip), %rdi      # 0x83ad
leaq 0x4922(%rip), %rsi      # 0x83bb
movl $0x12b, %edx            # imm = 0x12B
xorl %eax, %eax
callq 0x3090
movl 0x8651(%rip), %eax      # 0xc0fc
incl %eax
movl %eax, 0x8649(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
je 0x3ada
incl 0x8640(%rip)            # 0xc100
leaq 0x48e6(%rip), %rdi      # 0x83ad
leaq 0x48ed(%rip), %rsi      # 0x83bb
movl $0x12c, %edx            # imm = 0x12C
xorl %eax, %eax
callq 0x3090
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x10(%rsp)
leaq 0x48d3(%rip), %r13      # 0x83c3
leaq 0x48c4(%rip), %rbp      # 0x83bb
movq $0x0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x664d
movsd %xmm0, 0x20(%rsp)
incl 0x85e8(%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 0x44c4(%rip), %xmm0     # 0x8010
ucomisd 0x44ec(%rip), %xmm0     # 0x8040
ja 0x3b5c
ucomisd %xmm1, %xmm1
jnp 0x3ba0
incl 0x859e(%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 0x664d
incl 0x854e(%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 0x4436(%rip), %xmm3     # 0x8010
ucomisd 0x445e(%rip), %xmm3     # 0x8040
ja 0x3bea
ucomisd %xmm2, %xmm2
jnp 0x3c02
incl 0x8510(%rip)            # 0xc100
movq %r13, %rdi
movq %rbp, %rsi
movl $0x136, %edx            # imm = 0x136
movb $0x2, %al
callq 0x3090
movq %r15, %rdi
callq 0x664d
incl 0x84ec(%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 0x43d0(%rip), %xmm4     # 0x8010
ucomisd 0x43f8(%rip), %xmm4     # 0x8040
ja 0x3c50
ucomisd %xmm3, %xmm3
jnp 0x3c6e
incl 0x84aa(%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 0x664d
incl 0x847a(%rip)            # 0xc0fc
movsd 0x8(%rsp), %xmm2
movapd %xmm2, %xmm1
addsd 0x43bc(%rip), %xmm1     # 0x8050
movapd %xmm0, %xmm3
subsd %xmm1, %xmm3
movapd %xmm3, %xmm4
andpd 0x4368(%rip), %xmm4     # 0x8010
ucomisd 0x4390(%rip), %xmm4     # 0x8040
ja 0x3cb8
ucomisd %xmm3, %xmm3
jnp 0x3cd6
incl 0x8442(%rip)            # 0xc100
movq %r13, %rdi
movq %rbp, %rsi
movl $0x13d, %edx            # imm = 0x13D
movb $0x2, %al
callq 0x3090
movsd 0x8(%rsp), %xmm2
addsd 0x436a(%rip), %xmm2     # 0x8048
movsd %xmm2, 0x8(%rsp)
movsd 0x4364(%rip), %xmm0     # 0x8050
ucomisd %xmm2, %xmm0
ja 0x3b00
movsd 0x10(%rsp), %xmm0
addsd 0x4344(%rip), %xmm0     # 0x8048
movsd %xmm0, 0x10(%rsp)
movsd 0x4346(%rip), %xmm1     # 0x8058
ucomisd %xmm0, %xmm1
ja 0x3af7
movq %rbx, %rdi
callq 0x632f
movq %r14, %rdi
callq 0x632f
movq %r15, %rdi
callq 0x632f
movq %r12, %rdi
callq 0x632f
leaq 0x47f3(%rip), %rdi      # 0x8536
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6c46
movl 0x839f(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x8397(%rip)      # 0xc0fc
testq %rax, %rax
je 0x3d90
incl 0x8390(%rip)            # 0xc100
leaq 0x4636(%rip), %rdi      # 0x83ad
leaq 0x463d(%rip), %rsi      # 0x83bb
movl $0x149, %edx            # imm = 0x149
xorl %eax, %eax
callq 0x3090
movl 0x836c(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x8364(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
jne 0x3dbf
incl 0x835b(%rip)            # 0xc100
leaq 0x4601(%rip), %rdi      # 0x83ad
leaq 0x4608(%rip), %rsi      # 0x83bb
movl $0x14a, %edx            # imm = 0x14A
xorl %eax, %eax
callq 0x3090
leaq 0x4777(%rip), %rdi      # 0x853d
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x3, %edx
callq 0x6c46
movl 0x831c(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x8314(%rip)      # 0xc0fc
testq %rax, %rax
je 0x3e13
incl 0x830d(%rip)            # 0xc100
leaq 0x45b3(%rip), %rdi      # 0x83ad
leaq 0x45ba(%rip), %rsi      # 0x83bb
movl $0x14d, %edx            # imm = 0x14D
xorl %eax, %eax
callq 0x3090
movl 0x82e9(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x82e1(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
jne 0x3e42
incl 0x82d8(%rip)            # 0xc100
leaq 0x457e(%rip), %rdi      # 0x83ad
leaq 0x4585(%rip), %rsi      # 0x83bb
movl $0x14e, %edx            # imm = 0x14E
xorl %eax, %eax
callq 0x3090
leaq 0x46f8(%rip), %rdi      # 0x8541
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6c46
movl 0x8299(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x8291(%rip)      # 0xc0fc
testq %rax, %rax
je 0x3e96
incl 0x828a(%rip)            # 0xc100
leaq 0x4530(%rip), %rdi      # 0x83ad
leaq 0x4537(%rip), %rsi      # 0x83bb
movl $0x151, %edx            # imm = 0x151
xorl %eax, %eax
callq 0x3090
movl 0x8266(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x825e(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
jne 0x3ec5
incl 0x8255(%rip)            # 0xc100
leaq 0x44fb(%rip), %rdi      # 0x83ad
leaq 0x4502(%rip), %rsi      # 0x83bb
movl $0x152, %edx            # imm = 0x152
xorl %eax, %eax
callq 0x3090
leaq 0x467c(%rip), %rdi      # 0x8548
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6c46
movl 0x8216(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x820e(%rip)      # 0xc0fc
testq %rax, %rax
je 0x3f19
incl 0x8207(%rip)            # 0xc100
leaq 0x44ad(%rip), %rdi      # 0x83ad
leaq 0x44b4(%rip), %rsi      # 0x83bb
movl $0x155, %edx            # imm = 0x155
xorl %eax, %eax
callq 0x3090
movl 0x81e3(%rip), %ecx      # 0xc0fc
incl %ecx
movl %ecx, 0x81db(%rip)      # 0xc0fc
cmpl $0x0, 0x4(%rsp)
jne 0x3f48
incl 0x81d2(%rip)            # 0xc100
leaq 0x4478(%rip), %rdi      # 0x83ad
leaq 0x447f(%rip), %rsi      # 0x83bb
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