// File: /workspace/github_cpp_makefile_star2_O2/dannycalegari[P]circle_pack/./Packing.cc
// Function: Packing::find_radii(double)
void Packing::find_radii(double accuracy){	// adjust until fitness <= accuracy
	int i,j,step;
	step=0;
	if(verbose){
		cout << "determining radii to accuracy " << accuracy << ".\n";
	};
	if(geometry=='H'){
		if(verbose){
			cout << "hyperbolic geometry.\n";
		};
		determine_inner_vertices();
		determine_labels();
		if(verbose){
			cout << "initial fitness is " << interior_fitness() << "\n";
		};
		while(interior_fitness()>accuracy){
			for(i=0;i<(int) inner.size();i++){	// adjust radii (actually, labels) of inner vertices
				j=inner[i];
				hyperbolic_correct_radius(j);
			};
			for(i=0;i<(int) adj[INFV].size();i++){	// for neighbors of infinite vertices
				j=adj[INFV][i];
				if(lab[j]>0.0000000001){
					lab[j]=lab[j]/2.0;		// make labels/radii smaller/bigger (but not too small/big)
				};
			};
			step++;
			if(verbose){
				if(step%100==0){
					cout << "fitness is " << interior_fitness() << " after " << step << " steps. \n";
				};
			};
		};
		if(verbose){
			cout << "fitness is " << interior_fitness() << " after " << step << " steps. \n";
		};
		determine_radii();	// convert from labels to radii
	} else if (geometry=='E'){
		cout << "Euclidean geometry.\n";
		cout << "initial fitness is " << fitness() << "\n";
		while(fitness()>accuracy){	
			for(i=0;i<(int) adj.size();i++){
				Euclidean_correct_radius(i);
			};	
			step++;
			if(verbose){
				if(step%100==0){
					cout << "fitness is " << fitness() << " after " << step << " steps. \n";
				};
			};
		};
		cout << "fitness is " << fitness() << " after " << step << " steps. \n";
	} else {
		cout << "Spherical packing not implemented yet (move a vertex to infinity)\n";
	};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd %xmm0, (%rsp)
movq %rdi, %rbx
cmpb $0x1, 0xb8(%rdi)
jne 0x3d1f
movq 0x92d9(%rip), %rdi      # 0xcfd0
leaq 0x54f7(%rip), %rsi      # 0x91f5
callq 0x21e0
movq %rax, %rdi
movsd (%rsp), %xmm0
callq 0x2340
leaq 0x560f(%rip), %rsi      # 0x9326
movq %rax, %rdi
callq 0x21e0
movzbl 0x60(%rbx), %eax
cmpl $0x45, %eax
je 0x3f25
cmpl $0x48, %eax
jne 0x4066
cmpb $0x1, 0xb8(%rbx)
jne 0x3d51
movq 0x928b(%rip), %rdi      # 0xcfd0
leaq 0x54c8(%rip), %rsi      # 0x9214
callq 0x21e0
movq %rbx, %rdi
callq 0x3338
movq %rbx, %rdi
callq 0x33ae
cmpb $0x1, 0xb8(%rbx)
jne 0x3d9f
movq 0x925f(%rip), %rdi      # 0xcfd0
leaq 0x54b2(%rip), %rsi      # 0x922a
callq 0x21e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x39fc
movq %r14, %rdi
callq 0x2340
leaq 0x599a(%rip), %rsi      # 0x9731
movq %rax, %rdi
callq 0x21e0
xorl %r15d, %r15d
pushq $0x64
popq %r12
leaq 0x5499(%rip), %r13      # 0x9246
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x39fc
ucomisd (%rsp), %xmm0
jbe 0x3eb8
xorl %r14d, %r14d
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r14
jge 0x3ded
movl (%rax,%r14,4), %esi
movq %rbx, %rdi
callq 0x3a82
incq %r14
jmp 0x3dc5
movslq 0xbc(%rbx), %rax
imulq $0x18, %rax, %rdx
movq (%rbx), %rsi
movq 0x30(%rbx), %rax
movq (%rsi,%rdx), %rcx
movq 0x8(%rsi,%rdx), %rdx
subq %rcx, %rdx
shrq $0x2, %rdx
testl %edx, %edx
cmovlel %r15d, %edx
xorl %esi, %esi
movsd 0x5291(%rip), %xmm1     # 0x90b0
movsd 0x5259(%rip), %xmm2     # 0x9080
cmpq %rsi, %rdx
je 0x3e49
movslq (%rcx,%rsi,4), %rdi
movsd (%rax,%rdi,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3e44
mulsd %xmm2, %xmm0
movsd %xmm0, (%rax,%rdi,8)
incq %rsi
jmp 0x3e27
incl %ebp
movb 0xb8(%rbx), %cl
movl %ebp, %eax
xorl %edx, %edx
divl %r12d
cmpb $0x1, %cl
jne 0x3daf
testl %edx, %edx
jne 0x3daf
movq 0x9160(%rip), %rdi      # 0xcfd0
leaq 0x53bb(%rip), %rsi      # 0x9232
callq 0x21e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x39fc
movq %r14, %rdi
callq 0x2340
movq %rax, %rdi
leaq 0x53a5(%rip), %rsi      # 0x923e
callq 0x21e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x23a0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21e0
jmp 0x3daf
cmpb $0x1, 0xb8(%rbx)
jne 0x3f0f
movq 0x9108(%rip), %rdi      # 0xcfd0
leaq 0x5363(%rip), %rsi      # 0x9232
callq 0x21e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x39fc
movq %r14, %rdi
callq 0x2340
leaq 0x5350(%rip), %rsi      # 0x923e
movq %rax, %rdi
callq 0x21e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x23a0
leaq 0x533f(%rip), %rsi      # 0x9246
movq %rax, %rdi
callq 0x21e0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x343a
movq 0x90a4(%rip), %r14      # 0xcfd0
leaq 0x531d(%rip), %rsi      # 0x9250
movq %r14, %rdi
callq 0x21e0
leaq 0x52e8(%rip), %rsi      # 0x922a
movq %r14, %rdi
callq 0x21e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x399c
movq %r14, %rdi
callq 0x2340
leaq 0x57cd(%rip), %rsi      # 0x9731
movq %rax, %rdi
callq 0x21e0
xorl %ebp, %ebp
pushq $0x18
popq %r15
pushq $0x64
popq %r12
leaq 0x52c9(%rip), %r13      # 0x9246
movq %rbx, %rdi
callq 0x399c
ucomisd (%rsp), %xmm0
jbe 0x401b
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
subq (%rbx), %rax
cqto
idivq %r15
cmpl %eax, %r14d
jge 0x3fb4
movq %rbx, %rdi
movl %r14d, %esi
callq 0x3c16
incl %r14d
jmp 0x3f93
incl %ebp
movb 0xb8(%rbx), %cl
movl %ebp, %eax
xorl %edx, %edx
divl %r12d
cmpb $0x1, %cl
jne 0x3f7d
testl %edx, %edx
jne 0x3f7d
movq 0x8ffd(%rip), %rdi      # 0xcfd0
leaq 0x5258(%rip), %rsi      # 0x9232
callq 0x21e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x399c
movq %r14, %rdi
callq 0x2340
movq %rax, %rdi
leaq 0x5242(%rip), %rsi      # 0x923e
callq 0x21e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x23a0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21e0
jmp 0x3f7d
movq 0x8fae(%rip), %rdi      # 0xcfd0
leaq 0x5209(%rip), %rsi      # 0x9232
callq 0x21e0
movq %rax, %r14
movq %rbx, %rdi
callq 0x399c
movq %r14, %rdi
callq 0x2340
leaq 0x51f6(%rip), %rsi      # 0x923e
movq %rax, %rdi
callq 0x21e0
movq %rax, %rdi
movl %ebp, %esi
callq 0x23a0
leaq 0x51e5(%rip), %rsi      # 0x9246
movq %rax, %rdi
jmp 0x4074
movq 0x8f63(%rip), %rdi      # 0xcfd0
leaq 0x51f1(%rip), %rsi      # 0x9265
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21e0
nop