// File: dannycalegari[P]circle_pack/./Packing.cc
// Function: Packing::read_packing(std::basic_ifstream<char, std::char_traits<char>>&)
void Packing::read_packing(ifstream &packing_file){	// read packing from a file
	/* should give the option of reading radii, geometry, INFV and ZERV; these are commented out */
	int vertices, valence, i, j, k;
	vector<int> L;	// adjacency_list
//	double d;
//	char c;
//	int I;
	adj.clear();				// initialize, in case we already have a packing
	packing_file >> vertices;	// reading adj
	for(i=0;i<vertices;i++){
		packing_file >> valence;
		for(j=0;j<valence;j++){
			packing_file >> k;
			L.push_back(k);
		};
		adj.push_back(L);
		L.clear();
	};
	
	/* for the moment, just sets radii all to 0.1 and sets geometry to 'H', INFV to 0 and ZERV to -1 */
//	if(packing_file.eof()){	// didn't bother to set radii
		for(i=0;i<vertices;i++){ 
			rad.push_back(0.01);	// setting all initial radii to 0.01; default value
		};
//	} else {
	//	for(i=0;i<vertices;i++){
	//		packing_file >> d;	// reading radii; 
	//	};
//	};

//	if(packing_file.eof()){	// default values - old format
		geometry='H';		
		INFV=0;
		ZERV=-1;
//	} else {
//		packing_file >> c;	// reading geometry
//		geometry=c;
//		packing_file >> I;	// reading INFV
//		INFV=I;
//		packing_file >> I;	// reading ZERV
//		ZERV=I;
//	};
	verbose=true;			//	default values
	VIEWMATRIX=ROT(0.0);	//	default values
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xa5e0
movq -0x78(%rbp), %rdi
callq 0xa600
movq -0x10(%rbp), %rdi
leaq -0x14(%rbp), %rsi
callq 0x2100
jmp 0x51cc
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x5268
movq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x2100
jmp 0x51ee
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x5242
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x2100
jmp 0x520c
leaq -0x40(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0xa550
jmp 0x521b
jmp 0x521d
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x51f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xa6c0
jmp 0x5305
movq -0x78(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xa620
jmp 0x5251
leaq -0x40(%rbp), %rdi
callq 0xa500
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x51d3
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x52a5
movq -0x78(%rbp), %rdi
addq $0x18, %rdi
movabsq $0x3f847ae147ae147b, %rax # imm = 0x3F847AE147AE147B
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %rsi
callq 0xa310
jmp 0x5298
jmp 0x529a
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x526f
movq -0x78(%rbp), %rax
movb $0x48, 0x60(%rax)
movl $0x0, 0xbc(%rax)
movl $0xffffffff, 0xc0(%rax) # imm = 0xFFFFFFFF
movb $0x1, 0xb8(%rax)
leaq -0x70(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x2980
jmp 0x52d6
movq -0x78(%rbp), %rdi
addq $0xc8, %rdi
leaq -0x70(%rbp), %rsi
callq 0xa690
leaq -0x70(%rbp), %rdi
callq 0xa410
leaq -0x40(%rbp), %rdi
callq 0xa6c0
addq $0x80, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x23c0
nop