// File: /workspace/github_c_makefile_star2_O2/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 %r14
pushq %rbx
pushq %rax
leaq 0x7f72(%rip), %rax      # 0xb9a8
andl $0x0, (%rax)
movq 0x28(%rdi), %rdx
leaq 0x7f54(%rip), %rax      # 0xb998
cmpq (%rax), %rdx
je 0x3c1b
leaq 0x7f4c(%rip), %rax      # 0xb9a0
cmpq (%rax), %rdx
je 0x3c29
movq %rdi, %rbx
leaq 0x7f51(%rip), %rax      # 0xb9b8
cmpq (%rax), %rdx
jne 0x3aba
movq 0x20(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x5576
movl 0x30(%rbx), %edx
movq 0x38(%rbx), %rcx
cmpl $0x20, %edx
jne 0x3b98
cmpq $0x3, %rcx
jne 0x3b98
testq %rax, %rax
je 0x3b98
cmpl $0x1, 0x98(%rax)
jne 0x3b46
movq %rax, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4f68
leaq 0x7f1f(%rip), %rax      # 0xb9e0
cmpq (%rax), %rdx
jne 0x3aeb
cmpq $0x8, 0x48(%rbx)
jne 0x3aeb
movq 0x20(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x5576
movq %rax, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4ea8
leaq 0x7efe(%rip), %rax      # 0xb9f0
cmpq (%rax), %rdx
jne 0x3b4e
leaq 0x7efa(%rip), %rax      # 0xb9f8
movq (%rax), %rcx
cmpq %rcx, 0x40(%rbx)
je 0x3b0d
cmpq %rcx, 0x48(%rbx)
jne 0x3b46
movq 0x38(%rbx), %rcx
testq %rcx, %rcx
je 0x3bbb
cmpq $0x1, %rcx
jne 0x3b46
leaq 0x7e61(%rip), %rcx      # 0xb988
movq (%rcx), %rdi
movq 0x20(%rbx), %rsi
pushq $0x4
popq %rcx
pushq $0x20
popq %r8
xorl %r9d, %r9d
pushq $0x1
pushq %rax
callq 0x2370
addq $0x18, %rsp
jmp 0x3b4a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x7e93(%rip), %rax      # 0xb9e8
cmpq (%rax), %rdx
jne 0x3bd5
movq 0x20(%rbx), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x5576
movq %rax, %rbx
leaq 0x7e17(%rip), %rax      # 0xb988
movq (%rax), %rdi
movq 0x8(%rbx), %rsi
callq 0x2350
movq %rbx, %rdi
xorl %eax, %eax
callq 0x5526
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5367
movq 0x7459(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movl 0x20(%rbx), %r8d
leaq 0x39bc(%rip), %rsi      # 0x7569
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x22c0
leaq 0x7dc6(%rip), %rax      # 0xb988
movq (%rax), %rdi
movq 0x20(%rbx), %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2190
leaq 0x7dac(%rip), %rax      # 0xb988
movq (%rax), %rdi
movq %rdx, %rsi
callq 0x23a0
movq %rax, %r14
movq 0x7407(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movl 0x20(%rbx), %r8d
movl 0x28(%rbx), %ecx
leaq 0x3998(%rip), %rsi      # 0x759a
movq %r14, %rdx
xorl %eax, %eax
callq 0x22c0
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2170
xorl %eax, %eax
callq 0x3329
xorl %edi, %edi
callq 0x2530
movq 0x73c8(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x3906(%rip), %rdi      # 0x7540
pushq $0x17
popq %rsi
pushq $0x1
popq %rdx
callq 0x2540
xorl %eax, %eax
callq 0x3329
leaq 0x7d05(%rip), %rax      # 0xb958
movq (%rax), %rsi
movq (%rsi), %rdi
callq 0x24f0
leaq 0x38f3(%rip), %rdi      # 0x7558
callq 0x24b0
pushq $0x1
popq %rdi
callq 0x2530