// File: /workspace/github_c_makefile_star2_O1/georgeweigt[P]eigenmath/eigenmath.c
// Function: floatfunc_subst
void
floatfunc_subst(void)
{
	int h, i, n;
	double a, b;
	struct atom *p1;

	p1 = pop();

	if (istensor(p1)) {
		p1 = copy_tensor(p1);
		n = p1->u.tensor->nelem;
		for (i = 0; i < n; i++) {
			push(p1->u.tensor->elem[i]);
			floatfunc_subst();
			p1->u.tensor->elem[i] = pop();
		}
		push(p1);
		return;
	}

	if (p1 == symbol(PI)) {
		push_double(M_PI);
		return;
	}

	if (p1 == symbol(EXP1)) {
		push_double(M_E);
		return;
	}

	if (isrational(p1)) {
		a = mfloat(p1->u.q.a);
		b = mfloat(p1->u.q.b);
		if (isnegativenumber(p1))
			a = -a;
		push_double(a / b);
		return;
	}

	// don't float exponential

	if (car(p1) == symbol(POWER) && cadr(p1) == symbol(EXP1)) {
		push_symbol(POWER);
		push_symbol(EXP1);
		push(caddr(p1));
		floatfunc_subst();
		list(3);
		return;
	}

	// don't float imaginary unit, but multiply it by 1.0

	if (car(p1) == symbol(POWER) && isminusone(cadr(p1))) {
		push_symbol(MULTIPLY);
		push_double(1.0);
		push_symbol(POWER);
		push(cadr(p1));
		push(caddr(p1));
		floatfunc_subst();
		list(3);
		list(3);
		return;
	}

	if (iscons(p1)) {
		h = tos;
		push(car(p1));
		p1 = cdr(p1);
		while (iscons(p1)) {
			push(car(p1));
			floatfunc_subst();
			p1 = cdr(p1);
		}
		list(tos - h);
		return;
	}

	push(p1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
callq 0x8b78
movq %rax, %rbx
movzbl 0x10(%rax), %r15d
cmpl $0x7, %r15d
jne 0x13bad
movq %rbx, %rdi
callq 0x953d
movq %rax, %rbx
movq (%rax), %rax
movslq 0x64(%rax), %r14
testq %r14, %r14
jle 0x13ba5
xorl %r15d, %r15d
movq (%rbx), %rax
movq 0x68(%rax,%r15,8), %rdi
callq 0x8b01
callq 0x13b42
callq 0x8b78
movq (%rbx), %rcx
movq %rax, 0x68(%rcx,%r15,8)
incq %r15
cmpq %r15, %r14
jne 0x13b7e
movq %rbx, %rdi
jmp 0x13c3b
cmpq 0x2d49c(%rip), %rbx     # 0x41050
je 0x13c0d
movq 0x2f70b(%rip), %rax     # 0x432c8
cmpq %rax, %rbx
je 0x13c22
movq %rbx, %rcx
cmpl $0x1, %r15d
je 0x13c53
cmpl $0x4, %r15d
jne 0x13c4c
movq (%rbx), %rdi
callq 0x78f4
movapd %xmm0, -0x30(%rbp)
movq 0x8(%rbx), %rdi
callq 0x78f4
movzbl 0x10(%rbx), %eax
cmpl $0x5, %eax
je 0x13dcd
cmpl $0x4, %eax
jne 0x13dda
cmpb $0x1, 0x12(%rbx)
sete %al
jmp 0x13ddc
callq 0x74ec
movb $0x5, 0x10(%rax)
movabsq $0x400921fb54442d18, %rcx # imm = 0x400921FB54442D18
jmp 0x13c35
callq 0x74ec
movb $0x5, 0x10(%rax)
movabsq $0x4005bf0a8b145769, %rcx # imm = 0x4005BF0A8B145769
movq %rcx, (%rax)
movq %rax, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8b01
leaq 0x2cdad(%rip), %rcx     # 0x40a00
movq 0x2f656(%rip), %rdi     # 0x432b0
cmpq %rdi, (%rcx)
jne 0x13c89
leaq 0x8(%rbx), %r12
cmpl $0x1, %r15d
leaq 0x2cd92(%rip), %r14     # 0x40a00
movq %r14, %rcx
cmoveq %r12, %rcx
movq (%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
cmovneq %r14, %rcx
cmpq %rax, (%rcx)
je 0x13e0c
cmpl $0x1, %r15d
leaq 0x2cd6c(%rip), %r14     # 0x40a00
movq %r14, %rax
cmoveq %rbx, %rax
cmpq %rdi, (%rax)
je 0x13cf2
cmpb $0x1, %r15b
jne 0x13ba5
movl 0x26607(%rip), %r15d    # 0x3a2b8
movq (%rbx), %rdi
callq 0x8b01
movq %rbx, %rax
addq $0x8, %rax
cmpb $0x1, 0x10(%rbx)
cmovneq %r14, %rax
movq (%rax), %rbx
cmpb $0x1, 0x10(%rbx)
jne 0x13ce4
movq (%rbx), %rdi
callq 0x8b01
callq 0x13b42
leaq 0x8(%rbx), %rax
jmp 0x13cc0
movl 0x265ce(%rip), %edi     # 0x3a2b8
subl %r15d, %edi
jmp 0x13e66
leaq 0x8(%rbx), %r12
cmpb $0x1, %r15b
movq %r14, %rax
cmoveq %r12, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0xcb82
testl %eax, %eax
je 0x13ca0
movq 0x2f57b(%rip), %rdi     # 0x432a8
callq 0x8b01
callq 0x74ec
movb $0x5, 0x10(%rax)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
movq %rax, %rdi
callq 0x8b01
movq 0x2f559(%rip), %rdi     # 0x432b0
callq 0x8b01
cmpb $0x1, 0x10(%rbx)
movq %r14, %rax
cmoveq %r12, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x8b01
cmpb $0x1, 0x10(%rbx)
cmovneq %r14, %r12
movq (%r12), %rax
movb 0x10(%rax), %cl
addq $0x8, %rax
cmpb $0x1, %cl
movq %r14, %rdx
cmoveq %rax, %rdx
movq (%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x13db1
cmpb $0x1, %cl
leaq 0x2cc56(%rip), %rcx     # 0x40a00
cmoveq %rax, %rcx
movq (%rcx), %r14
movq (%r14), %rdi
callq 0x8b01
callq 0x13b42
movl $0x3, %edi
callq 0x8ad9
jmp 0x13e61
xorpd %xmm1, %xmm1
ucomisd (%rbx), %xmm1
seta %al
jmp 0x13ddc
xorl %eax, %eax
movapd -0x30(%rbp), %xmm1
testb %al, %al
je 0x13ded
xorpd 0x12303(%rip), %xmm1    # 0x260f0
divsd %xmm0, %xmm1
movapd %xmm1, -0x30(%rbp)
callq 0x74ec
movb $0x5, 0x10(%rax)
movaps -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0x13c38
callq 0x8b01
movq 0x2f4b0(%rip), %rdi     # 0x432c8
callq 0x8b01
cmpb $0x1, 0x10(%rbx)
cmovneq %r14, %r12
movq (%r12), %rax
movb 0x10(%rax), %cl
addq $0x8, %rax
cmpb $0x1, %cl
movq %r14, %rdx
cmoveq %rax, %rdx
movq (%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x13e54
cmpb $0x1, %cl
leaq 0x2cbb3(%rip), %rcx     # 0x40a00
cmoveq %rax, %rcx
movq (%rcx), %r14
movq (%r14), %rdi
callq 0x8b01
callq 0x13b42
movl $0x3, %edi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8ad9