// File: /workspace/github_cpp_makefile_star2_O1/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 $0x50, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rax
subq (%rdi), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %r14 # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %r14
movq 0x78d2(%rip), %rdi      # 0xf228
movq 0x79ab(%rip), %rsi      # 0xf308
callq 0x21d0
movzbl 0x60(%rbx), %eax
cmpl $0x53, %eax
je 0x7a6a
cmpl $0x45, %eax
jne 0x7cdb
testl %r14d, %r14d
jle 0x7cdb
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 0x3688(%rip), %xmm5     # 0xb088
mulsd %xmm5, %xmm4
movsd 0x3684(%rip), %xmm6     # 0xb090
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 0x736a
incq %r12
addq $0x3, %r15
cmpq %r12, %r14
jne 0x799c
jmp 0x7cdb
movsd 0x3596(%rip), %xmm0     # 0xb008
movl $0x12c, %edi            # imm = 0x12C
movl $0x12c, %esi            # imm = 0x12C
movl $0xc8, %edx
callq 0x736a
movq 0x779b(%rip), %rdi      # 0xf228
movq 0x786c(%rip), %rsi      # 0xf300
movl $0xf0f0f5, %edx         # imm = 0xF0F0F5
callq 0x20b0
movq 0x7783(%rip), %rdi      # 0xf228
movq 0x7854(%rip), %rsi      # 0xf300
movl $0x1, %edx
movl $0x2, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x2320
testl %r14d, %r14d
jle 0x7bb2
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
movsd 0x8(%rcx), %xmm3
mulsd %xmm2, %xmm3
movsd (%rcx), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd 0x10(%rcx), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, 0x38(%rsp)
movq 0x18(%rax), %rcx
movsd 0x8(%rcx), %xmm3
mulsd %xmm2, %xmm3
movsd (%rcx), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd 0x10(%rcx), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, 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, 0x48(%rsp)
movq 0x18(%rbx), %rax
movsd (%rax,%r13,8), %xmm0
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movupd 0x38(%rsp), %xmm1
movupd %xmm1, (%rsp)
xorl %edi, %edi
callq 0x744a
incq %r13
addq $0x3, %r12
cmpq %r13, %r15
jne 0x7ae3
movq 0x766f(%rip), %rdi      # 0xf228
movq 0x7740(%rip), %rsi      # 0xf300
movl $0x1000, %edx           # imm = 0x1000
callq 0x20b0
movq 0x7657(%rip), %rdi      # 0xf228
movq 0x7728(%rip), %rsi      # 0xf300
movl $0x1, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x2320
testl %r14d, %r14d
jle 0x7cdb
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
movsd 0x8(%rcx), %xmm3
mulsd %xmm2, %xmm3
movsd (%rcx), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd 0x10(%rcx), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, 0x20(%rsp)
movq 0x18(%rax), %rcx
movsd 0x8(%rcx), %xmm3
mulsd %xmm2, %xmm3
movsd (%rcx), %xmm4
mulsd %xmm0, %xmm4
addsd %xmm3, %xmm4
movsd 0x10(%rcx), %xmm3
mulsd %xmm1, %xmm3
addsd %xmm4, %xmm3
movsd %xmm3, 0x28(%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)
movupd 0x20(%rsp), %xmm1
movupd %xmm1, (%rsp)
movl $0x1, %edi
callq 0x744a
incq %r12
addq $0x3, %r15
cmpq %r12, %r14
jne 0x7c09
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop