// File: /workspace/github_cpp_makefile_star2_O3/dannycalegari[P]circle_pack/./graphics.cc
// Function: Packing::draw_circles()
void Packing::draw_circles(){
	int X,Y,R;
	int SIZE;
	SIZE=(int) adj.size();
	erase_field();
	if(geometry=='E'){	
		int i;
		for(i=0;i<SIZE;i++){
			X=(int) (300.0+VIEWMATRIX(center[i]).x*200.0);
			Y=(int) (300.0+VIEWMATRIX(center[i]).y*200.0);
			R=(int) (VIEWMATRIX.e[0][0]*rad[i]*200.0);	// will this work?
			R=abs(R);	//	infinite circle drawn in ordinary way
			draw_circle(X,Y,R,(double) i/(double) SIZE);
		};
	} else if(geometry=='S'){
		int i;
		draw_circle(300,300,200,0.5);	// draw sphere outline
		XSetForeground(display, gc,(long) 0xF0F0F5);	// wonder what color this is?
		XSetLineAttributes(display, gc, 1, LineDoubleDash, 1, 1);	
		for(i=0;i<SIZE;i++){	// first pass; draw part of circles on the "dark side"
			draw_3d_circle(VIEWMATRIX(center[i]),rad[i],false);
		};
		XSetForeground(display, gc,(long) 0x001000);
		XSetLineAttributes(display, gc, 1, LineSolid, 1, 1);
		for(i=0;i<SIZE;i++){	// second pass; draw part of circles on the "front side"	
			draw_3d_circle(VIEWMATRIX(center[i]),rad[i],true);
		};
	};
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
subq (%rdi), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r14
movq 0x6ba8(%rip), %rdi      # 0xe228
movq 0x6c81(%rip), %rsi      # 0xe308
callq 0x21d0
movzbl 0x60(%rbx), %eax
cmpl $0x53, %eax
je 0x7794
cmpl $0x45, %eax
jne 0x7a01
testl %r14d, %r14d
jle 0x7a01
cvtsi2sd %r14d, %xmm0
movsd %xmm0, 0x18(%rsp)
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movl $0x2, %r15d
xorl %r12d, %r12d
movq 0x18(%rbx), %rax
movq 0xa0(%rbx), %rcx
movsd -0x10(%rcx,%r15,8), %xmm2
movsd -0x8(%rcx,%r15,8), %xmm3
movsd (%rcx,%r15,8), %xmm1
movq 0xc8(%rbx), %rcx
movq (%rcx), %rdx
movq 0x18(%rcx), %rcx
movsd (%rdx), %xmm0
movsd 0x8(%rdx), %xmm4
mulsd %xmm3, %xmm4
movapd %xmm2, %xmm5
mulsd %xmm0, %xmm5
addsd %xmm4, %xmm5
movsd 0x10(%rdx), %xmm4
mulsd %xmm1, %xmm4
addsd %xmm5, %xmm4
mulsd 0x8(%rcx), %xmm3
mulsd (%rcx), %xmm2
movsd 0x29c6(%rip), %xmm5     # 0xa0f0
mulsd %xmm5, %xmm4
movsd 0x29c2(%rip), %xmm6     # 0xa0f8
addsd %xmm6, %xmm4
cvttsd2si %xmm4, %edi
mulsd 0x10(%rcx), %xmm1
addsd %xmm3, %xmm2
addsd %xmm2, %xmm1
mulsd %xmm5, %xmm1
addsd %xmm6, %xmm1
cvttsd2si %xmm1, %esi
mulsd (%rax,%r12,8), %xmm0
mulsd %xmm5, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, %edx
negl %edx
cmovsl %eax, %edx
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
divsd 0x18(%rsp), %xmm0
callq 0x70a8
incq %r12
addq $0x3, %r15
cmpq %r12, %r14
jne 0x76c6
jmp 0x7a01
movsd 0x28e4(%rip), %xmm0     # 0xa080
movl $0x12c, %edi            # imm = 0x12C
movl $0x12c, %esi            # imm = 0x12C
movl $0xc8, %edx
callq 0x70a8
movq 0x6a71(%rip), %rdi      # 0xe228
movq 0x6b42(%rip), %rsi      # 0xe300
movl $0xf0f0f5, %edx         # imm = 0xF0F0F5
callq 0x20b0
movq 0x6a59(%rip), %rdi      # 0xe228
movq 0x6b2a(%rip), %rsi      # 0xe300
movl $0x1, %edx
movl $0x2, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x2320
testl %r14d, %r14d
jle 0x7a0f
movl %r14d, %r15d
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
movl $0x2, %r12d
xorl %r13d, %r13d
movq 0xa0(%rbx), %rcx
movq 0xc8(%rbx), %rax
movsd -0x10(%rcx,%r12,8), %xmm0
movsd -0x8(%rcx,%r12,8), %xmm2
movsd (%rcx,%r12,8), %xmm1
movq (%rax), %rcx
movq 0x18(%rax), %rdx
movapd %xmm2, %xmm3
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
movsd (%rcx), %xmm4
movsd 0x8(%rcx), %xmm5
movhpd 0x8(%rdx), %xmm5        # xmm5 = xmm5[0],mem[0]
movsd 0x10(%rcx), %xmm6
mulpd %xmm3, %xmm5
movapd %xmm0, %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
movhpd (%rdx), %xmm4           # xmm4 = xmm4[0],mem[0]
mulpd %xmm3, %xmm4
addpd %xmm5, %xmm4
movapd %xmm1, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
movhpd 0x10(%rdx), %xmm6       # xmm6 = xmm6[0],mem[0]
mulpd %xmm3, %xmm6
addpd %xmm4, %xmm6
movapd %xmm6, 0x40(%rsp)
movq 0x30(%rax), %rax
mulsd 0x8(%rax), %xmm2
mulsd (%rax), %xmm0
addsd %xmm2, %xmm0
mulsd 0x10(%rax), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x50(%rsp)
movq 0x18(%rbx), %rax
movsd (%rax,%r13,8), %xmm0
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x40(%rsp), %xmm1
movupd %xmm1, (%rsp)
xorl %edi, %edi
callq 0x7188
incq %r13
addq $0x3, %r12
cmpq %r13, %r15
jne 0x780d
movq 0x6947(%rip), %rdi      # 0xe228
movq 0x6a18(%rip), %rsi      # 0xe300
movl $0x1000, %edx           # imm = 0x1000
callq 0x20b0
movq 0x692f(%rip), %rdi      # 0xe228
movq 0x6a00(%rip), %rsi      # 0xe300
movl $0x1, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x2320
testl %r14d, %r14d
jle 0x7a01
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
movl $0x2, %r15d
xorl %r12d, %r12d
movq 0xa0(%rbx), %rcx
movq 0xc8(%rbx), %rax
movsd -0x10(%rcx,%r15,8), %xmm0
movsd -0x8(%rcx,%r15,8), %xmm2
movsd (%rcx,%r15,8), %xmm1
movq (%rax), %rcx
movq 0x18(%rax), %rdx
movapd %xmm2, %xmm3
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
movsd (%rcx), %xmm4
movsd 0x8(%rcx), %xmm5
movhpd 0x8(%rdx), %xmm5        # xmm5 = xmm5[0],mem[0]
movsd 0x10(%rcx), %xmm6
mulpd %xmm3, %xmm5
movapd %xmm0, %xmm3
unpcklpd %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
movhpd (%rdx), %xmm4           # xmm4 = xmm4[0],mem[0]
mulpd %xmm3, %xmm4
addpd %xmm5, %xmm4
movapd %xmm1, %xmm3
unpcklpd %xmm1, %xmm3            # xmm3 = xmm3[0],xmm1[0]
movhpd 0x10(%rdx), %xmm6       # xmm6 = xmm6[0],mem[0]
mulpd %xmm3, %xmm6
addpd %xmm4, %xmm6
movapd %xmm6, 0x20(%rsp)
movq 0x30(%rax), %rax
mulsd 0x8(%rax), %xmm2
mulsd (%rax), %xmm0
addsd %xmm2, %xmm0
mulsd 0x10(%rax), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
movq 0x18(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movapd 0x20(%rsp), %xmm1
movupd %xmm1, (%rsp)
movl $0x1, %edi
callq 0x7188
incq %r12
addq $0x3, %r15
cmpq %r12, %r14
jne 0x7931
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x6812(%rip), %rdi      # 0xe228
movq 0x68e3(%rip), %rsi      # 0xe300
movl $0x1000, %edx           # imm = 0x1000
callq 0x20b0
movq 0x67fa(%rip), %rdi      # 0xe228
movq 0x68cb(%rip), %rsi      # 0xe300
movl $0x1, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2320