// File: /workspace/github_cpp_makefile_star2_O1/dannycalegari[P]circle_pack/./Layout_routine.cc
// Function: Packing::compute_distances_to_vertex_INFV()
void Packing::compute_distances_to_vertex_INFV(){
	bool all_found, one_not_done;
	int i,j,nearest;
	if(verbose){
		cout << "computing distances to vertex 0.\n";
	};
	dist.clear();				// clear distance list
	maximum_distance=0;					// reset maximum
	for(i=0;i<(int) adj.size();i++){	// initialize distances
		dist.push_back(-1);
	};
	dist[INFV]=0;	// initial vertex
	all_found=false;
	while(all_found==false){
		one_not_done=false;
		for(i=0;i<(int) adj.size();i++){	// for each vertex i
			if(dist[i]==-1){		// if we don't yet know the distance to 0
				one_not_done=true;			// note this fact
				nearest=1000000;			// initialize guess
				for(j=0;j<(int) adj[i].size();j++){	// for all neighbors of i
					if(dist[adj[i][j]]!=-1){
						nearest=nearest < dist[adj[i][j]] ? nearest : dist[adj[i][j]];
					};
				};
				if(nearest<1000000){		// if we found a neighbor
					dist[i]=nearest+1;
					maximum_distance= maximum_distance > nearest+1 ? maximum_distance : nearest+1;	// let's remember this while we're at it
				};
			};
		};
		if(one_not_done==false){
			all_found=true;
		};
	};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpb $0x1, 0xb8(%rdi)
jne 0x4ff7
movq 0x9fea(%rip), %rdi      # 0xefd0
leaq 0x62bf(%rip), %rsi      # 0xb2ac
movl $0x21, %edx
callq 0x2220
movq 0x80(%rbx), %rax
cmpq %rax, 0x88(%rbx)
je 0x500e
movq %rax, 0x88(%rbx)
movl $0x0, 0x98(%rbx)
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %edx # imm = 0xAAAAAAAB
testl %edx, %edx
jle 0x508e
leaq 0x80(%rbx), %r14
xorl %ebp, %ebp
leaq 0x4(%rsp), %r15
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movq 0x88(%rbx), %rsi
cmpq 0x90(%rbx), %rsi
je 0x5069
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
addq $0x4, %rsi
movq %rsi, 0x88(%rbx)
jmp 0x5074
movq %r14, %rdi
movq %r15, %rdx
callq 0xa060
incl %ebp
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %edx # imm = 0xAAAAAAAB
cmpl %edx, %ebp
jl 0x503e
movslq 0xbc(%rbx), %rsi
movq 0x80(%rbx), %rcx
movl $0x0, (%rcx,%rsi,4)
movl %edx, %edx
xorl %esi, %esi
movl $0x1, %edi
testl %edx, %edx
jle 0x5154
xorl %r8d, %r8d
xorl %r10d, %r10d
cmpl $-0x1, (%rcx,%r8,4)
jne 0x513b
leaq (%r8,%r8,2), %r9
movq (%rax,%r9,8), %r10
movq 0x8(%rax,%r9,8), %r11
subq %r10, %r11
shrq $0x2, %r11
testl %r11d, %r11d
jle 0x510d
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl $0xf4240, %r9d          # imm = 0xF4240
xorl %r14d, %r14d
movslq (%r10,%r14,4), %r15
movl (%rcx,%r15,4), %ebp
cmpl %ebp, %r9d
movl %ebp, %r15d
cmovll %r9d, %r15d
cmpl $-0x1, %ebp
cmovnel %r15d, %r9d
incq %r14
cmpq %r14, %r11
jne 0x50ea
jmp 0x5113
movl $0xf4240, %r9d          # imm = 0xF4240
movb $0x1, %r10b
cmpl $0xf423f, %r9d          # imm = 0xF423F
jg 0x513b
incl %r9d
movl %r9d, (%rcx,%r8,4)
movl 0x98(%rbx), %r11d
cmpl %r9d, %r11d
cmovgl %r11d, %r9d
movl %r9d, 0x98(%rbx)
incq %r8
cmpq %rdx, %r8
jne 0x50ba
testb $0x1, %r10b
movzbl %sil, %esi
cmovel %edi, %esi
jmp 0x5157
movb $0x1, %sil
testb $0x1, %sil
je 0x50ac
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq