// File: /workspace/github_cpp_makefile_star2_O3/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 $0x150, %rsp            # imm = 0x150
movapd %xmm1, %xmm3
movq %rdi, %rbx
xorpd %xmm1, %xmm1
movapd %xmm1, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movapd %xmm0, %xmm1
addsd %xmm3, %xmm1
addsd %xmm2, %xmm3
movsd %xmm3, 0x8(%rsp)
addsd %xmm0, %xmm2
movapd %xmm3, %xmm0
movsd %xmm1, 0x90(%rsp)
movl %esi, %edi
callq 0x3fd4
movsd %xmm0, 0xa0(%rsp)
leaq 0x60(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
callq 0x30cc
leaq 0x60(%rsp), %rdi
callq 0x9106
leaq 0x40(%rsp), %rdi
movsd 0xa0(%rsp), %xmm0
callq 0x2859
leaq 0x128(%rsp), %rdi
movsd 0x90(%rsp), %xmm0
callq 0x30cc
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x128(%rsp), %rdx
callq 0x8e20
leaq 0x170(%rsp), %r14
leaq 0x60(%rsp), %rdi
movq (%rdi), %rax
movq (%rax), %rcx
movq 0x18(%rax), %rdx
movsd (%rcx), %xmm0
movsd %xmm0, 0xf0(%rsp)
movsd 0x8(%rcx), %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0x10(%rcx), %xmm0
movaps %xmm0, 0x90(%rsp)
movsd (%rdx), %xmm0
movsd %xmm0, 0xe0(%rsp)
movsd 0x8(%rdx), %xmm0
movsd %xmm0, 0xd8(%rsp)
movsd 0x10(%rdx), %xmm0
movaps %xmm0, 0x140(%rsp)
movq 0x30(%rax), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xc8(%rsp)
movsd 0x10(%rax), %xmm0
movapd %xmm0, 0xa0(%rsp)
callq 0x9106
leaq 0x128(%rsp), %rdi
callq 0x9106
leaq 0x40(%rsp), %rdi
callq 0x9106
movsd 0x10(%r14), %xmm2
xorpd %xmm0, %xmm0
movsd 0x476e(%rip), %xmm1     # 0xa088
movsd %xmm2, 0x8(%rsp)
ucomisd %xmm2, %xmm1
ja 0x5931
movsd 0x8(%rsp), %xmm0
callq 0x23a0
xorpd 0x46e7(%rip), %xmm0     # 0xa020
leaq 0x78(%rsp), %rdi
callq 0x30cc
movsd 0x473d(%rip), %xmm0     # 0xa088
movsd 0x8(%rsp), %xmm1
ucomisd %xmm1, %xmm0
xorpd %xmm0, %xmm0
ja 0x599c
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 0x598b
jnp 0x599c
movsd 0x10(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x2040
xorpd 0x467c(%rip), %xmm0     # 0xa020
leaq 0x110(%rsp), %rdi
callq 0x2859
leaq 0x40(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x110(%rsp), %rdx
callq 0x8e20
leaq 0x188(%rsp), %r15
movq 0x30(%rsp), %rax
leaq 0x40(%rsp), %r14
movaps (%r14), %xmm0
movq 0x10(%r14), %rcx
movq %rcx, 0x30(%rsp)
movaps 0x20(%rsp), %xmm1
movaps %xmm0, 0x20(%rsp)
leaq 0x60(%rsp), %rdi
movaps %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
callq 0x9106
movq %r14, %rdi
callq 0x9106
leaq 0x110(%rsp), %rdi
callq 0x9106
leaq 0x78(%rsp), %rdi
callq 0x9106
movsd (%r15), %xmm4
movsd 0x8(%r15), %xmm5
movsd 0x10(%r15), %xmm3
movq 0x20(%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 0x4610(%rip), %xmm2     # 0xa088
ucomisd %xmm0, %xmm2
ja 0x5b35
movq (%rax), %rcx
movq 0x18(%rax), %rax
movsd 0x8(%rcx), %xmm1
mulsd %xmm5, %xmm1
movsd %xmm1, 0xb8(%rsp)
movsd (%rcx), %xmm1
mulsd %xmm4, %xmm1
movsd %xmm1, 0xb0(%rsp)
movsd 0x10(%rcx), %xmm1
mulsd %xmm3, %xmm1
movsd %xmm1, 0xc0(%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 0x5b01
jnp 0x5b35
movsd 0xb0(%rsp), %xmm0
addsd 0xb8(%rsp), %xmm0
movsd 0xc0(%rsp), %xmm1
addsd %xmm0, %xmm1
addsd %xmm4, %xmm3
addsd %xmm3, %xmm2
movapd %xmm2, %xmm0
callq 0x2040
movapd %xmm0, %xmm1
xorpd 0x44e3(%rip), %xmm1     # 0xa020
leaq 0x78(%rsp), %rdi
movapd %xmm1, %xmm0
callq 0x2859
leaq 0xf8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x9198
leaq 0x40(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x8e20
leaq 0x20(%rsp), %r14
movq 0x10(%r14), %rax
leaq 0x40(%rsp), %r15
movapd (%r15), %xmm0
movq 0x10(%r15), %rcx
movq %rcx, 0x10(%r14)
movapd (%r14), %xmm1
movapd %xmm0, (%r14)
leaq 0x60(%rsp), %rdi
movapd %xmm1, (%rdi)
movq %rax, 0x10(%rdi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%r15)
movq $0x0, 0x10(%r15)
callq 0x9106
movq %r15, %rdi
callq 0x9106
leaq 0xf8(%rsp), %rdi
callq 0x9106
leaq 0x78(%rsp), %rdi
callq 0x9106
leaq 0x60(%rsp), %rdi
movq %r14, %rsi
callq 0x8f5e
xorpd %xmm0, %xmm0
movsd 0xc8(%rsp), %xmm2
mulsd %xmm0, %xmm2
movsd 0xd0(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movapd 0xa0(%rsp), %xmm4
addsd %xmm1, %xmm4
movsd 0xd8(%rsp), %xmm2
mulsd %xmm0, %xmm2
movsd 0xe0(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movapd 0x140(%rsp), %xmm6
addsd %xmm1, %xmm6
movsd 0xe8(%rsp), %xmm2
mulsd %xmm0, %xmm2
movsd 0xf0(%rsp), %xmm1
mulsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movapd 0x90(%rsp), %xmm5
addsd %xmm1, %xmm5
leaq 0x60(%rsp), %rdi
movq (%rdi), %rcx
movq (%rcx), %rdx
movq 0x18(%rcx), %rax
movq 0x30(%rcx), %rcx
movsd 0x8(%rcx), %xmm0
mulsd %xmm6, %xmm0
movsd (%rcx), %xmm1
mulsd %xmm5, %xmm1
addsd %xmm0, %xmm1
movsd 0x10(%rcx), %xmm0
mulsd %xmm4, %xmm0
addsd %xmm1, %xmm0
unpcklpd %xmm6, %xmm6            # xmm6 = xmm6[0,0]
movsd (%rdx), %xmm1
movsd 0x8(%rdx), %xmm2
movsd 0x10(%rdx), %xmm3
movhpd 0x8(%rax), %xmm2        # xmm2 = xmm2[0],mem[0]
mulpd %xmm6, %xmm2
unpcklpd %xmm5, %xmm5            # xmm5 = xmm5[0,0]
movhpd (%rax), %xmm1           # xmm1 = xmm1[0],mem[0]
mulpd %xmm5, %xmm1
addpd %xmm2, %xmm1
unpcklpd %xmm4, %xmm4            # xmm4 = xmm4[0,0]
movhpd 0x10(%rax), %xmm3       # xmm3 = xmm3[0],mem[0]
mulpd %xmm4, %xmm3
addpd %xmm1, %xmm3
movupd %xmm3, (%rbx)
movsd %xmm0, 0x10(%rbx)
callq 0x9106
leaq 0x20(%rsp), %rdi
callq 0x9106
movq %rbx, %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r14
popq %r15
retq
jmp 0x5d5a
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0x5d24
jmp 0x5d2b
jmp 0x5d5a
movq %rax, %rbx
leaq 0x110(%rsp), %rdi
callq 0x9106
jmp 0x5d2e
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x5d51
jmp 0x5d5a
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x9106
jmp 0x5d4c
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x9106
jmp 0x5d5d
jmp 0x5d5a
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x9106
movq %rbx, %rdi
callq 0x23b0
nop