// File: /workspace/github_c_makefile_star2_O1/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 0x4d78(%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 0x4cec(%rip), %rcx      # 0x8524
movq %rcx, 0x20(%rsi)
leaq 0x10(%rsp), %rcx
movq %rcx, 0x28(%rsi)
movl %eax, 0x30(%rsi)
movq %rax, 0x38(%rsi)
leaq 0x4cbf(%rip), %rcx      # 0x8512
movq %rcx, 0x40(%rsi)
leaq 0x28(%rsp), %rcx
movq %rcx, 0x48(%rsi)
movl %eax, 0x50(%rsi)
movq %rax, 0x58(%rsi)
leaq 0x4caa(%rip), %rdi      # 0x8518
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6af2
movq %rax, %rbx
incl 0x887e(%rip)            # 0xc104
testq %rax, %rax
jne 0x38ab
incl 0x8877(%rip)            # 0xc108
leaq 0x4b15(%rip), %rdi      # 0x83ad
leaq 0x4b1c(%rip), %rsi      # 0x83bb
movl $0x11f, %edx            # imm = 0x11F
xorl %eax, %eax
callq 0x3090
incl 0x8853(%rip)            # 0xc104
cmpl $0x0, 0x4(%rsp)
je 0x38d8
incl 0x884a(%rip)            # 0xc108
leaq 0x4ae8(%rip), %rdi      # 0x83ad
leaq 0x4aef(%rip), %rsi      # 0x83bb
movl $0x120, %edx            # imm = 0x120
xorl %eax, %eax
callq 0x3090
leaq 0x4c47(%rip), %rdi      # 0x8526
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6af2
movq %rax, %r14
incl 0x8808(%rip)            # 0xc104
testq %rax, %rax
jne 0x3921
incl 0x8801(%rip)            # 0xc108
leaq 0x4a9f(%rip), %rdi      # 0x83ad
leaq 0x4aa6(%rip), %rsi      # 0x83bb
movl $0x123, %edx            # imm = 0x123
xorl %eax, %eax
callq 0x3090
incl 0x87dd(%rip)            # 0xc104
cmpl $0x0, 0x4(%rsp)
je 0x394e
incl 0x87d4(%rip)            # 0xc108
leaq 0x4a72(%rip), %rdi      # 0x83ad
leaq 0x4a79(%rip), %rsi      # 0x83bb
movl $0x124, %edx            # imm = 0x124
xorl %eax, %eax
callq 0x3090
leaq 0x4be2(%rip), %rdi      # 0x8537
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6af2
movq %rax, %r15
incl 0x8792(%rip)            # 0xc104
testq %rax, %rax
jne 0x3997
incl 0x878b(%rip)            # 0xc108
leaq 0x4a29(%rip), %rdi      # 0x83ad
leaq 0x4a30(%rip), %rsi      # 0x83bb
movl $0x127, %edx            # imm = 0x127
xorl %eax, %eax
callq 0x3090
incl 0x8767(%rip)            # 0xc104
cmpl $0x0, 0x4(%rsp)
je 0x39c4
incl 0x875e(%rip)            # 0xc108
leaq 0x49fc(%rip), %rdi      # 0x83ad
leaq 0x4a03(%rip), %rsi      # 0x83bb
movl $0x128, %edx            # imm = 0x128
xorl %eax, %eax
callq 0x3090
leaq 0x4b63(%rip), %rdi      # 0x852e
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x3, %edx
callq 0x6af2
movq %rax, %r12
incl 0x871c(%rip)            # 0xc104
testq %rax, %rax
jne 0x3a0d
incl 0x8715(%rip)            # 0xc108
leaq 0x49b3(%rip), %rdi      # 0x83ad
leaq 0x49ba(%rip), %rsi      # 0x83bb
movl $0x12b, %edx            # imm = 0x12B
xorl %eax, %eax
callq 0x3090
incl 0x86f1(%rip)            # 0xc104
cmpl $0x0, 0x4(%rsp)
je 0x3a3a
incl 0x86e8(%rip)            # 0xc108
leaq 0x4986(%rip), %rdi      # 0x83ad
leaq 0x498d(%rip), %rsi      # 0x83bb
movl $0x12c, %edx            # imm = 0x12C
xorl %eax, %eax
callq 0x3090
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x10(%rsp)
leaq 0x4973(%rip), %r13      # 0x83c3
leaq 0x4964(%rip), %rbp      # 0x83bb
movq $0x0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x64f9
movsd %xmm0, 0x20(%rsp)
incl 0x8690(%rip)            # 0xc104
movsd 0x8(%rsp), %xmm0
callq 0x30c0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x3160
addsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
subsd %xmm0, %xmm1
movapd %xmm1, %xmm0
andpd 0x4564(%rip), %xmm0     # 0x8010
ucomisd 0x458c(%rip), %xmm0     # 0x8040
ja 0x3abc
ucomisd %xmm1, %xmm1
jnp 0x3b00
incl 0x8646(%rip)            # 0xc108
movsd 0x8(%rsp), %xmm0
callq 0x30c0
movsd %xmm0, 0x18(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x3160
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 0x64f9
incl 0x85f6(%rip)            # 0xc104
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 0x44d6(%rip), %xmm3     # 0x8010
ucomisd 0x44fe(%rip), %xmm3     # 0x8040
ja 0x3b4a
ucomisd %xmm2, %xmm2
jnp 0x3b62
incl 0x85b8(%rip)            # 0xc108
movq %r13, %rdi
movq %rbp, %rsi
movl $0x136, %edx            # imm = 0x136
movb $0x2, %al
callq 0x3090
movq %r15, %rdi
callq 0x64f9
incl 0x8594(%rip)            # 0xc104
movsd 0x10(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm2, %xmm1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
movapd %xmm2, %xmm3
andpd 0x4474(%rip), %xmm3     # 0x8010
ucomisd 0x449c(%rip), %xmm3     # 0x8040
ja 0x3bac
ucomisd %xmm2, %xmm2
jnp 0x3bc4
incl 0x8556(%rip)            # 0xc108
movq %r13, %rdi
movq %rbp, %rsi
movl $0x139, %edx            # imm = 0x139
movb $0x2, %al
callq 0x3090
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movq %r12, %rdi
callq 0x64f9
incl 0x8526(%rip)            # 0xc104
movsd 0x8(%rsp), %xmm1
addsd 0x4464(%rip), %xmm1     # 0x8050
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
movapd %xmm2, %xmm3
andpd 0x4410(%rip), %xmm3     # 0x8010
ucomisd 0x4438(%rip), %xmm3     # 0x8040
ja 0x3c10
ucomisd %xmm2, %xmm2
jnp 0x3c28
incl 0x84f2(%rip)            # 0xc108
movq %r13, %rdi
movq %rbp, %rsi
movl $0x13d, %edx            # imm = 0x13D
movb $0x2, %al
callq 0x3090
movsd 0x8(%rsp), %xmm0
addsd 0x4412(%rip), %xmm0     # 0x8048
movsd %xmm0, 0x8(%rsp)
movsd 0x440c(%rip), %xmm1     # 0x8050
ucomisd %xmm0, %xmm1
ja 0x3a60
movsd 0x10(%rsp), %xmm0
addsd 0x43ec(%rip), %xmm0     # 0x8048
movsd %xmm0, 0x10(%rsp)
movsd 0x43ee(%rip), %xmm1     # 0x8058
ucomisd %xmm0, %xmm1
ja 0x3a57
movq %rbx, %rdi
callq 0x61c7
movq %r14, %rdi
callq 0x61c7
movq %r15, %rdi
callq 0x61c7
movq %r12, %rdi
callq 0x61c7
leaq 0x489b(%rip), %rdi      # 0x8536
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6af2
incl 0x844f(%rip)            # 0xc104
testq %rax, %rax
je 0x3cda
incl 0x8448(%rip)            # 0xc108
leaq 0x46e6(%rip), %rdi      # 0x83ad
leaq 0x46ed(%rip), %rsi      # 0x83bb
movl $0x149, %edx            # imm = 0x149
xorl %eax, %eax
callq 0x3090
incl 0x8424(%rip)            # 0xc104
cmpl $0x0, 0x4(%rsp)
jne 0x3d07
incl 0x841b(%rip)            # 0xc108
leaq 0x46b9(%rip), %rdi      # 0x83ad
leaq 0x46c0(%rip), %rsi      # 0x83bb
movl $0x14a, %edx            # imm = 0x14A
xorl %eax, %eax
callq 0x3090
leaq 0x482f(%rip), %rdi      # 0x853d
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x3, %edx
callq 0x6af2
incl 0x83dc(%rip)            # 0xc104
testq %rax, %rax
je 0x3d4d
incl 0x83d5(%rip)            # 0xc108
leaq 0x4673(%rip), %rdi      # 0x83ad
leaq 0x467a(%rip), %rsi      # 0x83bb
movl $0x14d, %edx            # imm = 0x14D
xorl %eax, %eax
callq 0x3090
incl 0x83b1(%rip)            # 0xc104
cmpl $0x0, 0x4(%rsp)
jne 0x3d7a
incl 0x83a8(%rip)            # 0xc108
leaq 0x4646(%rip), %rdi      # 0x83ad
leaq 0x464d(%rip), %rsi      # 0x83bb
movl $0x14e, %edx            # imm = 0x14E
xorl %eax, %eax
callq 0x3090
leaq 0x47c0(%rip), %rdi      # 0x8541
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6af2
incl 0x8369(%rip)            # 0xc104
testq %rax, %rax
je 0x3dc0
incl 0x8362(%rip)            # 0xc108
leaq 0x4600(%rip), %rdi      # 0x83ad
leaq 0x4607(%rip), %rsi      # 0x83bb
movl $0x151, %edx            # imm = 0x151
xorl %eax, %eax
callq 0x3090
incl 0x833e(%rip)            # 0xc104
cmpl $0x0, 0x4(%rsp)
jne 0x3ded
incl 0x8335(%rip)            # 0xc108
leaq 0x45d3(%rip), %rdi      # 0x83ad
leaq 0x45da(%rip), %rsi      # 0x83bb
movl $0x152, %edx            # imm = 0x152
xorl %eax, %eax
callq 0x3090
leaq 0x4754(%rip), %rdi      # 0x8548
leaq 0x30(%rsp), %rsi
leaq 0x4(%rsp), %rcx
movl $0x2, %edx
callq 0x6af2
incl 0x82f6(%rip)            # 0xc104
testq %rax, %rax
je 0x3e33
incl 0x82ef(%rip)            # 0xc108
leaq 0x458d(%rip), %rdi      # 0x83ad
leaq 0x4594(%rip), %rsi      # 0x83bb
movl $0x155, %edx            # imm = 0x155
xorl %eax, %eax
callq 0x3090
incl 0x82cb(%rip)            # 0xc104
cmpl $0x0, 0x4(%rsp)
jne 0x3e60
incl 0x82c2(%rip)            # 0xc108
leaq 0x4560(%rip), %rdi      # 0x83ad
leaq 0x4567(%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