// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movapd %xmm1, %xmm3
movq %rdi, %rbx
xorpd %xmm1, %xmm1
movapd %xmm1, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movapd %xmm0, %xmm1
addsd %xmm3, %xmm1
addsd %xmm2, %xmm3
movsd %xmm3, 0x78(%rsp)
addsd %xmm0, %xmm2
movapd %xmm3, %xmm0
movsd %xmm1, 0x68(%rsp)
movl %esi, %edi
callq 0x36e0
movsd %xmm0, 0x70(%rsp)
leaq 0x18(%rsp), %rdi
movsd 0x78(%rsp), %xmm0
callq 0x2c7d
xorpd %xmm0, %xmm0
movapd %xmm0, 0x120(%rsp)
movabsq $0x3ff0000000000000, %r15 # imm = 0x3FF0000000000000
movq %r15, 0x130(%rsp)
movq 0x130(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd %xmm0, (%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x7600
movq %r14, %rdi
callq 0x78f0
leaq 0xe8(%rsp), %rdi
movsd 0x70(%rsp), %xmm0
callq 0x279b
leaq 0xd0(%rsp), %rdi
movsd 0x68(%rsp), %xmm0
callq 0x2c7d
leaq 0x18(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x768c
leaq 0x180(%rsp), %r12
xorpd %xmm0, %xmm0
movapd %xmm0, 0x100(%rsp)
movq %r15, 0x110(%rsp)
movq 0x110(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd %xmm0, (%rsp)
leaq 0x50(%rsp), %r14
leaq 0x18(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7600
movq 0x10(%r14), %rax
movq %rax, 0x90(%rsp)
movupd (%r14), %xmm0
movapd %xmm0, 0x80(%rsp)
movq %r15, %rdi
callq 0x78f0
leaq 0xd0(%rsp), %rdi
callq 0x78f0
leaq 0xe8(%rsp), %rdi
callq 0x78f0
movsd 0x10(%r12), %xmm1
xorpd %xmm0, %xmm0
movsd 0x4597(%rip), %xmm2     # 0x9088
ucomisd %xmm1, %xmm2
ja 0x4b00
movapd %xmm1, %xmm0
callq 0x23b0
xorpd 0x4518(%rip), %xmm0     # 0x9020
leaq 0x18(%rsp), %rdi
callq 0x2c7d
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movupd (%r12), %xmm0
movupd %xmm0, (%rsp)
callq 0x30da
xorpd 0x44ec(%rip), %xmm0     # 0x9020
leaq 0xb8(%rsp), %rdi
callq 0x279b
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
callq 0x768c
leaq 0x198(%rsp), %r12
leaq 0x30(%rsp), %r14
leaq 0x50(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x797e
movq %r15, %rdi
callq 0x78f0
leaq 0xb8(%rsp), %rdi
callq 0x78f0
leaq 0x18(%rsp), %rdi
callq 0x78f0
movq 0x10(%r12), %rax
movq %rax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
leaq 0x140(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x7600
movq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movupd (%r15), %xmm0
movupd %xmm0, (%rsp)
callq 0x30da
xorpd 0x4446(%rip), %xmm0     # 0x9020
leaq 0x18(%rsp), %rdi
callq 0x279b
leaq 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x79d0
leaq 0x50(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
callq 0x768c
leaq 0x30(%rsp), %r14
leaq 0x50(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x797e
movq %r15, %rdi
callq 0x78f0
leaq 0xa0(%rsp), %rdi
callq 0x78f0
leaq 0x18(%rsp), %rdi
callq 0x78f0
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
callq 0x77a0
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x80(%rsp), %xmm0
movups %xmm0, (%rsp)
leaq 0x50(%rsp), %r14
leaq 0x18(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x7600
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
movups (%r14), %xmm0
movups %xmm0, (%rbx)
movq %r15, %rdi
callq 0x78f0
leaq 0x30(%rsp), %rdi
callq 0x78f0
movq %rbx, %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x4d06
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
jmp 0x4ccd
jmp 0x4cd4
jmp 0x4d06
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x78f0
jmp 0x4cd7
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0x4cfd
jmp 0x4d06
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x78f0
jmp 0x4cf5
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
callq 0x78f0
jmp 0x4d09
jmp 0x4d06
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x78f0
movq %rbx, %rdi
callq 0x23c0
nop