// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: event_map_request
static void
event_map_request(xcb_generic_event_t *ev)
{
	xcb_map_request_event_t *e = (xcb_map_request_event_t *)ev;
	struct client *client;
	long data[] = {
		XCB_ICCCM_WM_STATE_NORMAL,
		XCB_NONE,
	};

	/* create window if new */
	client = find_client(&e->window);
	if (client == NULL) {
		client = setup_window(e->window);

		/* client is a dock or some kind of window that needs to be ignored */
		if (client == NULL)
			return;

		if (!client->geom.set_by_user) {
			if (!get_pointer_location(&scr->root, &client->geom.x, &client->geom.y))
				client->geom.x = client->geom.y = 0;

			client->geom.x -= client->geom.width / 2;
			client->geom.y -= client->geom.height / 2;
			teleport_window(client->window, client->geom.x, client->geom.y);
		}
		if (conf.sticky_windows)
			group_add_window(client, last_group);
	}

	xcb_map_window(conn, e->window);

	/* in case of fire, abort */
	if (client == NULL)
		return;

	if (randr_base != -1) {
		client->monitor = find_monitor_by_coord(client->geom.x, client->geom.y);
		if (client->monitor == NULL && mon_list != NULL)
			client->monitor = mon_list->data;
	}

	fit_on_screen(client);

	/* window is normal */
	xcb_change_property(conn, XCB_PROP_MODE_REPLACE, client->window,
			ewmh->_NET_WM_STATE, ewmh->_NET_WM_STATE, 32, 2, data);

	center_pointer(client);
	update_client_list();

	if (!client->maxed)
		set_borders(client, conf.focus_color, conf.internal_focus_color);
	update_current_desktop(client);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movdqa 0x4c6f(%rip), %xmm0     # 0x9040
movdqa %xmm0, 0x20(%rsp)
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x49ea
movq %rax, %r14
testq %rax, %rax
je 0x44b1
movq 0x7fc2(%rip), %rdi      # 0xc3b8
movl (%rbx), %esi
callq 0x3270
cmpl $-0x1, 0x8408(%rip)     # 0xc80c
je 0x443a
movswl 0x4(%r14), %edi
movswl 0x6(%r14), %esi
callq 0x5a1f
movq %rax, 0x40(%r14)
testq %rax, %rax
sete %cl
movq 0x83ea(%rip), %rax      # 0xc810
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x443a
movq (%rax), %rax
movq %rax, 0x40(%r14)
movq %r14, %rdi
callq 0x4a0a
movq 0x7f6f(%rip), %rdi      # 0xc3b8
movl (%r14), %edx
movq 0x7f6d(%rip), %rax      # 0xc3c0
movl 0x84(%rax), %ecx
leaq 0x20(%rsp), %rax
pushq $0x20
popq %r9
xorl %esi, %esi
movl %ecx, %r8d
pushq %rax
pushq $0x2
callq 0x35a0
popq %rcx
popq %rdx
movq %r14, %rdi
callq 0x5a6c
callq 0x5738
cmpb $0x0, 0x24(%r14)
jne 0x4499
movl 0x831d(%rip), %esi      # 0xc7a8
movl 0x831f(%rip), %edx      # 0xc7b0
movq %r14, %rdi
callq 0x5117
movq %r14, %rdi
callq 0x5b20
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl (%rbx), %ebp
movq 0x7f06(%rip), %r14      # 0xc3c0
movq %r14, %rdi
movl %ebp, %esi
callq 0x3070
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x3120
cmpb $0x1, %al
jne 0x452b
movl 0x8(%rsp), %eax
movq 0x10(%rsp), %rcx
movq 0x7ed7(%rip), %rdx      # 0xc3c0
xorl %esi, %esi
cmpq %rsi, %rax
je 0x452b
movl (%rcx,%rsi,4), %edi
cmpl 0xd8(%rdx), %edi
je 0x450e
cmpl 0xd4(%rdx), %edi
je 0x450e
incq %rsi
cmpl 0xd0(%rdx), %edi
jne 0x44eb
leaq 0x8(%rsp), %rdi
callq 0x36f0
movq 0x7e99(%rip), %rdi      # 0xc3b8
movl %ebp, %esi
callq 0x3270
jmp 0x44a1
leaq 0x30(%rsp), %rcx
movl $0x200010, (%rcx)       # imm = 0x200010
movq 0x7e7b(%rip), %rdi      # 0xc3b8
movl %ebp, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x3450
movq 0x7e68(%rip), %rdi      # 0xc3b8
xorl %esi, %esi
movl %ebp, %edx
callq 0x3590
movq 0x7e60(%rip), %rdi      # 0xc3c0
pushq $-0x1
popq %rdx
movl %ebp, %esi
callq 0x3440
leaq 0x7e57(%rip), %rdi      # 0xc3c8
callq 0x7f71
testq %rax, %rax
je 0x44a1
movq %rax, %r15
leaq 0x7e47(%rip), %rdi      # 0xc3d0
callq 0x7f71
testq %rax, %rax
je 0x44a1
movq %rax, %r12
pushq $0x60
popq %rdi
callq 0x31a0
testq %rax, %rax
je 0x44a1
movq %rax, %r14
movq %rax, (%r12)
movq %r12, 0x38(%rax)
movq %rax, (%r15)
movq %r15, 0x30(%rax)
movl %ebp, (%rax)
andl $0x0, 0x48(%rax)
leaq 0x4(%rax), %rsi
leaq 0xa(%rax), %r8
andq $0x0, 0x4(%rax)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x18(%rax)
movl $0x10001, 0x50(%rax)    # imm = 0x10001
xorl %eax, %eax
movb %al, 0xc(%r14)
andq $0x0, 0x40(%r14)
movb %al, 0x54(%r14)
movb %al, 0x28(%r14)
orl $-0x1, 0x58(%r14)
leaq 0x8(%r14), %rcx
leaq 0x6(%r14), %rdx
movq %r14, %r9
addq $0x5c, %r9
movq %r14, %rdi
callq 0x5b34
movq 0x7da2(%rip), %r15      # 0xc3b8
movq %r15, %rdi
movl %ebp, %esi
callq 0x30c0
leaq 0x38(%rsp), %r12
movq %r15, %rdi
movl %eax, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x3700
movl (%r12), %eax
testb $0x1, %al
je 0x4641
movb $0x1, 0xc(%r14)
testb $0x10, %al
je 0x4656
movq 0x4c(%rsp), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x48(%r14)
testb $0x40, %al
je 0x466b
movq 0x5c(%rsp), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x50(%r14)
movq %r14, %rdi
callq 0x4fb8
cmpb $0x0, 0xc(%r14)
jne 0x46ea
movq 0x8157(%rip), %rax      # 0xc7d8
movq 0x7d30(%rip), %r15      # 0xc3b8
movl (%rax), %esi
movq %r15, %rdi
callq 0x3500
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3670
movzwl 0x14(%rax), %ecx
movw %cx, 0x4(%r14)
movzwl 0x16(%rax), %ecx
movw %cx, 0x6(%r14)
movq %rax, %rdi
callq 0x32c0
movd 0x8(%r14), %xmm0
psrlw $0x1, %xmm0
movd 0x4(%r14), %xmm1
psubw %xmm0, %xmm1
movd %xmm1, 0x4(%r14)
movd %xmm1, %eax
movl (%r14), %edi
pextrw $0x1, %xmm1, %ecx
movswl %ax, %esi
movswl %cx, %edx
callq 0x4c44
cmpb $0x1, 0x80d1(%rip)      # 0xc7c2
jne 0x43ef
movl 0x810b(%rip), %esi      # 0xc808
movq %r14, %rdi
callq 0x59e7
jmp 0x43ef