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

    const char *infs[] = {
            "1/0",
            "log(0)",
            "pow(2,10000000)",
            "fac(300)",
            "ncr(300,100)",
            "ncr(300000,100)",
            "ncr(300000,100)*8",
            "npr(3,2)*ncr(300000,100)",
            "npr(100,90)",
            "npr(30,25)",
    };

    int i;
    for (i = 0; i < sizeof(infs) / sizeof(const char *); ++i) {
        const char *expr = infs[i];

        int err;
        const double r = te_interp(expr, &err);
        lequal(err, 0);
        lok(r == r + 1);

        te_expr *n = te_compile(expr, 0, 0, &err);
        lok(n);
        lequal(err, 0);
        const double c = te_eval(n);
        lok(c == c + 1);
        te_free(n);
    }
}

// Assembly:
subq $0x88, %rsp
leaq 0x30(%rsp), %rdi
leaq 0xad7d(%rip), %rsi      # 0xe650
movl $0x50, %edx
callq 0x30e0
movl $0x0, 0x2c(%rsp)
movslq 0x2c(%rsp), %rax
cmpq $0xa, %rax
jae 0x3adf
movslq 0x2c(%rsp), %rax
movq 0x30(%rsp,%rax,8), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0x9300
movsd %xmm0, 0x10(%rsp)
movl 0xb7de(%rip), %eax      # 0xf0fc
addl $0x1, %eax
movl %eax, 0xb7d5(%rip)      # 0xf0fc
cmpl $0x0, 0x1c(%rsp)
je 0x395e
movl 0xb7cc(%rip), %eax      # 0xf100
addl $0x1, %eax
movl %eax, 0xb7c3(%rip)      # 0xf100
movl 0x1c(%rsp), %ecx
leaq 0x7ad9(%rip), %rdi      # 0xb421
leaq 0x7a6c(%rip), %rsi      # 0xb3bb
movl $0x10a, %edx            # imm = 0x10A
xorl %r8d, %r8d
movb $0x0, %al
callq 0x3080
jmp 0x3960
jmp 0x3962
movl 0xb794(%rip), %eax      # 0xf0fc
addl $0x1, %eax
movl %eax, 0xb78b(%rip)      # 0xf0fc
movsd 0x10(%rsp), %xmm0
movsd 0x7691(%rip), %xmm1     # 0xb010
addsd 0x10(%rsp), %xmm1
ucomisd %xmm1, %xmm0
jne 0x398f
jp 0x398f
jmp 0x39b8
movl 0xb76b(%rip), %eax      # 0xf100
addl $0x1, %eax
movl %eax, 0xb762(%rip)      # 0xf100
leaq 0x7a08(%rip), %rdi      # 0xb3ad
leaq 0x7a0f(%rip), %rsi      # 0xb3bb
movl $0x10b, %edx            # imm = 0x10B
movb $0x0, %al
callq 0x3080
jmp 0x39ba
movq 0x20(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
leaq 0x1c(%rsp), %rcx
callq 0x8ff0
movq %rax, 0x8(%rsp)
movl 0xb722(%rip), %eax      # 0xf0fc
addl $0x1, %eax
movl %eax, 0xb719(%rip)      # 0xf0fc
cmpq $0x0, 0x8(%rsp)
jne 0x3a14
movl 0xb70f(%rip), %eax      # 0xf100
addl $0x1, %eax
movl %eax, 0xb706(%rip)      # 0xf100
leaq 0x79ac(%rip), %rdi      # 0xb3ad
leaq 0x79b3(%rip), %rsi      # 0xb3bb
movl $0x10e, %edx            # imm = 0x10E
movb $0x0, %al
callq 0x3080
jmp 0x3a16
jmp 0x3a18
movl 0xb6de(%rip), %eax      # 0xf0fc
addl $0x1, %eax
movl %eax, 0xb6d5(%rip)      # 0xf0fc
cmpl $0x0, 0x1c(%rsp)
je 0x3a5e
movl 0xb6cc(%rip), %eax      # 0xf100
addl $0x1, %eax
movl %eax, 0xb6c3(%rip)      # 0xf100
movl 0x1c(%rsp), %ecx
leaq 0x79d9(%rip), %rdi      # 0xb421
leaq 0x796c(%rip), %rsi      # 0xb3bb
movl $0x10f, %edx            # imm = 0x10F
xorl %r8d, %r8d
movb $0x0, %al
callq 0x3080
jmp 0x3a60
movq 0x8(%rsp), %rdi
callq 0x8450
movsd %xmm0, (%rsp)
movl 0xb687(%rip), %eax      # 0xf0fc
addl $0x1, %eax
movl %eax, 0xb67e(%rip)      # 0xf0fc
movsd (%rsp), %xmm0
movsd 0x7585(%rip), %xmm1     # 0xb010
addsd (%rsp), %xmm1
ucomisd %xmm1, %xmm0
jne 0x3a9a
jp 0x3a9a
jmp 0x3ac3
movl 0xb660(%rip), %eax      # 0xf100
addl $0x1, %eax
movl %eax, 0xb657(%rip)      # 0xf100
leaq 0x78fd(%rip), %rdi      # 0xb3ad
leaq 0x7904(%rip), %rsi      # 0xb3bb
movl $0x111, %edx            # imm = 0x111
movb $0x0, %al
callq 0x3080
jmp 0x3ac5
movq 0x8(%rsp), %rdi
callq 0x7e40
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x38e5
addq $0x88, %rsp
retq
nopw (%rax,%rax)