// File: /workspace/github_c_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x2a0b3(%rip), %r14d    # 0x3f2b8
movl $0xfffe795f, %eax       # imm = 0xFFFE795F
leal (%r14,%rax), %ecx
cmpl %eax, %ecx
jbe 0x15543
decl %r14d
movl %r14d, 0x2a098(%rip)    # 0x3f2b8
leaq 0x33399(%rip), %r15     # 0x485c0
movq (%r15,%r14,8), %rbx
movzbl 0x10(%rbx), %r12d
cmpl $0x7, %r12d
jne 0x1529f
movq %rbx, %rdi
callq 0x9638
movq %rax, %rbx
movq (%rax), %rax
movslq 0x64(%rax), %r14
testq %r14, %r14
jle 0x15297
xorl %r12d, %r12d
movl $0xfffe795f, %r13d      # imm = 0xFFFE795F
movq (%rbx), %rax
movq 0x68(%rax,%r12,8), %rdi
callq 0x8ba5
callq 0x151ed
movl 0x2a04a(%rip), %eax     # 0x3f2b8
leal (%rax,%r13), %ecx
cmpl %r13d, %ecx
jbe 0x15543
decl %eax
movl %eax, 0x2a035(%rip)     # 0x3f2b8
movq (%r15,%rax,8), %rax
movq (%rbx), %rcx
movq %rax, 0x68(%rcx,%r12,8)
incq %r12
cmpq %r12, %r14
jne 0x15256
movq %rbx, %rdi
jmp 0x15362
cmpq 0x30daa(%rip), %rbx     # 0x46050
je 0x15334
movq 0x33015(%rip), %rax     # 0x482c8
cmpq %rax, %rbx
je 0x15349
movq %rbx, %rcx
cmpl $0x1, %r12d
je 0x1537c
cmpl $0x4, %r12d
jne 0x15375
movq (%rbx), %rdi
callq 0x7937
movapd %xmm0, -0x40(%rbp)
movq 0x8(%rbx), %rdi
callq 0x7937
movzbl 0x10(%rbx), %eax
cmpl $0x5, %eax
je 0x154a9
cmpl $0x4, %eax
jne 0x15313
cmpb $0x1, 0x12(%rbx)
jne 0x15313
movapd -0x40(%rbp), %xmm1
xorpd 0x14e02(%rip), %xmm1    # 0x2a110
movapd %xmm1, -0x40(%rbp)
movapd -0x40(%rbp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, -0x40(%rbp)
callq 0x74dc
movb $0x5, 0x10(%rax)
movaps -0x40(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0x1535f
callq 0x74dc
movb $0x5, 0x10(%rax)
movabsq $0x400921fb54442d18, %rcx # imm = 0x400921FB54442D18
jmp 0x1535c
callq 0x74dc
movb $0x5, 0x10(%rax)
movabsq $0x4005bf0a8b145769, %rcx # imm = 0x4005BF0A8B145769
movq %rcx, (%rax)
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8ba5
leaq 0x30684(%rip), %rcx     # 0x45a00
movq 0x32f2d(%rip), %rdi     # 0x482b0
cmpq %rdi, (%rcx)
jne 0x153b2
leaq 0x8(%rbx), %r13
cmpl $0x1, %r12d
leaq 0x30669(%rip), %r15     # 0x45a00
movq %r15, %rcx
cmoveq %r13, %rcx
movq (%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
cmovneq %r15, %rcx
cmpq %rax, (%rcx)
je 0x154bc
cmpl $0x1, %r12d
leaq 0x30643(%rip), %r15     # 0x45a00
movq %r15, %rax
cmoveq %rbx, %rax
cmpq %rdi, (%rax)
je 0x1540d
cmpb $0x1, %r12b
jne 0x15297
movq (%rbx), %rdi
callq 0x8ba5
leaq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rbx)
cmovneq %r15, %rax
movq (%rax), %rbx
cmpb $0x1, 0x10(%rbx)
jne 0x153ff
movq (%rbx), %rdi
callq 0x8ba5
callq 0x151ed
jmp 0x153db
movl 0x29eb3(%rip), %edi     # 0x3f2b8
subl %r14d, %edi
jmp 0x15530
leaq 0x8(%rbx), %r13
cmpb $0x1, %r12b
movq %r15, %rax
cmoveq %r13, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r15, %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0xd1c4
testl %eax, %eax
je 0x153c9
movq 0x32e64(%rip), %rdi     # 0x482a8
callq 0x8ba5
callq 0x74dc
movb $0x5, 0x10(%rax)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
movq %rax, %rdi
callq 0x8ba5
movq 0x32e42(%rip), %rdi     # 0x482b0
callq 0x8ba5
cmpb $0x1, 0x10(%rbx)
movq %r15, %rax
cmoveq %r13, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r15, %rax
movq (%rax), %rdi
callq 0x8ba5
cmpb $0x1, 0x10(%rbx)
cmovneq %r15, %r13
movq (%r13), %rax
cmpb $0x1, 0x10(%rax)
jne 0x154e5
movq 0x8(%rax), %rax
jmp 0x154ec
xorpd %xmm1, %xmm1
ucomisd (%rbx), %xmm1
ja 0x15301
jmp 0x15313
callq 0x8ba5
movq 0x32e00(%rip), %rdi     # 0x482c8
callq 0x8ba5
cmpb $0x1, 0x10(%rbx)
cmovneq %r15, %r13
movq (%r13), %rax
cmpb $0x1, 0x10(%rax)
jne 0x1550e
movq 0x8(%rax), %rax
jmp 0x15515
movq 0x30514(%rip), %rax     # 0x45a00
cmpb $0x1, 0x10(%rax)
jne 0x154f5
movq %rax, %r15
movq (%r15), %rdi
callq 0x8ba5
callq 0x151ed
movl $0x3, %edi
callq 0x8b7d
jmp 0x1552b
movq 0x304eb(%rip), %rax     # 0x45a00
cmpb $0x1, 0x10(%rax)
jne 0x1551e
movq %rax, %r15
movq (%r15), %rdi
callq 0x8ba5
callq 0x151ed
movl $0x3, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8b7d
leaq 0x199f7(%rip), %rdi     # 0x2ef41
callq 0x780b