// File: /workspace/github_cpp_makefile_star2_O3/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 0x469a
movq 0x996b(%rip), %r14      # 0xdfd0
leaq 0x5b79(%rip), %rsi      # 0xa1e5
movl $0x1e, %edx
movq %r14, %rdi
callq 0x2220
movq %r14, %rdi
movsd (%rsp), %xmm0
callq 0x2330
leaq 0x5c89(%rip), %rsi      # 0xa316
movl $0x2, %edx
movq %rax, %rdi
callq 0x2220
movzbl 0x60(%rbx), %eax
cmpl $0x45, %eax
je 0x48f7
cmpl $0x48, %eax
jne 0x4a98
cmpb $0x1, 0xb8(%rbx)
jne 0x46d1
movq 0x9910(%rip), %rdi      # 0xdfd0
leaq 0x5b3d(%rip), %rsi      # 0xa204
movl $0x15, %edx
callq 0x2220
movq %rbx, %rdi
callq 0x3b24
movq %rbx, %rdi
callq 0x3bfe
cmpb $0x1, 0xb8(%rbx)
jne 0x4729
movq 0x98df(%rip), %r14      # 0xdfd0
leaq 0x5b22(%rip), %rsi      # 0xa21a
movl $0x13, %edx
movq %r14, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x4318
movq %r14, %rdi
callq 0x2330
leaq 0x6005(%rip), %rsi      # 0xa721
movl $0x1, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x4318
xorl %r14d, %r14d
ucomisd (%rsp), %xmm0
jbe 0x4877
xorl %r14d, %r14d
movq 0x9887(%rip), %r15      # 0xdfd0
leaq 0x5ade(%rip), %r13      # 0xa22e
leaq 0x5adf(%rip), %rbp      # 0xa236
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
testl %ecx, %ecx
jle 0x4793
xorl %r12d, %r12d
movl (%rax,%r12,4), %esi
movq %rbx, %rdi
callq 0x43f0
incq %r12
movq 0x48(%rbx), %rax
movq 0x50(%rbx), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r12
jl 0x476d
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 0x58f5(%rip), %xmm1     # 0xa0b0
movsd 0x58bd(%rip), %xmm2     # 0xa080
jle 0x47f1
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 0x47e9
mulsd %xmm2, %xmm0
movsd %xmm0, (%rdx,%rdi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x47d1
incl %r14d
cmpb $0x1, 0xb8(%rbx)
jne 0x4864
imulq $0x51eb851f, %r14, %rax # imm = 0x51EB851F
shrq $0x25, %rax
imull $0x64, %eax, %eax
movl %r14d, %ecx
subl %eax, %ecx
jne 0x4864
movl $0xb, %edx
movq %r15, %rdi
leaq 0x5a01(%rip), %rsi      # 0xa222
callq 0x2220
movq %rbx, %rdi
callq 0x4318
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 0x4318
ucomisd (%rsp), %xmm0
ja 0x4757
cmpb $0x1, 0xb8(%rbx)
jne 0x48e1
movq 0x9749(%rip), %r15      # 0xdfd0
leaq 0x5994(%rip), %rsi      # 0xa222
movl $0xb, %edx
movq %r15, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x4318
movq %r15, %rdi
callq 0x2330
movq %rax, %r15
leaq 0x5979(%rip), %rsi      # 0xa22e
movl $0x7, %edx
movq %rax, %rdi
callq 0x2220
movq %r15, %rdi
movl %r14d, %esi
callq 0x2390
leaq 0x5962(%rip), %rsi      # 0xa236
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 0x3ccc
movq 0x96d2(%rip), %r14      # 0xdfd0
leaq 0x593b(%rip), %rsi      # 0xa240
movl $0x14, %edx
movq %r14, %rdi
callq 0x2220
leaq 0x5901(%rip), %rsi      # 0xa21a
movl $0x13, %edx
movq %r14, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x42a8
movq %r14, %rdi
callq 0x2330
leaq 0x5de4(%rip), %rsi      # 0xa721
movl $0x1, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x42a8
xorl %r14d, %r14d
ucomisd (%rsp), %xmm0
jbe 0x4a3a
xorl %r14d, %r14d
movq 0x9666(%rip), %r15      # 0xdfd0
leaq 0x58bd(%rip), %r13      # 0xa22e
leaq 0x58be(%rip), %rbp      # 0xa236
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
testl %eax, %eax
jle 0x49b4
xorl %r12d, %r12d
movq %rbx, %rdi
movl %r12d, %esi
callq 0x4584
movq 0x8(%rbx), %rax
subq (%rbx), %rax
incl %r12d
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cmpl %eax, %r12d
jl 0x4990
incl %r14d
cmpb $0x1, 0xb8(%rbx)
jne 0x4a27
imulq $0x51eb851f, %r14, %rax # imm = 0x51EB851F
shrq $0x25, %rax
imull $0x64, %eax, %eax
movl %r14d, %ecx
subl %eax, %ecx
jne 0x4a27
movl $0xb, %edx
movq %r15, %rdi
leaq 0x583e(%rip), %rsi      # 0xa222
callq 0x2220
movq %rbx, %rdi
callq 0x42a8
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 0x42a8
ucomisd (%rsp), %xmm0
ja 0x4978
movq 0x958f(%rip), %r15      # 0xdfd0
leaq 0x57da(%rip), %rsi      # 0xa222
movl $0xb, %edx
movq %r15, %rdi
callq 0x2220
movq %rbx, %rdi
callq 0x42a8
movq %r15, %rdi
callq 0x2330
movq %rax, %rbx
leaq 0x57bf(%rip), %rsi      # 0xa22e
movl $0x7, %edx
movq %rax, %rdi
callq 0x2220
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2390
leaq 0x57a8(%rip), %rsi      # 0xa236
movl $0x9, %edx
movq %rax, %rdi
jmp 0x4aab
movq 0x9531(%rip), %rdi      # 0xdfd0
leaq 0x57af(%rip), %rsi      # 0xa255
movl $0x42, %edx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2220