// File: /workspace/github_cpp_makefile_star2_O1/dannycalegari[P]circle_pack/./Layout_routine.cc
// Function: layout_point(double, Point, double, Point, double, char)
Point layout_point(double RI, Point J, double RJ, Point K, double RK, char geometry){
	// triangle JKI; i.e. JK is bottom edge. 
	// given location of J and K, and side lengths (implicitly), compute location of I
	Point I;
	Point J0,K0,I0,K1;
	Matrix M;
	double a,b,c,angle;
	a=RJ+RK;
	b=RJ+RI;
	c=RI+RK;
	angle=angle_at_C(a,b,c,geometry);
	J0.x=0.0;
	J0.y=0.0;
	J0.z=1.0;
	K0=HTR(a)(J0);
	I0=(ROT(angle)*HTR(b))(J0);	// (J0,K0,I0) have correct relative position. 
		// need to compute M in SO(2,1) with M(J0,K0,I0) = (J,K,I);
	M=HTR(-hyp_dist(J))*ROT(-hyp_ang(J));	// M moves J to origin
	K1=M(K);
	M=ROT(-hyp_ang(K1))*M;
	I=M.hyp_inv()(I0);	// apply inverse of M to I0
	return(I);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x130, %rsp            # imm = 0x130
movapd %xmm1, %xmm3
movq %rdi, %rbx
xorpd %xmm1, %xmm1
movapd %xmm1, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movapd %xmm0, %xmm1
addsd %xmm3, %xmm1
addsd %xmm2, %xmm3
movsd %xmm3, 0x8(%rsp)
addsd %xmm0, %xmm2
movapd %xmm3, %xmm0
movsd %xmm1, 0x20(%rsp)
movl %esi, %edi
callq 0x40dc
movsd %xmm0, 0x28(%rsp)
leaq 0x50(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
callq 0x3152
leaq 0x50(%rsp), %rdi
callq 0x9496
leaq 0x80(%rsp), %rdi
movsd 0x28(%rsp), %xmm0
callq 0x2894
leaq 0x118(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
callq 0x3152
leaq 0x50(%rsp), %rdi
leaq 0x80(%rsp), %rsi
leaq 0x118(%rsp), %rdx
callq 0x9188
leaq 0x150(%rsp), %r14
leaq 0x50(%rsp), %rdi
movq (%rdi), %rax
movq (%rax), %rcx
movq 0x18(%rax), %rdx
movsd (%rcx), %xmm0
movsd %xmm0, 0xd8(%rsp)
movsd 0x8(%rcx), %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0x10(%rcx), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd (%rdx), %xmm0
movsd %xmm0, 0xc8(%rsp)
movsd 0x8(%rdx), %xmm0
movsd %xmm0, 0xc0(%rsp)
movsd 0x10(%rdx), %xmm0
movsd %xmm0, 0xe0(%rsp)
movq 0x30(%rax), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xb0(%rsp)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
callq 0x9496
leaq 0x118(%rsp), %rdi
callq 0x9496
leaq 0x80(%rsp), %rdi
callq 0x9496
movsd 0x10(%r14), %xmm2
xorpd %xmm0, %xmm0
movsd 0x55d1(%rip), %xmm1     # 0xb010
movsd %xmm2, 0x8(%rsp)
ucomisd %xmm2, %xmm1
ja 0x5a56
movsd 0x8(%rsp), %xmm0
callq 0x23a0
xorpd 0x5662(%rip), %xmm0     # 0xb0c0
leaq 0x68(%rsp), %rdi
callq 0x3152
movsd 0x55a0(%rip), %xmm0     # 0xb010
movsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
xorpd %xmm0, %xmm0
ja 0x5ac1
movsd (%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movapd %xmm1, %xmm0
callq 0x23a0
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x5ab0
jnp 0x5ac1
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x2040
xorpd 0x55f7(%rip), %xmm0     # 0xb0c0
leaq 0x100(%rsp), %rdi
callq 0x2894
leaq 0x80(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x9188
leaq 0x168(%rsp), %r15
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movapd %xmm0, (%rdi)
movaps 0x30(%rsp), %xmm0
movq 0x40(%rsp), %rax
leaq 0x80(%rsp), %r14
movups (%r14), %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x10(%r14), %rcx
movq %rcx, 0x40(%rsp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%r14)
movq $0x0, 0x10(%r14)
callq 0x9496
movq %r14, %rdi
callq 0x9496
leaq 0x100(%rsp), %rdi
callq 0x9496
leaq 0x68(%rsp), %rdi
callq 0x9496
movsd (%r15), %xmm4
movsd 0x8(%r15), %xmm5
movsd 0x10(%r15), %xmm3
movq 0x30(%rsp), %rax
movq 0x30(%rax), %rcx
movsd 0x8(%rcx), %xmm0
mulsd %xmm5, %xmm0
movsd (%rcx), %xmm1
mulsd %xmm4, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rcx), %xmm0
mulsd %xmm3, %xmm0
addsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
movsd 0x5465(%rip), %xmm2     # 0xb010
ucomisd %xmm0, %xmm2
ja 0x5c68
movq (%rax), %rcx
movq 0x18(%rax), %rax
movsd 0x8(%rcx), %xmm1
mulsd %xmm5, %xmm1
movsd %xmm1, 0xa0(%rsp)
movsd (%rcx), %xmm1
mulsd %xmm4, %xmm1
movsd %xmm1, 0x98(%rsp)
movsd 0x10(%rcx), %xmm1
mulsd %xmm3, %xmm1
movsd %xmm1, 0xa8(%rsp)
mulsd 0x8(%rax), %xmm5
movsd %xmm5, 0x10(%rsp)
mulsd (%rax), %xmm4
movsd %xmm4, 0x18(%rsp)
mulsd 0x10(%rax), %xmm3
movsd %xmm3, 0x8(%rsp)
callq 0x23a0
movsd 0x10(%rsp), %xmm4
movsd 0x18(%rsp), %xmm3
movsd 0x8(%rsp), %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5c34
jnp 0x5c68
movsd 0x98(%rsp), %xmm0
addsd 0xa0(%rsp), %xmm0
movsd 0xa8(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd %xmm4, %xmm3
addsd %xmm3, %xmm2
movapd %xmm2, %xmm0
callq 0x2040
movapd %xmm0, %xmm1
xorpd 0x5450(%rip), %xmm1     # 0xb0c0
leaq 0x68(%rsp), %rdi
movapd %xmm1, %xmm0
callq 0x2894
leaq 0xe8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x9522
leaq 0x80(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
callq 0x9188
xorpd %xmm0, %xmm0
leaq 0x50(%rsp), %rdi
movapd %xmm0, (%rdi)
leaq 0x30(%rsp), %r14
movapd (%r14), %xmm0
movq 0x10(%r14), %rax
leaq 0x80(%rsp), %r15
movups (%r15), %xmm1
movaps %xmm1, (%r14)
movq 0x10(%r15), %rcx
movq %rcx, 0x10(%r14)
movapd (%rdi), %xmm1
movapd %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movupd %xmm1, (%r15)
movq $0x0, 0x10(%r15)
callq 0x9496
movq %r15, %rdi
callq 0x9496
leaq 0xe8(%rsp), %rdi
callq 0x9496
leaq 0x68(%rsp), %rdi
callq 0x9496
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x92c6
xorpd %xmm0, %xmm0
movsd 0xb0(%rsp), %xmm2
mulsd %xmm0, %xmm2
movsd 0xb8(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movsd 0x20(%rsp), %xmm4
addsd %xmm1, %xmm4
movsd 0xc0(%rsp), %xmm2
mulsd %xmm0, %xmm2
movsd 0xc8(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movsd 0xe0(%rsp), %xmm5
addsd %xmm1, %xmm5
movsd 0xd0(%rsp), %xmm2
mulsd %xmm0, %xmm2
movsd 0xd8(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movsd 0x28(%rsp), %xmm3
addsd %xmm1, %xmm3
leaq 0x50(%rsp), %rdi
movq (%rdi), %rax
movq (%rax), %rcx
movq 0x18(%rax), %rdx
movsd 0x8(%rcx), %xmm0
mulsd %xmm5, %xmm0
movsd (%rcx), %xmm1
mulsd %xmm3, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rcx), %xmm0
mulsd %xmm4, %xmm0
addsd %xmm1, %xmm0
movsd 0x8(%rdx), %xmm1
mulsd %xmm5, %xmm1
movsd (%rdx), %xmm2
mulsd %xmm3, %xmm2
addsd %xmm1, %xmm2
movsd 0x10(%rdx), %xmm1
mulsd %xmm4, %xmm1
movq 0x30(%rax), %rax
mulsd 0x8(%rax), %xmm5
mulsd (%rax), %xmm3
addsd %xmm2, %xmm1
addsd %xmm5, %xmm3
mulsd 0x10(%rax), %xmm4
addsd %xmm3, %xmm4
movsd %xmm0, (%rbx)
movsd %xmm1, 0x8(%rbx)
movsd %xmm4, 0x10(%rbx)
callq 0x9496
leaq 0x30(%rsp), %rdi
callq 0x9496
movq %rbx, %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbx
popq %r14
popq %r15
retq
jmp 0x5e97
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
jmp 0x5e5e
jmp 0x5e65
jmp 0x5e97
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x9496
jmp 0x5e68
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0x5e8e
jmp 0x5e97
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x9496
jmp 0x5e86
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x9496
jmp 0x5e9a
jmp 0x5e97
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x9496
movq %rbx, %rdi
callq 0x23b0