// File: /workspace/github_c_makefile_star2_O3/tudurom[P]windowchef/wm.c
// Function: update_window_status
static void update_window_status(struct client *client)
{
	/* it really shouldn't happen */
	if (client == NULL)
		return;
	int size = 0;
	char *str = NULL;
	char *state;
	if (client->maxed) state = "maxed";
	else if (client->hmaxed) state = "hmaxed";
	else if (client->vmaxed) state = "vmaxed";
	else if (client->monocled) state = "monocled";
	else if (client->gridded) state = "gridded";
	else state = "normal";
	/* this is going to be fun */
#define _BOOL_VALUE(value) ((value) ? "true" : "false")
	size = asprintf(&str,
	"{"
		"\"window\":\"0x%08x\","
		"\"geom\":{"
			"\"x\":%d,"
			"\"y\":%d,"
			"\"width\":%d,"
			"\"height\":%d,"
			"\"set_by_user\":%s"
		"},"
		"\"state\":\"%s\","
		"\"min_width\":%d,"
		"\"min_height\":%d,"
		"\"max_width\":%d,"
		"\"max_height\":%d,"
		"\"width_inc\":%d,"
		"\"height_inc\":%d,"
		"\"mapped\":%s,"
		"\"group\":%d"
	"}", client->window, client->geom.x, client->geom.y, client->geom.width,
	client->geom.height, _BOOL_VALUE(client->geom.set_by_user), state,
	client->min_width, client->min_height, client->max_width, client->max_height,
	client->width_inc, client->height_inc, _BOOL_VALUE(client->mapped), client->group);
#undef _BOOL_VALUE
	if (size == -1) {
		DMSG("asprintf returned -1\n");
		return;
	}
	xcb_change_property(conn, XCB_PROP_MODE_REPLACE, client->window,
			ATOMS[WINDOWCHEF_STATUS], XCB_ATOM_STRING, 8, size, str);
	free(str);
}

// Assembly:
testq %rdi, %rdi
je 0x5253
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq $0x0, 0x8(%rsp)
cmpb $0x0, 0x24(%rdi)
je 0x513d
leaq 0x40f8(%rip), %rax      # 0x9233
jmp 0x516c
cmpb $0x0, 0x25(%rbx)
je 0x514c
leaq 0x40e8(%rip), %rax      # 0x9232
jmp 0x516c
cmpb $0x0, 0x26(%rbx)
je 0x515b
leaq 0x40e0(%rip), %rax      # 0x9239
jmp 0x516c
cmpb $0x0, 0x27(%rbx)
je 0x5254
leaq 0x40d4(%rip), %rax      # 0x9240
movq %rax, (%rsp)
movswl 0x4(%rbx), %ecx
movswl 0x6(%rbx), %r8d
movzwl 0x8(%rbx), %r9d
movzwl 0xa(%rbx), %eax
movq %rax, 0x20(%rsp)
leaq 0x419e(%rip), %rax      # 0x932c
cmpb $0x0, 0xc(%rbx)
leaq 0x4198(%rip), %r14      # 0x9331
movq %r14, %r10
cmovneq %rax, %r10
movzwl 0x48(%rbx), %edx
movq %rdx, 0x18(%rsp)
movzwl 0x4a(%rbx), %edx
movq %rdx, 0x10(%rsp)
movzwl 0x4c(%rbx), %r13d
movzwl 0x4e(%rbx), %ebp
movzwl 0x50(%rbx), %r12d
movzwl 0x52(%rbx), %r15d
cmpb $0x0, 0x54(%rbx)
cmovneq %rax, %r14
movl (%rbx), %edx
movl 0x58(%rbx), %r11d
subq $0x8, %rsp
leaq 0x407a(%rip), %rsi      # 0x9258
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %r15
pushq %r12
pushq %rbp
pushq %r13
pushq 0x48(%rsp)
pushq 0x58(%rsp)
pushq 0x48(%rsp)
pushq %r10
pushq 0x78(%rsp)
callq 0x8498
addq $0x60, %rsp
cmpl $-0x1, %eax
je 0x5245
movq 0x71a1(%rip), %rdi      # 0xc3b8
movl (%rbx), %edx
movl 0x75dd(%rip), %ecx      # 0xc7fc
xorl %esi, %esi
movl $0x1f, %r8d
movl $0x8, %r9d
pushq 0x8(%rsp)
pushq %rax
callq 0x35b0
addq $0x10, %rsp
movq 0x8(%rsp), %rdi
callq 0x32d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3fee(%rip), %rax      # 0x9249
leaq 0x3fef(%rip), %rcx      # 0x9251
cmpb $0x0, 0x28(%rbx)
cmovneq %rax, %rcx
movq %rcx, (%rsp)
jmp 0x5170