// File: /workspace/github_cpp_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x668, %rsp            # imm = 0x668
movq %rsi, %r12
movq %rdi, %r15
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x460(%rsp), %rdi
callq 0x2210
leaq 0x260(%rsp), %rbx
movq %rbx, %rdi
callq 0x2380
leaq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x2380
movq 0x671d(%rip), %rdi      # 0xefd0
leaq 0x2de8(%rip), %rsi      # 0xb6a2
movl $0x14, %edx
callq 0x2220
movq 0x8(%r15), %rax
subq (%r15), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %esi # imm = 0xAAAAAAAB
movq 0x66f4(%rip), %rdi      # 0xefd0
callq 0x2390
leaq 0x2dcf(%rip), %rsi      # 0xb6b7
movl $0xb, %edx
movq %rax, %rdi
callq 0x2220
movq 0x66d4(%rip), %rdi      # 0xefd0
leaq 0x2dc0(%rip), %rsi      # 0xb6c3
movl $0x1d, %edx
callq 0x2220
movq 0x66cc(%rip), %rdi      # 0xefe0
leaq 0x26(%rsp), %rsi
callq 0x2260
movzbl 0x26(%rsp), %eax
addl $-0x65, %eax
cmpl $0x12, %eax
ja 0x8e04
leaq 0x27da(%rip), %rcx      # 0xb110
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x668a(%rip), %rdi      # 0xefd0
leaq 0x2fdf(%rip), %rsi      # 0xb92c
movl $0x24, %edx
callq 0x2220
movq 0x6682(%rip), %rdi      # 0xefe0
leaq 0x28(%rsp), %rsi
callq 0x2240
movq 0x28(%rsp), %rsi
leaq 0x60(%rsp), %rdi
movl $0x10, %edx
callq 0x2030
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
callq 0x82c6
leaq 0x60(%rsp), %rdi
callq 0x22b0
movq 0x6636(%rip), %rdi      # 0xefd0
leaq 0x2fb0(%rip), %rsi      # 0xb951
movl $0x13, %edx
callq 0x2220
jmp 0x8dd4
movq 0x6619(%rip), %r13      # 0xefd0
leaq 0x2ee1(%rip), %rsi      # 0xb89f
movl $0x20, %edx
movq %r13, %rdi
callq 0x2220
movq 0x660e(%rip), %rdi      # 0xefe0
leaq 0x26(%rsp), %rsi
callq 0x2260
movsbl 0x26(%rsp), %esi
movq %r15, %rdi
callq 0x6322
movl $0x12, %edx
leaq 0x2ecb(%rip), %r12      # 0xb8c0
jmp 0x8df9
movq 0x65cf(%rip), %rdi      # 0xefd0
leaq 0x2fa1(%rip), %rsi      # 0xb9a9
movl $0x1a, %edx
callq 0x2220
movq 0x65b7(%rip), %rdi      # 0xefd0
leaq 0x2fa4(%rip), %rsi      # 0xb9c4
movl $0x36, %edx
callq 0x2220
movb $0x1, (%r12)
jmp 0x8e04
movq 0x6595(%rip), %rdi      # 0xefd0
leaq 0x2f23(%rip), %rsi      # 0xb965
movl $0x14, %edx
callq 0x2220
movb 0x60(%r15), %al
leaq 0x27(%rsp), %rsi
movb %al, (%rsi)
movq 0x6572(%rip), %rdi      # 0xefd0
movl $0x1, %edx
callq 0x2220
leaq 0x2c9a(%rip), %r12      # 0xb709
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2220
movq 0x654a(%rip), %rdi      # 0xefd0
leaq 0x2eed(%rip), %rsi      # 0xb97a
movl $0x1c, %edx
callq 0x2220
movq 0x6542(%rip), %rdi      # 0xefe0
leaq 0x48(%rsp), %rsi
callq 0x2120
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x2120
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
callq 0x2120
movq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
movups 0x48(%rsp), %xmm0
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0x7070
movl %eax, %ebp
movq 0x64ea(%rip), %rdi      # 0xefd0
leaq 0x2eaa(%rip), %rsi      # 0xb997
movl $0x11, %edx
callq 0x2220
movq 0x64d2(%rip), %rdi      # 0xefd0
movl %ebp, %esi
callq 0x2390
movq %rax, %r13
movl $0x1, %edx
jmp 0x8df9
movq 0x64b7(%rip), %rdi      # 0xefd0
leaq 0x2ce2(%rip), %rsi      # 0xb802
movl $0x28, %edx
callq 0x2220
movq 0x64af(%rip), %rdi      # 0xefe0
leaq 0x28(%rsp), %rsi
callq 0x2240
movq 0x28(%rsp), %rsi
leaq 0x460(%rsp), %rdi
movl $0x8, %edx
callq 0x2110
leaq 0x460(%rsp), %rsi
movq %r15, %rdi
callq 0x4dce
leaq 0x460(%rsp), %rdi
callq 0x2050
movq 0x645a(%rip), %rdi      # 0xefd0
leaq 0x2cae(%rip), %rsi      # 0xb82b
movl $0x17, %edx
callq 0x2220
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x6438(%rip), %rdi      # 0xefd0
callq 0x2220
leaq 0x2b65(%rip), %rsi      # 0xb709
movl $0x1, %edx
movq %rax, %rdi
callq 0x2220
movq 0x6418(%rip), %rdi      # 0xefd0
leaq 0x2c84(%rip), %rsi      # 0xb843
movl $0xf, %edx
callq 0x2220
movsd 0x24e7(%rip), %xmm0     # 0xb0b8
movq %r15, %rdi
callq 0x4738
movq 0x63f0(%rip), %rdi      # 0xefd0
leaq 0x2c6c(%rip), %rsi      # 0xb853
movl $0xd, %edx
callq 0x2220
movq 0x63d8(%rip), %rdi      # 0xefd0
leaq 0x2c62(%rip), %rsi      # 0xb861
movl $0x14, %edx
callq 0x2220
movq %r15, %rdi
callq 0x52da
movq 0x63b8(%rip), %rdi      # 0xefd0
leaq 0x2c57(%rip), %rsi      # 0xb876
movl $0x13, %edx
callq 0x2220
movq 0x63a0(%rip), %r13      # 0xefd0
leaq 0x2749(%rip), %rsi      # 0xb380
movl $0x15, %edx
movq %r13, %rdi
callq 0x2220
movq %r15, %rdi
callq 0x5f68
movl $0x14, %edx
leaq 0x2c32(%rip), %r12      # 0xb88a
jmp 0x8df9
movq %r15, %rdi
callq 0x93aa
jmp 0x8e04
movq 0x635f(%rip), %rdi      # 0xefd0
leaq 0x2a69(%rip), %rsi      # 0xb6e1
movl $0x29, %edx
callq 0x2220
movq 0x6347(%rip), %rdi      # 0xefd0
leaq 0x2a7b(%rip), %rsi      # 0xb70b
movl $0x17, %edx
callq 0x2220
movq 0x632f(%rip), %rdi      # 0xefd0
leaq 0x2a7b(%rip), %rsi      # 0xb723
movl $0x21, %edx
callq 0x2220
movq 0x6317(%rip), %rdi      # 0xefd0
leaq 0x2a85(%rip), %rsi      # 0xb745
movl $0x18, %edx
callq 0x2220
movq 0x62ff(%rip), %rdi      # 0xefd0
leaq 0x2a86(%rip), %rsi      # 0xb75e
movl $0x28, %edx
callq 0x2220
movq 0x62e7(%rip), %rdi      # 0xefd0
leaq 0x2a97(%rip), %rsi      # 0xb787
movl $0x20, %edx
callq 0x2220
movq 0x62cf(%rip), %r13      # 0xefd0
leaq 0x2aa0(%rip), %rsi      # 0xb7a8
movl $0x1a, %edx
movq %r13, %rdi
callq 0x2220
leaq 0x2aa7(%rip), %rsi      # 0xb7c3
movl $0x1c, %edx
movq %r13, %rdi
callq 0x2220
movl $0x21, %edx
leaq 0x2aab(%rip), %r12      # 0xb7e0
jmp 0x8df9
movq 0x628f(%rip), %rdi      # 0xefd0
leaq 0x2b8b(%rip), %rsi      # 0xb8d3
movl $0x19, %edx
callq 0x2220
movq %r15, %rdi
callq 0x3e38
jmp 0x8e04
movq 0x626a(%rip), %rdi      # 0xefd0
leaq 0x2b80(%rip), %rsi      # 0xb8ed
movl $0x27, %edx
callq 0x2220
movq 0x6262(%rip), %rdi      # 0xefe0
leaq 0x28(%rsp), %rsi
callq 0x2240
movq 0x28(%rsp), %rsi
leaq 0x260(%rsp), %rdi
movl $0x10, %edx
callq 0x2030
leaq 0x260(%rsp), %rsi
movq %r15, %rdi
callq 0x8670
leaq 0x260(%rsp), %rdi
callq 0x22b0
movq 0x620d(%rip), %rdi      # 0xefd0
leaq 0x2b4b(%rip), %rsi      # 0xb915
movl $0x16, %edx
callq 0x2220
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq 0x61eb(%rip), %rdi      # 0xefd0
callq 0x2220
movq %rax, %r13
movl $0x1, %edx
leaq 0x2910(%rip), %r12      # 0xb709
movq %r13, %rdi
movq %r12, %rsi
callq 0x2220
movq 0x61bd(%rip), %rax      # 0xefc8
movq (%rax), %r15
movq 0x18(%rax), %r12
leaq 0x68(%rsp), %rdi
movq %r15, -0x8(%rdi)
movq -0x18(%r15), %rax
movq %r12, 0x60(%rsp,%rax)
callq 0x2190
movl $0xf8, %r13d
addq %r13, %r14
movq %r14, %rdi
callq 0x20a0
leaq 0x268(%rsp), %rdi
movq %r15, -0x8(%rdi)
movq -0x18(%r15), %rax
movq %r12, 0x260(%rsp,%rax)
callq 0x2190
addq %r13, %rbx
movq %rbx, %rdi
callq 0x20a0
leaq 0x460(%rsp), %rdi
callq 0x2070
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x8e8b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21f0
addq $0x668, %rsp            # imm = 0x668
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x8eb9
movq %rax, %rbx
jmp 0x8ec6
movq %rax, %rbx
jmp 0x8ed3
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x22e0
leaq 0x260(%rsp), %rdi
callq 0x22e0
leaq 0x460(%rsp), %rdi
callq 0x2070
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x8eef
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21f0
movq %rbx, %rdi
callq 0x23b0