// File: dannycalegari[P]circle_pack/./output.cc
// Function: Packing::write_packing_eps(std::basic_ofstream<char, std::char_traits<char>>&)
void Packing::write_packing_eps(ofstream &outfile){
	int i;
	if(geometry=='E'){
		outfile << "%!PS-Adobe-2.0 EPSF-2.0 \n";
		outfile << "%%BoundingBox: 0 0 500 500 \n";
		outfile << "gsave 100 100 scale 2.5 2.5 translate \n";
		outfile << "/min { 2 copy gt { exch } if pop } bind def \n";
		outfile << "/c {3 dict begin /r exch def /y exch def /x exch def \n";
		outfile << "1 50 div r 10 div min setlinewidth \n";
		outfile << "newpath x y r 0 360 arc stroke end} def \n";
		for(i=0;i< size();i++){
			outfile << center[i].x << " " << center[i].y << " " << fabs(rad[i]) << " c\n";
		};
		outfile << "grestore %eof \n";
	} else if(geometry=='S'){
		outfile << "%!PS-Adobe-2.0 EPSF-2.0 \n";
		outfile << "%%BoundingBox: 0 0 500 500 \n";
		outfile << "gsave 200 200 scale 1.25 1.25 translate 1 200 div setlinewidth \n";
		outfile << "/arccos { 2 dict begin /base exch def /opp 1 base base mul sub \n";
		outfile << "sqrt def opp base atan end } def \n";
		outfile << "/c { 3 dict begin /R exch 360 mul " << TWOPI <<" div def \n";
		outfile << "/beta exch 360 mul " << TWOPI <<" div def /gamma exch 360 mul " << TWOPI <<" div \n";
		outfile << "def gsave beta rotate 0 gamma sin R cos mul translate 1 gamma \n";
		outfile << "cos scale newpath 0 0 R sin 0 360 arc stroke fill grestore end } def \n";
		for(i=0;i< size();i++){
			outfile << acos(center[i].z) << " " << atan2(center[i].x,center[i].y) 
				<< " " << rad[i] << " c\n";
		};
		outfile << "newpath 0 0 1 0 360 arc stroke grestore %eof \n";
	};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movsbl 0x60(%rax), %eax
cmpl $0x45, %eax
jne 0x9494
movq -0x10(%rbp), %rdi
leaq 0x8076(%rip), %rsi      # 0x113b6
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x8080(%rip), %rsi      # 0x113d0
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x808d(%rip), %rsi      # 0x113ed
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x80a5(%rip), %rsi      # 0x11415
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x80c3(%rip), %rsi      # 0x11443
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x80ea(%rip), %rsi      # 0x1147a
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x80ff(%rip), %rsi      # 0x1149f
callq 0x21f0
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
callq 0xae40
movl %eax, %ecx
movl -0x24(%rbp), %eax
cmpl %ecx, %eax
jge 0x947f
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
addq $0xa0, %rdi
movslq -0x14(%rbp), %rsi
callq 0xa5c0
movq -0x40(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x2400
movq %rax, %rdi
leaq 0x8295(%rip), %rsi      # 0x11690
callq 0x21f0
movq -0x20(%rbp), %rdi
movq %rax, -0x38(%rbp)
addq $0xa0, %rdi
movslq -0x14(%rbp), %rsi
callq 0xa5c0
movq -0x38(%rbp), %rdi
movsd 0x8(%rax), %xmm0
callq 0x2400
movq %rax, %rdi
leaq 0x8260(%rip), %rsi      # 0x11690
callq 0x21f0
movq -0x20(%rbp), %rdi
movq %rax, -0x30(%rbp)
addq $0x18, %rdi
movslq -0x14(%rbp), %rsi
callq 0xa270
movq -0x30(%rbp), %rdi
movsd (%rax), %xmm0
movaps 0x7c77(%rip), %xmm1     # 0x110d0
pand %xmm1, %xmm0
callq 0x2400
movq %rax, %rdi
leaq 0x805d(%rip), %rsi      # 0x114c9
callq 0x21f0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x93ac
movq -0x10(%rbp), %rdi
leaq 0x81f5(%rip), %rsi      # 0x1167f
callq 0x21f0
jmp 0x96a0
movq -0x20(%rbp), %rax
movsbl 0x60(%rax), %eax
cmpl $0x53, %eax
jne 0x969e
movq -0x10(%rbp), %rdi
leaq 0x7f06(%rip), %rsi      # 0x113b6
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x7f10(%rip), %rsi      # 0x113d0
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x7ffd(%rip), %rsi      # 0x114cd
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x802e(%rip), %rsi      # 0x1150e
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x805f(%rip), %rsi      # 0x1154f
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x8072(%rip), %rsi      # 0x11572
callq 0x21f0
movq %rax, %rdi
movsd 0x7b18(%rip), %xmm0     # 0x11028
callq 0x2400
movq %rax, %rdi
leaq 0x8076(%rip), %rsi      # 0x11595
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x8071(%rip), %rsi      # 0x115a0
callq 0x21f0
movq %rax, %rdi
movsd 0x7ae9(%rip), %xmm0     # 0x11028
callq 0x2400
movq %rax, %rdi
leaq 0x8066(%rip), %rsi      # 0x115b4
callq 0x21f0
movq %rax, %rdi
movsd 0x7aca(%rip), %xmm0     # 0x11028
callq 0x2400
movq %rax, %rdi
leaq 0x8065(%rip), %rsi      # 0x115d2
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x805c(%rip), %rsi      # 0x115d9
callq 0x21f0
movq -0x10(%rbp), %rdi
leaq 0x808c(%rip), %rsi      # 0x11619
callq 0x21f0
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0x44(%rbp)
callq 0xae40
movl %eax, %ecx
movl -0x44(%rbp), %eax
cmpl %ecx, %eax
jge 0x968e
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
addq $0xa0, %rdi
movslq -0x14(%rbp), %rsi
callq 0xa5c0
movsd 0x10(%rax), %xmm0
callq 0x21d0
movq -0x68(%rbp), %rdi
callq 0x2400
movq %rax, %rdi
leaq 0x80a2(%rip), %rsi      # 0x11690
callq 0x21f0
movq -0x20(%rbp), %rdi
movq %rax, -0x58(%rbp)
addq $0xa0, %rdi
movslq -0x14(%rbp), %rsi
callq 0xa5c0
movq -0x20(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
addq $0xa0, %rdi
movslq -0x14(%rbp), %rsi
callq 0xa5c0
movsd -0x60(%rbp), %xmm0
movsd 0x8(%rax), %xmm1
callq 0x2040
movq -0x58(%rbp), %rdi
callq 0x2400
movq %rax, %rdi
leaq 0x8046(%rip), %rsi      # 0x11690
callq 0x21f0
movq -0x20(%rbp), %rdi
movq %rax, -0x50(%rbp)
addq $0x18, %rdi
movslq -0x14(%rbp), %rsi
callq 0xa270
movq -0x50(%rbp), %rdi
movsd (%rax), %xmm0
callq 0x2400
movq %rax, %rdi
leaq 0x7e4e(%rip), %rsi      # 0x114c9
callq 0x21f0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x9599
movq -0x10(%rbp), %rdi
leaq 0x7fc7(%rip), %rsi      # 0x11660
callq 0x21f0
jmp 0x96a0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)