// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0x18, %rsp
movq 0x49f4(%rip), %rbx      # 0x95c0
movl 0x49fa(%rip), %ebp      # 0x95cc
movl 0x49f7(%rip), %r15d     # 0x95d0
pushq $0x1
popq %rdi
pushq $0x50
popq %rsi
callq 0x25fc
movq %rax, %r14
andl $0x0, 0x20(%rax)
andq $0x0, 0x8(%rax)
movl %ebp, 0x14(%rax)
movl %r15d, 0x10(%rax)
movl $0x14, 0x18(%rax)
addl $-0x14, %r15d
movl %r15d, 0x1c(%rax)
leaq 0x4153(%rip), %r15      # 0x8d60
cvtsi2sd %ebp, %xmm0
mulsd 0x13ff(%rip), %xmm0     # 0x6018
movq %r15, 0x40(%rax)
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
movss %xmm0, (%rax)
pushq $0x9
popq %rdi
pushq $0x10
popq %rsi
callq 0x25fc
movss 0xc(%rsp), %xmm0
movq %rax, 0x38(%r14)
pushq $0x8
popq %rcx
cmpq $0x98, %rcx
je 0x4c5c
movq %r15, (%rax,%rcx)
movss %xmm0, -0x8(%rax,%rcx)
addq $0x10, %rcx
jmp 0x4c43
movl $0x1, 0x24(%r14)
andl $0x0, 0x4(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movq %r14, 0x4948(%rip)      # 0x95c0
pushq $0x1
popq %rbp
testq %rbx, %rbx
je 0x4cd5
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x4cb7
movq 0x28(%r14), %rax
movq %rax, 0x30(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x45f5
movq 0x491e(%rip), %rax      # 0x95c0
movq %rax, 0x30(%r14)
andq $0x0, 0x28(%r14)
movq %r14, %rdi
movl %ebp, %esi
callq 0x463c
jmp 0x4c80
movl 0x24(%rbx), %eax
movq 0x48ff(%rip), %rcx      # 0x95c0
orl %eax, 0x24(%rcx)
movq 0x48(%rbx), %r14
movq %rbx, %rdi
callq 0x4d2d
movq %r14, %rbx
jmp 0x4c7b
leaq 0x14(%rsp), %rbx
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4446
movl (%rbx), %edi
movl (%r14), %esi
callq 0x44c3
testq %rax, %rax
je 0x4d04
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x45b1
cmpq $0x0, 0x47dc(%rip)      # 0x94e8
jne 0x4d1d
movq 0x48ab(%rip), %rdi      # 0x95c0
pushq $0x1
popq %rsi
callq 0x45b1
callq 0x4701
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq