// File: /workspace/github_c_makefile_star2_O1/9wm[P]9wm/event.c
// Function: clientmesg
void
clientmesg(XClientMessageEvent * e)
{
	Client *c;

	curtime = CurrentTime;
	if (e->message_type == exit_9wm) {
		cleanup();
		exit(0);
	} else if (e->message_type == restart_9wm) {
		fprintf(stderr, "*** 9wm restarting ***\n");
		cleanup();
		execvp(myargv[0], myargv);
		perror("9wm: exec failed");
		exit(1);
	} else if (e->message_type == wm_change_state) {
		c = getclient(e->window, 0);
		if (e->format == 32 && e->data.l[0] == IconicState && c != 0) {
			if (normal(c))
				hide(c);
		} else
			fprintf(stderr, "9wm: WM_CHANGE_STATE: format %d data %ld w 0x%x\n",
				e->format, e->data.l[0], (int) e->window);
	} else if ((e->message_type == wm_moveresize) && (e->data.l[2] == 8)) {
		Client *c = getclient(e->window, 0);
		move(c);
		return;
	} else if (e->message_type == net_wm_state) {
		if (e->data.l[1] == net_wm_state_fullscreen || e->data.l[2] == net_wm_state_fullscreen) {
			if (e->data.l[0] == 1)
				XChangeProperty(dpy, e->window, net_wm_state, XA_ATOM, 32, PropModeReplace, (unsigned char *)&net_wm_state_fullscreen, 1);
			else if (e->data.l[0] == 0)
				XDeleteProperty(dpy, e->window, net_wm_state);
		}
		return;
	} else if (e->message_type == active_window) {
		Client *c = getclient(e->window, 0);
		XMapRaised(dpy, c->parent);
		top(c);
		active(c);
		return;
	} else {
		char *name;

		name = XGetAtomName(dpy, e->message_type);
		fprintf(stderr, "9wm: unhandled ClientMessage %s (%d),  window 0x%x\n", name, (int) e->message_type,
			(int) e->window);
		XFree(name);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7be2(%rip), %rax      # 0xb998
movl $0x0, (%rax)
movq 0x28(%rdi), %rdi
leaq 0x7bc1(%rip), %rax      # 0xb988
cmpq (%rax), %rdi
je 0x3f48
leaq 0x7bb9(%rip), %rax      # 0xb990
cmpq (%rax), %rdi
je 0x3f56
leaq 0x7bc1(%rip), %rax      # 0xb9a8
cmpq (%rax), %rdi
jne 0x3e31
movq 0x20(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x58e1
movl 0x30(%rbx), %edx
cmpl $0x20, %edx
jne 0x3f02
cmpq $0x3, 0x38(%rbx)
jne 0x3f02
testq %rax, %rax
je 0x3f02
cmpl $0x1, 0x98(%rax)
jne 0x3ebc
movq %rax, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x5327
leaq 0x7b98(%rip), %rax      # 0xb9d0
cmpq (%rax), %rdi
jne 0x3e5c
cmpq $0x8, 0x48(%rbx)
jne 0x3e5c
movq 0x20(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x58e1
movq %rax, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x5267
leaq 0x7b7d(%rip), %rax      # 0xb9e0
movq (%rax), %rdx
cmpq %rdx, %rdi
jne 0x3ebe
leaq 0x7b76(%rip), %rax      # 0xb9e8
movq (%rax), %rcx
cmpq %rcx, 0x40(%rbx)
je 0x3e81
cmpq %rcx, 0x48(%rbx)
jne 0x3ebc
movq 0x38(%rbx), %rcx
testq %rcx, %rcx
je 0x3f23
cmpq $0x1, %rcx
jne 0x3ebc
leaq 0x7add(%rip), %rcx      # 0xb978
movq (%rcx), %rdi
movq 0x20(%rbx), %rsi
movl $0x4, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq $0x1
pushq %rax
callq 0x2360
addq $0x10, %rsp
popq %rbx
retq
leaq 0x7b13(%rip), %rax      # 0xb9d8
cmpq (%rax), %rdi
jne 0x3f37
movq 0x20(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x58e1
movq %rax, %rbx
leaq 0x7a97(%rip), %rax      # 0xb978
movq (%rax), %rdi
movq 0x8(%rbx), %rsi
callq 0x2340
movq %rbx, %rdi
xorl %eax, %eax
callq 0x587d
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
jmp 0x56e6
movq 0x70ef(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x38(%rbx), %rcx
movl 0x20(%rbx), %r8d
leaq 0x364e(%rip), %rsi      # 0x7569
xorl %eax, %eax
popq %rbx
jmp 0x22b0
leaq 0x7a4e(%rip), %rax      # 0xb978
movq (%rax), %rdi
movq 0x20(%rbx), %rsi
popq %rbx
jmp 0x2190
leaq 0x28(%rbx), %rsi
movq %rbx, %rdx
callq 0x2839
jmp 0x3ebc
xorl %eax, %eax
callq 0x36e1
xorl %edi, %edi
callq 0x2520
callq 0x2888