// File: /workspace/github_cpp_makefile_star2_O1/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 0x4790
movq 0xa875(%rip), %r14      # 0xefd0
leaq 0x6a6b(%rip), %rsi      # 0xb1cd
movl $0x1e, %edx
movq %r14, %rdi
callq 0x2220
movq %r14, %rdi
movsd (%rsp), %xmm0
callq 0x2330
leaq 0x6b7b(%rip), %rsi      # 0xb2fe
movl $0x2, %edx
movq %rax, %rdi
callq 0x2220
movzbl 0x60(%rbx), %eax
cmpl $0x45, %eax
je 0x49ed
cmpl $0x48, %eax
jne 0x4b8e
cmpb $0x1, 0xb8(%rbx)
jne 0x47c7
movq 0xa81a(%rip), %rdi      # 0xefd0
leaq 0x6a2f(%rip), %rsi      # 0xb1ec
movl $0x15, %edx
callq 0x2220
movq %rbx, %rdi
callq 0x3c38
movq %rbx, %rdi
callq 0x3d08
cmpb $0x1, 0xb8(%rbx)
jne 0x481f
movq 0xa7e9(%rip), %r14      # 0xefd0
leaq 0x6a14(%rip), %rsi      # 0xb202
movl $0x13, %edx
movq %r14, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x4418
movq %r14, %rdi
callq 0x2330
leaq 0x6ef7(%rip), %rsi      # 0xb709
movl $0x1, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x4418
xorl %r14d, %r14d
ucomisd (%rsp), %xmm0
jbe 0x496d
xorl %r14d, %r14d
movq 0xa791(%rip), %r15      # 0xefd0
leaq 0x69d0(%rip), %r13      # 0xb216
leaq 0x69d1(%rip), %rbp      # 0xb21e
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
jle 0x4889
xorl %r12d, %r12d
movl (%rax,%r12,4), %esi
movq %rbx, %rdi
callq 0x44e6
incq %r12
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r12
jl 0x4863
movslq 0xbc(%rbx), %rax
movq (%rbx), %rcx
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
movsd 0x6787(%rip), %xmm1     # 0xb038
movsd 0x674f(%rip), %xmm2     # 0xb008
jle 0x48e7
movq 0x30(%rbx), %rdx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %esi, %esi
movslq (%rax,%rsi,4), %rdi
movsd (%rdx,%rdi,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x48df
mulsd %xmm2, %xmm0
movsd %xmm0, (%rdx,%rdi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x48c7
incl %r14d
cmpb $0x1, 0xb8(%rbx)
jne 0x495a
imulq $0x51eb851f, %r14, %rax # imm = 0x51EB851F
shrq $0x25, %rax
imull $0x64, %eax, %eax
movl %r14d, %ecx
subl %eax, %ecx
jne 0x495a
movl $0xb, %edx
movq %r15, %rdi
leaq 0x68f3(%rip), %rsi      # 0xb20a
callq 0x2220
movq %rbx, %rdi
callq 0x4418
movq %r15, %rdi
callq 0x2330
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2220
movq %r12, %rdi
movl %r14d, %esi
callq 0x2390
movl $0x9, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2220
movq %rbx, %rdi
callq 0x4418
ucomisd (%rsp), %xmm0
ja 0x484d
cmpb $0x1, 0xb8(%rbx)
jne 0x49d7
movq 0xa653(%rip), %r15      # 0xefd0
leaq 0x6886(%rip), %rsi      # 0xb20a
movl $0xb, %edx
movq %r15, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x4418
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
leaq 0x686b(%rip), %rsi      # 0xb216
movl $0x7, %edx
movq %rax, %rdi
callq 0x2220
movq %r15, %rdi
movl %r14d, %esi
callq 0x2390
leaq 0x6854(%rip), %rsi      # 0xb21e
movl $0x9, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3dd4
movq 0xa5dc(%rip), %r14      # 0xefd0
leaq 0x682d(%rip), %rsi      # 0xb228
movl $0x14, %edx
movq %r14, %rdi
callq 0x2220
leaq 0x67f3(%rip), %rsi      # 0xb202
movl $0x13, %edx
movq %r14, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x43a8
movq %r14, %rdi
callq 0x2330
leaq 0x6cd6(%rip), %rsi      # 0xb709
movl $0x1, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x43a8
xorl %r14d, %r14d
ucomisd (%rsp), %xmm0
jbe 0x4b30
xorl %r14d, %r14d
movq 0xa570(%rip), %r15      # 0xefd0
leaq 0x67af(%rip), %r13      # 0xb216
leaq 0x67b0(%rip), %rbp      # 0xb21e
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
testl %eax, %eax
jle 0x4aaa
xorl %r12d, %r12d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x467a
movq 0x8(%rbx), %rax
subq (%rbx), %rax
incl %r12d
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cmpl %eax, %r12d
jl 0x4a86
incl %r14d
cmpb $0x1, 0xb8(%rbx)
jne 0x4b1d
imulq $0x51eb851f, %r14, %rax # imm = 0x51EB851F
shrq $0x25, %rax
imull $0x64, %eax, %eax
movl %r14d, %ecx
subl %eax, %ecx
jne 0x4b1d
movl $0xb, %edx
movq %r15, %rdi
leaq 0x6730(%rip), %rsi      # 0xb20a
callq 0x2220
movq %rbx, %rdi
callq 0x43a8
movq %r15, %rdi
callq 0x2330
movq %rax, %r12
movl $0x7, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2220
movq %r12, %rdi
movl %r14d, %esi
callq 0x2390
movl $0x9, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2220
movq %rbx, %rdi
callq 0x43a8
ucomisd (%rsp), %xmm0
ja 0x4a6e
movq 0xa499(%rip), %r15      # 0xefd0
leaq 0x66cc(%rip), %rsi      # 0xb20a
movl $0xb, %edx
movq %r15, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x43a8
movq %r15, %rdi
callq 0x2330
movq %rax, %rbx
leaq 0x66b1(%rip), %rsi      # 0xb216
movl $0x7, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2390
leaq 0x669a(%rip), %rsi      # 0xb21e
movl $0x9, %edx
movq %rax, %rdi
jmp 0x4ba1
movq 0xa43b(%rip), %rdi      # 0xefd0
leaq 0x66a1(%rip), %rsi      # 0xb23d
movl $0x42, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220