// File: 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 %rbp
movq %rsp, %rbp
subq $0x360, %rsp            # imm = 0x360
movq %rdi, -0x320(%rbp)
movb %sil, %al
movq %rdi, -0x318(%rbp)
leaq 0x28(%rbp), %rcx
movq %rcx, -0x310(%rbp)
leaq 0x10(%rbp), %rcx
movq %rcx, -0x308(%rbp)
movsd %xmm0, -0x8(%rbp)
movsd %xmm1, -0x10(%rbp)
movsd %xmm2, -0x18(%rbp)
movb %al, -0x19(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xa290
movsd -0x10(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0x8(%rbp), %xmm0
movsd -0x18(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0xb0(%rbp), %xmm0
movsd -0xb8(%rbp), %xmm1
movsd -0xc0(%rbp), %xmm2
movsbl -0x19(%rbp), %edi
callq 0x40c0
movsd %xmm0, -0xc8(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x28(%rbp)
movsd -0xb0(%rbp), %xmm0
leaq -0xf8(%rbp), %rdi
callq 0x2fe0
jmp 0x5d2f
movq -0x28(%rbp), %rax
movq %rax, -0x110(%rbp)
movups -0x38(%rbp), %xmm0
movaps %xmm0, -0x120(%rbp)
movq -0x110(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x120(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0xe0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0xa750
jmp 0x5d72
movq -0xd0(%rbp), %rax
movq %rax, -0x40(%rbp)
movups -0xe0(%rbp), %xmm0
movaps %xmm0, -0x50(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xa410
movsd -0xc8(%rbp), %xmm0
leaq -0x168(%rbp), %rdi
callq 0x2980
jmp 0x5daa
movsd -0xb8(%rbp), %xmm0
leaq -0x180(%rbp), %rdi
callq 0x2fe0
jmp 0x5dc0
leaq -0x150(%rbp), %rdi
leaq -0x168(%rbp), %rsi
leaq -0x180(%rbp), %rdx
callq 0xa9f0
jmp 0x5ddc
movq -0x28(%rbp), %rax
movq %rax, -0x190(%rbp)
movups -0x38(%rbp), %xmm0
movaps %xmm0, -0x1a0(%rbp)
movq -0x190(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x1a0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x138(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0xa750
jmp 0x5e1f
movq -0x128(%rbp), %rax
movq %rax, -0x60(%rbp)
movups -0x138(%rbp), %xmm0
movaps %xmm0, -0x70(%rbp)
leaq -0x150(%rbp), %rdi
callq 0xa410
leaq -0x180(%rbp), %rdi
callq 0xa410
leaq -0x168(%rbp), %rdi
callq 0xa410
movq -0x308(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x1e0(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x1f0(%rbp)
movq -0x1e0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x1f0(%rbp), %xmm0
movups %xmm0, (%rax)
callq 0x3590
movaps 0xb227(%rip), %xmm1     # 0x110c0
pxor %xmm1, %xmm0
leaq -0x1d0(%rbp), %rdi
callq 0x2fe0
jmp 0x5eab
movq -0x308(%rbp), %rax
movq 0x10(%rax), %rcx
movq %rcx, -0x210(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x220(%rbp)
movq -0x210(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x220(%rbp), %xmm0
movups %xmm0, (%rax)
callq 0x35e0
movaps 0xb1d5(%rip), %xmm1     # 0x110c0
pxor %xmm1, %xmm0
leaq -0x208(%rbp), %rdi
callq 0x2980
jmp 0x5efd
leaq -0x1b8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0xa9f0
jmp 0x5f19
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x328(%rbp)
leaq -0x1b8(%rbp), %rsi
movq %rsi, -0x330(%rbp)
callq 0xa690
movq -0x330(%rbp), %rdi
callq 0xa410
leaq -0x208(%rbp), %rdi
callq 0xa410
leaq -0x1d0(%rbp), %rdi
callq 0xa410
movq -0x310(%rbp), %rax
movq -0x328(%rbp), %rsi
movq 0x10(%rax), %rcx
movq %rcx, -0x240(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x250(%rbp)
movq -0x240(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x250(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x238(%rbp), %rdi
callq 0xa750
jmp 0x5fa7
movq -0x228(%rbp), %rax
movq %rax, -0x80(%rbp)
movups -0x238(%rbp), %xmm0
movaps %xmm0, -0x90(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x290(%rbp)
movaps -0x90(%rbp), %xmm0
movaps %xmm0, -0x2a0(%rbp)
movq -0x290(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x2a0(%rbp), %xmm0
movups %xmm0, (%rax)
callq 0x35e0
movaps 0xb0c3(%rip), %xmm1     # 0x110c0
pxor %xmm1, %xmm0
leaq -0x280(%rbp), %rdi
callq 0x2980
jmp 0x600f
leaq -0x2b8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xac20
jmp 0x6024
leaq -0x268(%rbp), %rdi
leaq -0x280(%rbp), %rsi
leaq -0x2b8(%rbp), %rdx
callq 0xa9f0
jmp 0x6040
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x338(%rbp)
leaq -0x268(%rbp), %rsi
movq %rsi, -0x340(%rbp)
callq 0xa690
movq -0x340(%rbp), %rdi
callq 0xa410
leaq -0x2b8(%rbp), %rdi
callq 0xa410
leaq -0x280(%rbp), %rdi
callq 0xa410
movq -0x338(%rbp), %rsi
leaq -0x2e8(%rbp), %rdi
callq 0xac50
jmp 0x609a
movq -0x60(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movaps -0x70(%rbp), %xmm0
movaps %xmm0, -0x300(%rbp)
movq -0x2f0(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x10(%rax)
movaps -0x300(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x2d0(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0xa750
jmp 0x60dd
movq -0x320(%rbp), %rax
movq -0x2d0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x2c8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x2c0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq -0x2e8(%rbp), %rdi
callq 0xa410
leaq -0xa8(%rbp), %rdi
callq 0xa410
movq -0x318(%rbp), %rax
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x6267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xa410
jmp 0x6267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x61b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x61ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x150(%rbp), %rdi
callq 0xa410
leaq -0x180(%rbp), %rdi
callq 0xa410
leaq -0x168(%rbp), %rdi
callq 0xa410
jmp 0x6267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x61fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x208(%rbp), %rdi
callq 0xa410
leaq -0x1d0(%rbp), %rdi
callq 0xa410
jmp 0x6267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x623b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0xa410
leaq -0x280(%rbp), %rdi
callq 0xa410
jmp 0x6267
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0xa410
leaq -0xa8(%rbp), %rdi
callq 0xa410
movq -0x100(%rbp), %rdi
callq 0x23c0
nop