// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpb $0x1, 0xb8(%rdi)
jne 0x4ee8
movq 0x90f9(%rip), %rdi      # 0xdfd0
leaq 0x53e6(%rip), %rsi      # 0xa2c4
movl $0x21, %edx
callq 0x2220
movq 0x80(%rbx), %rcx
cmpq %rcx, 0x88(%rbx)
je 0x4eff
movq %rcx, 0x88(%rbx)
movl $0x0, 0x98(%rbx)
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
movq %rdx, %rsi
subq %rax, %rsi
shrq $0x3, %rsi
imull $0xaaaaaaab, %esi, %esi # imm = 0xAAAAAAAB
testl %esi, %esi
jle 0x4f88
leaq 0x80(%rbx), %r14
xorl %ebp, %ebp
leaq 0xc(%rsp), %r15
movl $0xffffffff, 0xc(%rsp)  # imm = 0xFFFFFFFF
movq 0x88(%rbx), %rsi
cmpq 0x90(%rbx), %rsi
je 0x4f5d
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
addq $0x4, %rsi
movq %rsi, 0x88(%rbx)
jmp 0x4f6f
movq %r14, %rdi
movq %r15, %rdx
callq 0x9ca0
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
incl %ebp
movq %rdx, %rcx
subq %rax, %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %esi # imm = 0xAAAAAAAB
cmpl %esi, %ebp
jl 0x4f32
movq (%r14), %rcx
movslq 0xbc(%rbx), %rdx
movl $0x0, (%rcx,%rdx,4)
movl %esi, %edx
xorl %esi, %esi
movl $0x1, %edi
testl %edx, %edx
jle 0x5047
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpl $-0x1, (%rcx,%r8,4)
je 0x4fbe
incq %r8
cmpq %rdx, %r8
jne 0x4fad
jmp 0x5032
leaq (%r8,%r8,2), %r9
movq (%rax,%r9,8), %r10
movq 0x8(%rax,%r9,8), %r11
subq %r10, %r11
shrq $0x2, %r11
movb $0x1, %r9b
testl %r11d, %r11d
jle 0x4fb4
andl $0x7fffffff, %r11d      # imm = 0x7FFFFFFF
movl $0xf4240, %ebp          # imm = 0xF4240
xorl %r14d, %r14d
movl %ebp, %r15d
movslq (%r10,%r14,4), %r12
movl (%rcx,%r12,4), %r12d
cmpl %r12d, %ebp
movl %r12d, %ebp
cmovll %r15d, %ebp
cmpl $-0x1, %r12d
cmovel %r15d, %ebp
incq %r14
cmpq %r14, %r11
jne 0x4fe9
cmpl $0xf423f, %ebp          # imm = 0xF423F
jg 0x4fb4
incl %ebp
movl %ebp, (%rcx,%r8,4)
movl 0x98(%rbx), %r10d
cmpl %ebp, %r10d
cmovgl %r10d, %ebp
movl %ebp, 0x98(%rbx)
jmp 0x4fb4
testb $0x1, %r9b
movzbl %sil, %esi
cmovel %edi, %esi
testb $0x1, %sil
je 0x4f9f
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq