// File: /workspace/github_c_makefile_star2_O2/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 0x50f7
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
andq $0x0, 0x8(%rsp)
cmpb $0x0, 0x24(%rdi)
je 0x4fe7
leaq 0x4266(%rip), %rax      # 0x924b
jmp 0x5016
cmpb $0x0, 0x25(%rbx)
je 0x4ff6
leaq 0x4256(%rip), %rax      # 0x924a
jmp 0x5016
cmpb $0x0, 0x26(%rbx)
je 0x5005
leaq 0x424e(%rip), %rax      # 0x9251
jmp 0x5016
cmpb $0x0, 0x27(%rbx)
je 0x50f8
leaq 0x4242(%rip), %rax      # 0x9258
movq %rax, (%rsp)
movswl 0x4(%rbx), %ecx
movswl 0x6(%rbx), %r8d
movzwl 0x8(%rbx), %r9d
movzwl 0xa(%rbx), %eax
movq %rax, 0x20(%rsp)
leaq 0x430c(%rip), %rax      # 0x9344
cmpb $0x0, 0xc(%rbx)
leaq 0x4306(%rip), %r14      # 0x9349
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 0x41e8(%rip), %rsi      # 0x9270
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 0x7e3c
addq $0x60, %rsp
cmpl $-0x1, %eax
je 0x50e9
movq 0x72f7(%rip), %rdi      # 0xc3b8
movl (%rbx), %edx
movl 0x7733(%rip), %ecx      # 0xc7fc
pushq $0x1f
popq %r8
pushq $0x8
popq %r9
xorl %esi, %esi
pushq 0x8(%rsp)
pushq %rax
callq 0x35a0
popq %rcx
popq %rdx
movq 0x8(%rsp), %rdi
callq 0x32c0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4162(%rip), %rax      # 0x9261
leaq 0x4163(%rip), %rcx      # 0x9269
cmpb $0x0, 0x28(%rbx)
cmovneq %rax, %rcx
movq %rcx, (%rsp)
jmp 0x501a