// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0x60(%rdi), %eax
cmpl $0x53, %eax
je 0x6ae6
cmpl $0x45, %eax
jne 0x6c98
leaq 0x2a12(%rip), %rsi      # 0x93ee
movq %rbx, %rdi
callq 0x21e0
leaq 0x2a1d(%rip), %rsi      # 0x9408
movq %rbx, %rdi
callq 0x21e0
leaq 0x2a2b(%rip), %rsi      # 0x9425
movq %rbx, %rdi
callq 0x21e0
leaq 0x2a44(%rip), %rsi      # 0x944d
movq %rbx, %rdi
callq 0x21e0
leaq 0x2a63(%rip), %rsi      # 0x947b
movq %rbx, %rdi
callq 0x21e0
leaq 0x2a8b(%rip), %rsi      # 0x94b2
movq %rbx, %rdi
callq 0x21e0
leaq 0x2aa1(%rip), %rsi      # 0x94d7
movq %rbx, %rdi
callq 0x21e0
xorl %r15d, %r15d
leaq 0x2c6f(%rip), %rax      # 0x96b7
movq %rax, (%rsp)
leaq 0x2c75(%rip), %r12      # 0x96c8
leaq 0x2aa7(%rip), %r13      # 0x9501
xorl %ebp, %ebp
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cltq
cmpq %rax, %rbp
jge 0x6c7e
movq 0xa0(%r14), %rax
movsd (%rax,%r15), %xmm0
movq %rbx, %rdi
callq 0x2340
movq %rax, %rdi
movq %r12, %rsi
callq 0x21e0
movq 0xa0(%r14), %rcx
movsd 0x8(%rcx,%r15), %xmm0
movq %rax, %rdi
callq 0x2340
movq %rax, %rdi
movq %r12, %rsi
callq 0x21e0
movq 0x18(%r14), %rcx
movsd (%rcx,%rbp,8), %xmm0
andps 0x2589(%rip), %xmm0     # 0x9050
movq %rax, %rdi
callq 0x2340
movq %rax, %rdi
movq %r13, %rsi
callq 0x21e0
incq %rbp
addq $0x18, %r15
jmp 0x6a5c
leaq 0x2901(%rip), %rsi      # 0x93ee
movq %rbx, %rdi
callq 0x21e0
leaq 0x290c(%rip), %rsi      # 0x9408
movq %rbx, %rdi
callq 0x21e0
leaq 0x29fa(%rip), %rsi      # 0x9505
movq %rbx, %rdi
callq 0x21e0
leaq 0x2a2c(%rip), %rsi      # 0x9546
movq %rbx, %rdi
callq 0x21e0
leaq 0x2a5e(%rip), %rsi      # 0x9587
movq %rbx, %rdi
callq 0x21e0
leaq 0x2a72(%rip), %rsi      # 0x95aa
movq %rbx, %rdi
callq 0x21e0
movsd 0x2558(%rip), %xmm0     # 0x90a0
movq %rax, %rdi
callq 0x2340
leaq 0x2a76(%rip), %rsi      # 0x95cd
movq %rax, %rdi
callq 0x21e0
leaq 0x2a72(%rip), %rsi      # 0x95d8
movq %rbx, %rdi
callq 0x21e0
movq %rax, %rdi
movsd 0x2527(%rip), %xmm0     # 0x90a0
callq 0x2340
leaq 0x2a67(%rip), %rsi      # 0x95ec
movq %rax, %rdi
callq 0x21e0
movq %rax, %rdi
movsd 0x2508(%rip), %xmm0     # 0x90a0
callq 0x2340
leaq 0x2a66(%rip), %rsi      # 0x960a
movq %rax, %rdi
callq 0x21e0
leaq 0x2a5e(%rip), %rsi      # 0x9611
movq %rbx, %rdi
callq 0x21e0
leaq 0x2a8f(%rip), %rsi      # 0x9651
movq %rbx, %rdi
callq 0x21e0
xorl %r15d, %r15d
leaq 0x2ac4(%rip), %rax      # 0x9698
movq %rax, (%rsp)
leaq 0x2ae9(%rip), %r12      # 0x96c8
xorl %r13d, %r13d
movq 0x8(%r14), %rax
subq (%r14), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cltq
cmpq %rax, %r13
jge 0x6c7e
movq 0xa0(%r14), %rax
movsd 0x10(%rax,%r15), %xmm0
callq 0x21c0
movq %rbx, %rdi
callq 0x2340
movq %rax, %rdi
movq %r12, %rsi
callq 0x21e0
movq %rax, %rbp
movq 0xa0(%r14), %rax
movsd (%rax,%r15), %xmm0
movsd 0x8(%rax,%r15), %xmm1
callq 0x2040
movq %rbp, %rdi
callq 0x2340
movq %rax, %rdi
movq %r12, %rsi
callq 0x21e0
movq 0x18(%r14), %rcx
movsd (%rcx,%r13,8), %xmm0
movq %rax, %rdi
callq 0x2340
movq %rax, %rdi
leaq 0x2894(%rip), %rsi      # 0x9501
callq 0x21e0
incq %r13
addq $0x18, %r15
jmp 0x6be2
movq %rbx, %rdi
movq (%rsp), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21e0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop