// File: /workspace/github_c_makefile_star2_O1/gitluin[P]sara/src/sara.c
// Function: updategeom
void
updategeom(){
	int x, y;
	client* c;
	monitor* m, * oldmhead = mhead;

#ifdef XINERAMA
	if (XineramaIsActive(dis)){
		int i, j, ns;
		XineramaScreenInfo* unique;
		XineramaScreenInfo* info = XineramaQueryScreens(dis, &ns);

		// TODO: can i just use info[i] directly?
      		/* only consider unique geometries as separate screens */
		unique = ecalloc(ns, sizeof(XineramaScreenInfo));
		for (i=0, j=0;i < ns;i++)
			if (isuniquegeom(unique, j, &info[i]))
				memcpy(&unique[j++], &info[i], sizeof(XineramaScreenInfo));
		XFree(info);
		
		mhead = m = createmon(0, unique[0].x_org, unique[0].y_org,
				unique[0].width, unique[0].height);
		for (i=1;i < j;i++){
			m->next = createmon(i, unique[i].x_org, unique[i].y_org,
					unique[i].width, unique[i].height);
			m = m->next;
		}

		free(unique);

	} else
#endif
	{
		mhead = createmon(0, 0, 0, sw, sh);
	}

	/* if updating, reattach any old clients to the new mhead */
	while ( (m = oldmhead) ){
		while ( (c = m->head) ){
			m->head = c->next;
			detach(c, 0);
			c->mon = mhead;
			c->next = NULL;
			attach(c, 1);
		}
		mhead->seldesks |= m->seldesks;
		oldmhead = m->next;
		cleanupmon(m);
	}

	getptrcoords(&x, &y);
	if ( (m = coordstomon(x, y)) )
		changemon(m, YesFocus);
	if (!curmon)
		changemon(mhead, YesFocus);

	outputstats();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq 0x470b(%rip), %rbx      # 0x95c0
movl 0x4711(%rip), %ebp      # 0x95cc
movl 0x470e(%rip), %r15d     # 0x95d0
movl $0x1, %edi
movl $0x50, %esi
callq 0x23a0
movq %rax, %r14
testq %rax, %rax
jne 0x4ee7
leaq 0x1150(%rip), %rdi      # 0x6030
xorl %eax, %eax
callq 0x5440
movl $0x0, 0x20(%r14)
movq $0x0, 0x8(%r14)
movl %ebp, 0x14(%r14)
movl %r15d, 0x10(%r14)
movl $0x14, 0x18(%r14)
addl $-0x14, %r15d
movl %r15d, 0x1c(%r14)
leaq 0x3e4a(%rip), %r12      # 0x8d60
cvtsi2sd %ebp, %xmm0
mulsd 0x10f6(%rip), %xmm0     # 0x6018
movq %r12, 0x40(%r14)
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x4(%rsp)
movss %xmm0, (%r14)
movl $0x9, %edi
movl $0x10, %esi
callq 0x23a0
movq %rax, %r15
testq %rax, %rax
jne 0x4f5a
leaq 0x10dd(%rip), %rdi      # 0x6030
xorl %eax, %eax
callq 0x5440
movq %r15, 0x38(%r14)
movl $0x8, %eax
movss 0x4(%rsp), %xmm0
movq %r12, (%r15,%rax)
movss %xmm0, -0x8(%r15,%rax)
addq $0x10, %rax
cmpq $0x98, %rax
jne 0x4f69
movl $0x1, 0x24(%r14)
movl $0x0, 0x4(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movq %r14, 0x4621(%rip)      # 0x95c0
testq %rbx, %rbx
je 0x500b
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x4fe1
movq 0x28(%r14), %rax
movq %rax, 0x30(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x4943
movq 0x45fa(%rip), %rax      # 0x95c0
movq %rax, 0x30(%r14)
movq $0x0, 0x28(%r14)
movq %r14, %rdi
movl $0x1, %esi
callq 0x498a
jmp 0x4fa4
movl 0x24(%rbx), %eax
movq 0x45d5(%rip), %rcx      # 0x95c0
orl %eax, 0x24(%rcx)
movq 0x38(%rbx), %rdi
movq 0x48(%rbx), %r14
callq 0x21a0
movq %rbx, %rdi
callq 0x21a0
movq %r14, %rbx
testq %r14, %r14
jne 0x4fa4
movq 0x44ae(%rip), %rdi      # 0x94c0
movq 0x4597(%rip), %rsi      # 0x95b0
subq $0x8, %rsp
leaq 0x18(%rsp), %rax
leaq 0x1c(%rsp), %r10
leaq 0x20(%rsp), %rcx
leaq 0x14(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq %rcx, %rdx
movq %rbx, %r8
movq %r14, %r9
pushq %rax
pushq %r10
pushq %r10
callq 0x23d0
addq $0x20, %rsp
movl (%rbx), %edi
movl (%r14), %esi
callq 0x4808
testq %rax, %rax
je 0x5069
movq %rax, %rdi
movl $0x1, %esi
callq 0x48ff
cmpq $0x0, 0x4477(%rip)      # 0x94e8
jne 0x5084
movq 0x4546(%rip), %rdi      # 0x95c0
movl $0x1, %esi
callq 0x48ff
callq 0x4a48
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq