// File: /workspace/github_c_makefile_star2_O3/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 0x46d7(%rip), %rbx      # 0x95c0
movl 0x46dd(%rip), %ebp      # 0x95cc
movl 0x46da(%rip), %r15d     # 0x95d0
movl $0x1, %edi
movl $0x50, %esi
callq 0x23a0
movq %rax, %r14
testq %rax, %rax
jne 0x4f1b
leaq 0x116c(%rip), %rdi      # 0x6080
xorl %eax, %eax
callq 0x5490
movl %ebp, 0x14(%r14)
movl %r15d, 0x10(%r14)
movl $0x14, 0x18(%r14)
addl $-0x14, %r15d
movl %r15d, 0x1c(%r14)
leaq 0x3e26(%rip), %r12      # 0x8d60
cvtsi2sd %ebp, %xmm0
mulsd 0x112a(%rip), %xmm0     # 0x6070
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 0x4f7e
leaq 0x1109(%rip), %rdi      # 0x6080
xorl %eax, %eax
callq 0x5490
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 0x4f8d
movl $0x1, 0x24(%r14)
movq %r14, 0x460d(%rip)      # 0x95c0
testq %rbx, %rbx
je 0x505c
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x502e
movq 0x28(%r14), %rax
movq %rax, 0x30(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x4997
movq 0x45e2(%rip), %rax      # 0x95c0
movq %rax, 0x30(%r14)
movq $0x0, 0x28(%r14)
movq 0x30(%rax), %rdx
testq %rdx, %rdx
je 0x501c
movq 0x28(%rax), %rcx
testq %rcx, %rcx
je 0x500a
movq 0x28(%rcx), %rdx
addq $0x28, %rcx
movq %rdx, 0x28(%r14)
jmp 0x5020
movq %rdx, %rcx
movq 0x28(%rdx), %rdx
testq %rdx, %rdx
jne 0x500a
addq $0x28, %rcx
jmp 0x5020
leaq 0x30(%rax), %rcx
movq %r14, (%rcx)
movq 0x30(%rbx), %r14
testq %r14, %r14
jne 0x4fc5
jmp 0x5035
movq 0x458b(%rip), %rax      # 0x95c0
movl 0x24(%rbx), %ecx
orl %ecx, 0x24(%rax)
movq 0x38(%rbx), %rdi
movq 0x48(%rbx), %r14
callq 0x21a0
movq %rbx, %rdi
callq 0x21a0
movq %r14, %rbx
testq %r14, %r14
jne 0x4fbc
movq 0x445d(%rip), %rdi      # 0x94c0
movq 0x4546(%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 0x4833
testq %rax, %rax
je 0x50ba
movq %rax, %rdi
movl $0x1, %esi
callq 0x4953
cmpq $0x0, 0x4426(%rip)      # 0x94e8
jne 0x50d5
movq 0x44f5(%rip), %rdi      # 0x95c0
movl $0x1, %esi
callq 0x4953
callq 0x4a60
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq