// File: dannycalegari[P]circle_pack/circle_pack.cc
// Function: main
int main(int argc, char *argv[]){

	bool finished=false;
	Packing P;
	ifstream packing_input_file;
	
	if(argc>1){
		packing_input_file.open(argv[1]);
		P.read_packing(packing_input_file);
		packing_input_file.close();
		P.toggle_verbose();
		P.find_radii(0.000000001);
		P.determine_layout();
		P.determine_centers();
		P.change_geometry('E');
		P.rescale();
		P.change_geometry('S');
		finished=true;
	} else {
		cout << "Welcome to interactive circle_pack.\n";
		cout << "For a list of commands, type [h] for help.\n";
		cout << "To run circle_pack non-interactively,\n";
		cout << "Type circle_pack <filename.txt> \n";	
	};

	while(finished==false){
		input_routine(P,finished);
	};
	
	setup_graphics();
	XFlush(display);
	usleep(100000);
	XSetInputFocus(display, win, RevertToNone, CurrentTime);
	finished=false;
	while(finished==false){
		graphics_routine(P,finished);
	};
		
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0xaf00
leaq -0x300(%rbp), %rdi
callq 0x2230
jmp 0xa027
cmpl $0x1, -0x8(%rbp)
jle 0xa126
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x300(%rbp), %rdi
movl $0x8, %edx
callq 0x2130
jmp 0xa04c
leaq -0xf8(%rbp), %rdi
leaq -0x300(%rbp), %rsi
callq 0x5190
jmp 0xa061
leaq -0x300(%rbp), %rdi
callq 0x2050
jmp 0xa06f
leaq -0xf8(%rbp), %rdi
callq 0xae80
jmp 0xa07d
leaq -0xf8(%rbp), %rdi
movsd 0x7024(%rip), %xmm0     # 0x110b0
callq 0x4b00
jmp 0xa093
leaq -0xf8(%rbp), %rdi
callq 0x5740
jmp 0xa0a1
leaq -0xf8(%rbp), %rdi
callq 0x6320
jmp 0xa0af
leaq -0xf8(%rbp), %rdi
movl $0x45, %esi
callq 0x68e0
jmp 0xa0c2
leaq -0xf8(%rbp), %rdi
callq 0x3de0
jmp 0xa0d0
leaq -0xf8(%rbp), %rdi
movl $0x53, %esi
callq 0x68e0
jmp 0xa0e3
movb $0x1, -0x11(%rbp)
jmp 0xa17c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x308(%rbp)
movl %eax, -0x30c(%rbp)
jmp 0xa229
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x308(%rbp)
movl %eax, -0x30c(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x2080
jmp 0xa229
movq 0xdea3(%rip), %rdi      # 0x17fd0
leaq 0x78b7(%rip), %rsi      # 0x119eb
callq 0x21f0
jmp 0xa13b
movq 0xde8e(%rip), %rdi      # 0x17fd0
leaq 0x78c7(%rip), %rsi      # 0x11a10
callq 0x21f0
jmp 0xa150
movq 0xde79(%rip), %rdi      # 0x17fd0
leaq 0x78de(%rip), %rsi      # 0x11a3c
callq 0x21f0
jmp 0xa165
movq 0xde64(%rip), %rdi      # 0x17fd0
leaq 0x78f0(%rip), %rsi      # 0x11a63
callq 0x21f0
jmp 0xa17a
jmp 0xa17c
jmp 0xa17e
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xa19f
leaq -0xf8(%rbp), %rdi
leaq -0x11(%rbp), %rsi
callq 0x9880
jmp 0xa19d
jmp 0xa17e
callq 0x80c0
jmp 0xa1a6
movq 0xe093(%rip), %rdi      # 0x18240
callq 0x2330
jmp 0xa1b4
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x22d0
jmp 0xa1c0
movq 0xe079(%rip), %rdi      # 0x18240
movq 0xe152(%rip), %rsi      # 0x18320
xorl %edx, %edx
movl %edx, %ecx
callq 0x2150
jmp 0xa1d9
movb $0x0, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xa1fe
leaq -0xf8(%rbp), %rdi
leaq -0x11(%rbp), %rsi
callq 0x9140
jmp 0xa1fc
jmp 0xa1dd
movl $0x0, -0x4(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x2080
leaq -0xf8(%rbp), %rdi
callq 0xaf90
movl -0x4(%rbp), %eax
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
leaq -0xf8(%rbp), %rdi
callq 0xaf90
movq -0x308(%rbp), %rdi
callq 0x23c0
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)