// File: /workspace/github_c_makefile_star2_O3/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, %ebp
movl %edi, %r14d
movb $0x0, 0x30(%rsp)
movslq %esi, %rax
leaq (%rax,%rax,8), %rbx
leaq 0x736c(%rip), %r15      # 0xebc0
xorl %r12d, %r12d
cmpl $0x1, %edi
jne 0x78b3
leaq 0x18(%rsp), %rdx
movq $0x0, (%rdx)
movq 0x7341(%rip), %rdi      # 0xebb0
movq 0x7932(%rip), %rsi      # 0xf1a8
callq 0x3510
testl %eax, %eax
je 0x78a1
movq 0x18(%rsp), %rcx
leaq 0x2b41(%rip), %rdx      # 0xa3cc
leaq 0x30(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
xorl %eax, %eax
callq 0x3080
movl %eax, %r12d
jmp 0x78a4
xorl %r12d, %r12d
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x78b3
callq 0x3050
leaq (%r15,%rbx,8), %rbx
callq 0x604f
cmpw $0x0, 0x74dc(%rip)      # 0xeda0
movslq %r14d, %r14
jle 0x7a94
movl %r12d, 0x8(%rsp)
movq %rbx, 0x20(%rsp)
leaq 0x74c2(%rip), %rbx      # 0xeda0
xorl %r15d, %r15d
movq $0x0, 0x10(%rsp)
xorl %r13d, %r13d
movl %ebp, 0xc(%rsp)
movq 0x8(%rbx,%r15,8), %rax
testq %rax, %rax
je 0x79d8
cmpw $0x0, 0x104(%rax)
je 0x79d8
cmpq %r14, 0x118(%rax)
jne 0x79d8
movswl 0x100(%rax), %ecx
cmpl %ebp, %ecx
jne 0x79d8
testq %r13, %r13
cmoveq %rax, %r13
movq (%rax), %rdi
callq 0x5f64
testq %rax, %rax
je 0x79d8
movq %rax, %r12
movl 0x78b6(%rip), %ebp      # 0xf200
testq %rbp, %rbp
movq %r13, 0x28(%rsp)
je 0x7981
movq %r12, %rdi
callq 0x3250
cmpq %rbp, %rax
jbe 0x7981
addq $0x4, %rax
movq %r12, %rdi
movq %rax, %rsi
callq 0x3640
movq %rax, %r12
movl 0x7887(%rip), %eax      # 0xf200
movl $0x2e2e2e, (%r12,%rax)  # imm = 0x2E2E2E
movslq 0x8(%rsp), %rbp
leaq (%rsp,%rbp), %rdi
addq $0x30, %rdi
movl $0x400, %esi            # imm = 0x400
subl %ebp, %esi
testl %esi, %esi
movl $0x0, %eax
cmovlel %eax, %esi
movq 0x10(%rsp), %rcx
leal 0x1(%rcx), %r13d
leaq 0x2a18(%rip), %rdx      # 0xa3c7
movq %r12, %r8
xorl %eax, %eax
callq 0x3080
addl %ebp, %eax
movl %eax, 0x8(%rsp)
movq %r12, %rdi
callq 0x3220
movl %r13d, %eax
movq %rax, 0x10(%rsp)
movl 0xc(%rsp), %ebp
movq 0x28(%rsp), %r13
incq %r15
movswq 0x73bd(%rip), %rax      # 0xeda0
cmpq %rax, %r15
jl 0x78f1
movq 0x77f5(%rip), %rsi      # 0xf1e8
testq %rsi, %rsi
movq 0x20(%rsp), %rbx
je 0x7ab8
testq %r13, %r13
je 0x7a9e
cmpw $0x0, 0x10a(%r13)
jne 0x7a9e
cmpb $0x0, 0x30(%rsp)
je 0x7a9e
movq 0x28(%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0x7a9e
movq (%r13), %rax
cmpq 0x7183(%rip), %rax      # 0xebb8
leaq 0x77bc(%rip), %rax      # 0xf1f8
leaq 0x77ad(%rip), %rcx      # 0xf1f0
cmoveq %rax, %rcx
movq (%rcx), %rdx
leaq 0x777f(%rip), %rax      # 0xf1d0
leaq 0x7770(%rip), %rcx      # 0xf1c8
cmoveq %rax, %rcx
movq (%rcx), %rcx
callq 0x438a
movq 0x28(%rbx,%r14,8), %rdi
leaq 0x30(%rsp), %rsi
callq 0x4438
movq 0x28(%rbx,%r14,8), %rdi
callq 0x465c
movq 0x28(%rbx,%r14,8), %rax
movq 0x7127(%rip), %rdi      # 0xebb0
movq 0x8(%rax), %rsi
callq 0x3350
jmp 0x7ab8
cmpq $0x0, 0x774c(%rip)      # 0xf1e8
je 0x7ab8
movq 0x28(%rbx,%r14,8), %rax
testq %rax, %rax
je 0x7ab8
movq 0x7101(%rip), %rdi      # 0xebb0
movq 0x8(%rax), %rsi
callq 0x32a0
addq $0x438, %rsp            # imm = 0x438
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq