// File: /workspace/github_c_makefile_star2_O1/seanpringle[P]xoat/./spot.c
// Function: spot_update_bar
void spot_update_bar(int spot, int mon)
{
	int i, n = 0, len = 0; Client *o, *c = NULL;
	char *name = NULL, title[SPOT_BUFF]; *title = 0;
	Monitor *m = &monitors[mon];

	if (spot == SPOT1)
	{
		// Show X root window name in spot1 bar
		// Use xsetroot -name for a custom status
		char *tmp = NULL;
		if (XFetchName(display, root, &tmp))
			len += snprintf(title+len, MAX(0, SPOT_BUFF-len), " %s  ", tmp);
		if (tmp) XFree(tmp);
	}
	for_windows(i, o) if (o->manage && o->spot == spot && o->monitor == mon)
	{
		if (!c) c = o;
		if ((name = window_get_name(o->window)) && name)
		{
			if (settings.title_ellipsis > 0 && strlen(name) > settings.title_ellipsis)
			{
				name = realloc(name, strlen(name)+4);
				strcpy(name+settings.title_ellipsis, "...");
			}
			len += snprintf(title+len, MAX(0, SPOT_BUFF-len), " [%d] %s  ", n++, name);
			free(name);
		}
	}
	if (settings.title)
	{
		if (c && !c->full && *title && m->bars[spot])
		{
			int focus = c->window == current || (spot == current_spot && mon == current_mon);
			char *color  = focus && c->window == current ? settings.title_focus : settings.title_blur;
			char *border = focus && c->window == current ? settings.border_focus: settings.border_blur;
			textbox_font(m->bars[spot], settings.title, color, border);
			textbox_text(m->bars[spot], title);
			textbox_draw(m->bars[spot]);
			textbox_show(m->bars[spot]);
		}
		else
		if (m->bars[spot])
			textbox_hide(m->bars[spot]);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x438, %rsp            # imm = 0x438
movl %esi, %r14d
movl %edi, %ebx
movb $0x0, 0x30(%rsp)
xorl %ebp, %ebp
cmpl $0x1, %edi
jne 0x783e
leaq 0x20(%rsp), %rdx
movq $0x0, (%rdx)
movq 0x73b4(%rip), %rdi      # 0xebb0
movq 0x79a5(%rip), %rsi      # 0xf1a8
callq 0x3510
testl %eax, %eax
je 0x782d
movq 0x20(%rsp), %rcx
leaq 0x2b7c(%rip), %rdx      # 0xa394
leaq 0x30(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0x3080
movl %eax, %ebp
jmp 0x782f
xorl %ebp, %ebp
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x783e
callq 0x3050
callq 0x606d
cmpw $0x0, 0x7555(%rip)      # 0xeda0
movl %ebx, 0x10(%rsp)
movslq %ebx, %r15
jle 0x7979
movl %ebp, 0xc(%rsp)
leaq 0x753d(%rip), %rbx      # 0xeda0
xorl %r12d, %r12d
movq $0x0, 0x18(%rsp)
xorl %ebp, %ebp
movq %r15, 0x28(%rsp)
movl %r14d, 0x14(%rsp)
movq 0x8(%rbx,%r12,8), %rax
testq %rax, %rax
je 0x7963
cmpw $0x0, 0x104(%rax)
je 0x7963
cmpq %r15, 0x118(%rax)
jne 0x7963
movswl 0x100(%rax), %ecx
cmpl %r14d, %ecx
jne 0x7963
testq %rbp, %rbp
cmoveq %rax, %rbp
movq (%rax), %rdi
callq 0x5f86
testq %rax, %rax
je 0x7963
movq %rax, %r13
movl 0x792a(%rip), %r14d     # 0xf200
testq %r14, %r14
je 0x7909
movq %r13, %rdi
callq 0x3250
cmpq %r14, %rax
jbe 0x7909
addq $0x4, %rax
movq %r13, %rdi
movq %rax, %rsi
callq 0x3640
movq %rax, %r13
movl 0x7900(%rip), %eax      # 0xf200
movl $0x2e2e2e, (%r13,%rax)  # imm = 0x2E2E2E
movslq 0xc(%rsp), %r14
leaq (%rsp,%r14), %rdi
addq $0x30, %rdi
movl $0x400, %esi            # imm = 0x400
subl %r14d, %esi
testl %esi, %esi
movl $0x0, %eax
cmovlel %eax, %esi
movq 0x18(%rsp), %rcx
leal 0x1(%rcx), %r15d
leaq 0x2a57(%rip), %rdx      # 0xa38f
movq %r13, %r8
xorl %eax, %eax
callq 0x3080
addl %r14d, %eax
movl %eax, 0xc(%rsp)
movq %r13, %rdi
callq 0x3220
movl %r15d, %eax
movq %rax, 0x18(%rsp)
movl 0x14(%rsp), %r14d
movq 0x28(%rsp), %r15
incq %r12
movswq 0x7432(%rip), %rax      # 0xeda0
cmpq %rax, %r12
jl 0x787b
jmp 0x797b
xorl %ebp, %ebp
movq 0x7866(%rip), %rsi      # 0xf1e8
testq %rsi, %rsi
je 0x7a6e
movslq %r14d, %rax
leaq (%rax,%rax,8), %rax
leaq 0x7227(%rip), %rcx      # 0xebc0
leaq (%rcx,%rax,8), %rbx
testq %rbp, %rbp
je 0x79eb
cmpw $0x0, 0x10a(%rbp)
jne 0x79eb
cmpb $0x0, 0x30(%rsp)
je 0x79eb
movq 0x28(%rbx,%r15,8), %rdi
testq %rdi, %rdi
je 0x79eb
movq (%rbp), %rax
movq 0x71f0(%rip), %rcx      # 0xebb8
cmpq %rcx, %rax
je 0x7a07
movswl 0x7874(%rip), %edx      # 0xf248
xorl 0x10(%rsp), %edx
movswl 0x786a(%rip), %r8d      # 0xf24a
xorl %r14d, %r8d
orl %edx, %r8d
setne %dl
jmp 0x7a09
movq 0x28(%rbx,%r15,8), %rax
testq %rax, %rax
je 0x7a6e
movq 0x71b4(%rip), %rdi      # 0xebb0
movq 0x8(%rax), %rsi
callq 0x32a0
jmp 0x7a6e
xorl %edx, %edx
cmpq %rcx, %rax
setne %al
orb %dl, %al
leaq 0x77d8(%rip), %rax      # 0xf1f0
leaq 0x77d9(%rip), %rcx      # 0xf1f8
cmovneq %rax, %rcx
movq (%rcx), %rdx
leaq 0x779b(%rip), %rax      # 0xf1c8
leaq 0x779c(%rip), %rcx      # 0xf1d0
cmovneq %rax, %rcx
movq (%rcx), %rcx
callq 0x439c
movq 0x28(%rbx,%r15,8), %rdi
leaq 0x30(%rsp), %rsi
callq 0x444a
movq 0x28(%rbx,%r15,8), %rdi
callq 0x466e
movq 0x28(%rbx,%r15,8), %rax
movq 0x714b(%rip), %rdi      # 0xebb0
movq 0x8(%rax), %rsi
callq 0x3350
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq