// File: /workspace/github_cpp_makefile_star2_O2/dannycalegari[P]circle_pack/./Input_handler.cc
// Function: input_routine(Packing&, bool&)
void input_routine(Packing &P, bool &finished){
	char c;
	string s;
	ifstream packing_input_file;
	ofstream packing_output_file, eps_output_file;
	int i;
	Point Q;
	
	cout << "Current packing has " << P.size() << " circles. \n";
	cout << "Enter command ([h] for help):";
	cin >> c;
	switch (c){
		case 'h':
			cout << "[h] for help (i.e. return to this list) \n";
			cout << "[v] to toggle verbose \n";
			cout << "[r] to read packing from a file \n";
			cout << "[g] to change geometry \n";
			cout << "[n] to normalize Euclidean coordinates \n";
			cout << "[w] to write packing to a file \n";
			cout << "[e] to write .eps output \n";
			cout << "[f] to find closest center \n";
			cout << "[q] to quit to graphics display \n";
			break;
		case 'v':
			P.toggle_verbose();
			break;
		case 'r':
			cout << "enter name of packing file to read from:";
			cin >> s;
			packing_input_file.open(s.c_str());
			P.read_packing(packing_input_file);
			packing_input_file.close();
			cout << "read packing from file " << s << "\n";
			cout << "finding radii.\n";
			P.find_radii(0.000000001);
			cout << "radii found.\n";
			cout << "determining layout.\n";
			P.determine_layout();
			cout << "layout determined.\n";
			cout << "determining centers.\n";
			P.determine_centers();
			cout << "centers determined.\n";
			break;
		case 'g':
			cout << "change to what geometry (S/E/H):";
			cin >> c;
			P.change_geometry(c);
			cout << "geometry changed.\n";
			break;
		case 'n':
			cout << "normalizing coordinates.\n";
			P.rescale();
			break;
		case 'w':
			cout << "enter name of packing file to write to:";
			cin >> s;
			packing_output_file.open(s.c_str());
			P.write_packing(packing_output_file);
			packing_output_file.close();
			cout << "wrote packing to file " << s << "\n";
			break;
		case 'e':
			cout << "enter name of .eps file to write to:";
			cin >> s;
			eps_output_file.open(s.c_str());
			P.write_packing_eps(eps_output_file);
			eps_output_file.close();
			cout << "wrote .eps to file " << s << "\n";
			break;
		case 'f':
			cout << "current geometry is " << P.write_geometry() << "\n";
			cout << "enter coordinates of point: ";
			cin >> Q.x >> Q.y >> Q.z;
			i=P.find_closest_vertex(Q);
			cout << "closest point is " << i << "\n";
			break;
		case 'q':
			cout << "quit to graphics display.\n" 
				<< "focus in graphics window and press [q] again to exit.\n";
			finished=true;
			break;
		default:
			break;
	};
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x660, %rsp            # imm = 0x660
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x458(%rsp), %rdi
callq 0x2220
leaq 0x258(%rsp), %rdi
callq 0x2390
leaq 0x58(%rsp), %rdi
callq 0x2390
movq 0x6178(%rip), %rdi      # 0xcfd0
leaq 0x286b(%rip), %rsi      # 0x96ca
callq 0x21e0
movq %rax, %rdi
movq 0x8(%rbx), %rax
subq (%rbx), %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movl %eax, %esi
callq 0x23a0
leaq 0x285b(%rip), %rsi      # 0x96df
movq %rax, %rdi
callq 0x21e0
movq 0x613d(%rip), %rdi      # 0xcfd0
leaq 0x2851(%rip), %rsi      # 0x96eb
callq 0x21e0
movq 0x613a(%rip), %rdi      # 0xcfe0
leaq 0x1f(%rsp), %rsi
callq 0x2270
movzbl 0x1f(%rsp), %eax
addl $-0x65, %eax
cmpl $0x12, %eax
ja 0x72b4
leaq 0x2270(%rip), %rcx      # 0x9138
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60f8(%rip), %rdi      # 0xcfd0
leaq 0x2a75(%rip), %rsi      # 0x9954
callq 0x21e0
movq 0x60f5(%rip), %rdi      # 0xcfe0
leaq 0x20(%rsp), %rsi
callq 0x2250
movq 0x20(%rsp), %rsi
leaq 0x58(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x2030
leaq 0x58(%rsp), %rsi
movq %rbx, %rdi
callq 0x69ae
leaq 0x58(%rsp), %rdi
callq 0x22c0
leaq 0x2a54(%rip), %rsi      # 0x9979
jmp 0x7286
movq 0x609f(%rip), %r15      # 0xcfd0
leaq 0x298f(%rip), %rsi      # 0x98c7
movq %r15, %rdi
callq 0x21e0
movq 0x6099(%rip), %rdi      # 0xcfe0
leaq 0x1f(%rsp), %rsi
callq 0x2270
movsbl 0x1f(%rsp), %esi
movq %rbx, %rdi
callq 0x5098
leaq 0x2983(%rip), %r14      # 0x98e8
jmp 0x72a9
movq 0x605f(%rip), %rdi      # 0xcfd0
leaq 0x2a59(%rip), %rsi      # 0x99d1
callq 0x21e0
leaq 0x2a68(%rip), %rsi      # 0x99ec
movq %rax, %rdi
callq 0x21e0
movb $0x1, (%r14)
jmp 0x72b4
movq 0x6034(%rip), %rdi      # 0xcfd0
leaq 0x29ea(%rip), %rsi      # 0x998d
callq 0x21e0
movsbl 0x60(%rbx), %esi
movq %rax, %rdi
callq 0x2230
leaq 0x2776(%rip), %r14      # 0x9731
movq %rax, %rdi
movq %r14, %rsi
callq 0x21e0
movq 0x6003(%rip), %rdi      # 0xcfd0
leaq 0x29ce(%rip), %rsi      # 0x99a2
callq 0x21e0
movq 0x6000(%rip), %rdi      # 0xcfe0
leaq 0x40(%rsp), %rsi
callq 0x2120
leaq 0x48(%rsp), %rsi
movq %rax, %rdi
callq 0x2120
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x2120
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x40(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x5ad2
movl %eax, %ebx
movq 0x5fa8(%rip), %rdi      # 0xcfd0
leaq 0x2990(%rip), %rsi      # 0x99bf
callq 0x21e0
movq %rax, %rdi
movl %ebx, %esi
callq 0x23a0
movq %rax, %r15
jmp 0x72a9
movq 0x5f83(%rip), %rdi      # 0xcfd0
leaq 0x27d6(%rip), %rsi      # 0x982a
callq 0x21e0
movq 0x5f80(%rip), %rdi      # 0xcfe0
leaq 0x20(%rsp), %rsi
callq 0x2250
movq 0x20(%rsp), %rsi
leaq 0x458(%rsp), %rdi
pushq $0x8
popq %rdx
callq 0x2110
leaq 0x458(%rsp), %rsi
movq %rbx, %rdi
callq 0x4216
leaq 0x458(%rsp), %rdi
callq 0x2050
movq 0x5f2d(%rip), %rdi      # 0xcfd0
leaq 0x27a9(%rip), %rsi      # 0x9853
callq 0x21e0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x21a0
leaq 0x266e(%rip), %rsi      # 0x9731
movq %rax, %rdi
callq 0x21e0
movq 0x5efe(%rip), %rdi      # 0xcfd0
leaq 0x2792(%rip), %rsi      # 0x986b
callq 0x21e0
movsd 0x204a(%rip), %xmm0     # 0x9130
movq %rbx, %rdi
callq 0x3cd4
movq 0x5edb(%rip), %rdi      # 0xcfd0
leaq 0x277f(%rip), %rsi      # 0x987b
callq 0x21e0
movq 0x5ec8(%rip), %rdi      # 0xcfd0
leaq 0x277a(%rip), %rsi      # 0x9889
callq 0x21e0
movq %rbx, %rdi
callq 0x45c6
movq 0x5ead(%rip), %rdi      # 0xcfd0
leaq 0x2774(%rip), %rsi      # 0x989e
callq 0x21e0
movq 0x5e9a(%rip), %r15      # 0xcfd0
leaq 0x226b(%rip), %rsi      # 0x93a8
movq %r15, %rdi
callq 0x21e0
movq %rbx, %rdi
callq 0x4d98
leaq 0x275e(%rip), %r14      # 0x98b2
jmp 0x72a9
movq %rbx, %rdi
callq 0x785c
jmp 0x72b4
movq 0x5e63(%rip), %rdi      # 0xcfd0
leaq 0x2595(%rip), %rsi      # 0x9709
callq 0x21e0
movq 0x5e50(%rip), %rdi      # 0xcfd0
leaq 0x25ac(%rip), %rsi      # 0x9733
callq 0x21e0
movq 0x5e3d(%rip), %rdi      # 0xcfd0
leaq 0x25b1(%rip), %rsi      # 0x974b
callq 0x21e0
movq 0x5e2a(%rip), %rdi      # 0xcfd0
leaq 0x25c0(%rip), %rsi      # 0x976d
callq 0x21e0
movq 0x5e17(%rip), %rdi      # 0xcfd0
leaq 0x25c6(%rip), %rsi      # 0x9786
callq 0x21e0
movq 0x5e04(%rip), %rdi      # 0xcfd0
leaq 0x25dc(%rip), %rsi      # 0x97af
callq 0x21e0
movq 0x5df1(%rip), %r15      # 0xcfd0
leaq 0x25ea(%rip), %rsi      # 0x97d0
movq %r15, %rdi
callq 0x21e0
leaq 0x25f6(%rip), %rsi      # 0x97eb
movq %r15, %rdi
callq 0x21e0
leaq 0x2604(%rip), %r14      # 0x9808
jmp 0x72a9
movq 0x5dc0(%rip), %rdi      # 0xcfd0
leaq 0x26e4(%rip), %rsi      # 0x98fb
callq 0x21e0
movq %rbx, %rdi
callq 0x3488
jmp 0x72b4
movq 0x5da0(%rip), %rdi      # 0xcfd0
leaq 0x26de(%rip), %rsi      # 0x9915
callq 0x21e0
movq 0x5d9d(%rip), %rdi      # 0xcfe0
leaq 0x20(%rsp), %rsi
callq 0x2250
movq 0x20(%rsp), %rsi
leaq 0x258(%rsp), %rdi
pushq $0x10
popq %rdx
callq 0x2030
leaq 0x258(%rsp), %rsi
movq %rbx, %rdi
callq 0x6ca8
leaq 0x258(%rsp), %rdi
callq 0x22c0
leaq 0x26b7(%rip), %rsi      # 0x993d
movq 0x5d43(%rip), %rdi      # 0xcfd0
callq 0x21e0
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x21a0
movq %rax, %r15
leaq 0x2488(%rip), %r14      # 0x9731
movq %r15, %rdi
movq %r14, %rsi
callq 0x21e0
leaq 0x58(%rsp), %rdi
callq 0x22f0
leaq 0x258(%rsp), %rdi
callq 0x22f0
leaq 0x458(%rsp), %rdi
callq 0x2070
leaq 0x20(%rsp), %rdi
callq 0x20d0
addq $0x660, %rsp            # imm = 0x660
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
jmp 0x730b
movq %rax, %rbx
jmp 0x7318
movq %rax, %rbx
jmp 0x7325
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x22f0
leaq 0x258(%rsp), %rdi
callq 0x22f0
leaq 0x458(%rsp), %rdi
callq 0x2070
leaq 0x20(%rsp), %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x23c0