// File: /workspace/github_c_makefile_star2_O1/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 0x530f
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 0x51f9
leaq 0x4014(%rip), %rax      # 0x920b
jmp 0x5228
cmpb $0x0, 0x25(%rbx)
je 0x5208
leaq 0x4004(%rip), %rax      # 0x920a
jmp 0x5228
cmpb $0x0, 0x26(%rbx)
je 0x5217
leaq 0x3ffc(%rip), %rax      # 0x9211
jmp 0x5228
cmpb $0x0, 0x27(%rbx)
je 0x5310
leaq 0x3ff0(%rip), %rax      # 0x9218
movq %rax, (%rsp)
movswl 0x4(%rbx), %ecx
movswl 0x6(%rbx), %r8d
movzwl 0x8(%rbx), %r9d
movzwl 0xa(%rbx), %eax
movq %rax, 0x20(%rsp)
leaq 0x40ba(%rip), %rax      # 0x9304
cmpb $0x0, 0xc(%rbx)
leaq 0x40b4(%rip), %r14      # 0x9309
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 0x3f96(%rip), %rsi      # 0x9230
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 0x8494
addq $0x60, %rsp
cmpl $-0x1, %eax
je 0x5301
movq 0x70e5(%rip), %rdi      # 0xc3b8
movl (%rbx), %edx
movl 0x7521(%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 0x3f0a(%rip), %rax      # 0x9221
leaq 0x3f0b(%rip), %rcx      # 0x9229
cmpb $0x0, 0x28(%rbx)
cmovneq %rax, %rcx
movq %rcx, (%rsp)
jmp 0x522c