// File: /workspace/github_c_makefile_star2_O2/gitluin[P]sara/src/sara.c
// Function: outputstats
void
outputstats(){
	char* isdeskocc, * isdesksel, monstate[NUMTAGS+3];
	int i;
	unsigned int occ, sel;

	/* output:
	 * "0:SONNNNNNN:Y"
	 * im->num:SEL/OCC/EMPTY:curlayout->symbol
	 */
	for EACHMON(mhead){
		occ = sel = 0;
		isdeskocc = ecalloc(NUMTAGS, sizeof(char));
		isdesksel = ecalloc(NUMTAGS, sizeof(char));
		sel = im->seldesks;

		for EACHCLIENT(im->head)
			occ |= ic->desks;

		/* uis get reordered in the dest string so they are left-to-right */
		uitos(occ, NUMTAGS, isdeskocc);
		uitos(sel, NUMTAGS, isdesksel);

		for (i=0;i<NUMTAGS;i++){
			if (isdesksel[i] == '1'){
				monstate[i] = 'S';
			} else if (isdeskocc[i] == '1'){
				monstate[i] = 'O';
			} else {
				monstate[i] = 'N';
			}
		}
		monstate[NUMTAGS] = ':';
		monstate[NUMTAGS+1] = im->curlayout->letter;
		monstate[NUMTAGS+2] = '\0';

		setrootstats(monstate, im->num);

		free(isdeskocc);
		free(isdesksel);
	}

	fflush(stdout);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x4eaa(%rip), %rax      # 0x95c0
movq (%rax), %rax
movq %rax, 0x4db8(%rip)      # 0x94d8
testq %rax, %rax
je 0x489a
pushq $0x9
popq %rbx
movq %rbx, %rdi
pushq $0x1
popq %r14
movq %r14, %rsi
callq 0x25fc
movq %rax, %r13
movq %rbx, %rdi
movq %r14, %rsi
callq 0x25fc
movq %rax, %r15
movq 0x4d85(%rip), %rax      # 0x94d8
movl 0x24(%rax), %r12d
addq $0x30, %rax
xorl %edi, %edi
movq (%rax), %rax
testq %rax, %rax
je 0x476e
orl 0x1c(%rax), %edi
addq $0x28, %rax
jmp 0x475d
andq $0x0, 0x4d5a(%rip)      # 0x94d0
pushq $0x9
popq %rbx
movl %ebx, %esi
movq %r13, %rdx
callq 0x2640
movl %r12d, %edi
movl %ebx, %esi
movq %r15, %rdx
callq 0x2640
xorl %eax, %eax
cmpq $0x9, %rax
je 0x47bf
cmpb $0x31, (%r15,%rax)
jne 0x47a6
movb $0x53, 0xc(%rsp,%rax)
jmp 0x47ba
cmpb $0x31, (%r13,%rax)
jne 0x47b5
movb $0x4f, 0xc(%rsp,%rax)
jmp 0x47ba
movb $0x4e, 0xc(%rsp,%rax)
incq %rax
jmp 0x4792
movb $0x3a, 0x15(%rsp)
movq 0x4d0d(%rip), %rax      # 0x94d8
movq 0x40(%rax), %rcx
movb (%rcx), %cl
movb %cl, 0x16(%rsp)
xorl %ebp, %ebp
movb %bpl, 0x17(%rsp)
movl 0x20(%rax), %r12d
pushq $0x28
popq %rdi
callq 0x2130
movq %rax, %rbx
pushq $0xc
popq %rdi
callq 0x2130
movq %rax, %r14
movb %bpl, (%rbx)
movq %rax, %rdi
leaq 0x1864(%rip), %rsi      # 0x6067
movl %r12d, %edx
xorl %eax, %eax
callq 0x2220
movq %rbx, %rdi
callq 0x21b0
movabsq $0x4e4f4d5f41524153, %rcx # imm = 0x4E4F4D5F41524153
movq %rcx, (%rbx,%rax)
movabsq $0x5f45544154534e, %rcx # imm = 0x5F45544154534E
movq %rcx, 0x7(%rbx,%rax)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2290
movq 0x4c7c(%rip), %r14      # 0x94c0
movq 0x4d65(%rip), %r12      # 0x95b0
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x23c0
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
pushq $0x1f
popq %rcx
pushq $0x8
popq %r8
xorl %r9d, %r9d
pushq $0xc
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x2400
popq %rcx
popq %rdx
movq %r13, %rdi
callq 0x21a0
movq %r15, %rdi
callq 0x21a0
movq 0x4c47(%rip), %rax      # 0x94d8
addq $0x48, %rax
jmp 0x4716
movq 0x4757(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
callq 0x24e0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq