// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: factor
static te_expr *factor(state *s) {
    /* <factor>    =    <power> {"^" <power>} */
    te_expr *ret = power(s);
    CHECK_NULL(ret);

    int neg = 0;

    if (ret->type == (TE_FUNCTION1 | TE_FLAG_PURE) && ret->function == negate) {
        te_expr *se = ret->parameters[0];
        free(ret);
        ret = se;
        neg = 1;
    }

    te_expr *insertion = 0;

    while (s->type == TOK_INFIX && (s->function == pow)) {
        te_fun2 t = s->function;
        next_token(s);

        if (insertion) {
            /* Make exponentiation go right-to-left. */
            te_expr *p = power(s);
            CHECK_NULL(p, te_free(ret));

            te_expr *insert = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, insertion->parameters[1], p);
            CHECK_NULL(insert, te_free(p), te_free(ret));

            insert->function = t;
            insertion->parameters[1] = insert;
            insertion = insert;
        } else {
            te_expr *p = power(s);
            CHECK_NULL(p, te_free(ret));

            te_expr *prev = ret;
            ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, p);
            CHECK_NULL(ret, te_free(p), te_free(prev));

            ret->function = t;
            insertion = ret;
        }
    }

    if (neg) {
        te_expr *prev = ret;
        ret = NEW_EXPR(TE_FUNCTION1 | TE_FLAG_PURE, ret);
        CHECK_NULL(ret, te_free(prev));

        ret->function = negate;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
callq 0x752e
testq %rax, %rax
je 0x749b
movq %rax, %r14
cmpl $0x29, (%rax)
jne 0x7337
leaq 0x2ce(%rip), %rax       # 0x75fb
cmpq %rax, 0x8(%r14)
je 0x74d7
movb $0x1, %al
movl %eax, 0x4(%rsp)
movq 0x4c94(%rip), %rbp      # 0xbfd8
xorl %ebx, %ebx
cmpl $0x20, 0x10(%r15)
jne 0x749f
cmpq %rbp, 0x18(%r15)
jne 0x749f
movq %r15, %rdi
callq 0x61df
movq %r15, %rdi
callq 0x752e
movq %rax, %r12
testq %rbx, %rbx
je 0x73b1
testq %r12, %r12
je 0x7414
movq 0x18(%rbx), %r13
movl $0x20, %edi
callq 0x3120
testq %rax, %rax
je 0x73ee
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r13, 0x10(%rax)
movq %r12, 0x18(%rax)
movl $0x2a, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x73f0
testq %r12, %r12
je 0x7433
movl $0x20, %edi
callq 0x3120
testq %rax, %rax
je 0x744e
movq %rax, %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r14, 0x10(%rax)
movq %r12, 0x18(%rax)
movl $0x2a, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x7451
xorl %eax, %eax
testq %rax, %rax
je 0x7404
movq %rbp, 0x8(%rax)
movq %rax, 0x18(%rbx)
movb $0x1, %cl
movq %rax, %rbx
jmp 0x742b
movq %r12, %rdi
callq 0x60d8
movq %r12, %rdi
callq 0x3030
testq %r14, %r14
je 0x7429
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
xorl %ecx, %ecx
testb %cl, %cl
je 0x7491
movb $0x1, %al
jmp 0x7493
testq %r14, %r14
je 0x7448
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
xorl %ebx, %ebx
xorl %eax, %eax
jmp 0x748d
xorl %r13d, %r13d
testq %r13, %r13
je 0x7461
movq %rbp, 0x8(%r13)
movb $0x1, %al
movq %r13, %rbx
jmp 0x748a
movq %r12, %rdi
callq 0x60d8
movq %r12, %rdi
callq 0x3030
testq %r14, %r14
je 0x7486
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
xorl %ebx, %ebx
xorl %eax, %eax
movq %r13, %r14
testb %al, %al
jne 0x742f
xorl %eax, %eax
testb %al, %al
jne 0x7346
xorl %ebx, %ebx
jmp 0x751c
cmpb $0x0, 0x4(%rsp)
je 0x74ab
movq %r14, %rbx
jmp 0x751c
movl $0x18, %edi
callq 0x3120
testq %rax, %rax
je 0x74f3
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r14, 0x10(%rax)
movl $0x29, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x74f5
movq 0x10(%r14), %rbx
movq %r14, %rdi
callq 0x3030
movl $0x0, 0x4(%rsp)
movq %rbx, %r14
jmp 0x733d
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x7507
leaq 0xfa(%rip), %rax        # 0x75fb
movq %rax, 0x8(%rbx)
jmp 0x751c
testq %r14, %r14
je 0x751c
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq