// File: /workspace/github_c_makefile_star2_O3/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 0x4beb(%rip), %xmm0     # 0x9040
movdqa %xmm0, 0x20(%rsp)
movq 0x7f66(%rip), %rax      # 0xc3c8
movl 0x8(%rdi), %ebp
testq %rax, %rax
je 0x447c
movq (%rax), %r14
cmpl %ebp, (%r14)
je 0x46cd
movq 0x10(%rax), %rax
jmp 0x4465
movq 0x7f3d(%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 0x3130
cmpb $0x1, %al
jne 0x44ee
movl 0x8(%rsp), %eax
testq %rax, %rax
je 0x44ee
movq 0x10(%rsp), %rcx
movq 0x7f09(%rip), %rdx      # 0xc3c0
movl 0xd8(%rdx), %esi
xorl %edi, %edi
movl (%rcx,%rdi,4), %r8d
cmpl %esi, %r8d
je 0x4790
cmpl 0xd4(%rdx), %r8d
je 0x4790
cmpl 0xd0(%rdx), %r8d
je 0x4790
incq %rdi
cmpq %rdi, %rax
jne 0x44bf
leaq 0x30(%rsp), %rcx
movl $0x200010, (%rcx)       # imm = 0x200010
movq 0x7eb8(%rip), %rdi      # 0xc3b8
movl %ebp, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x3460
movq 0x7ea5(%rip), %rdi      # 0xc3b8
xorl %esi, %esi
movl %ebp, %edx
callq 0x35a0
movq 0x7e9d(%rip), %rdi      # 0xc3c0
movl %ebp, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3450
leaq 0x7e92(%rip), %rdi      # 0xc3c8
callq 0x85d2
testq %rax, %rax
je 0x47a8
movq %rax, %r15
leaq 0x7e82(%rip), %rdi      # 0xc3d0
callq 0x85d2
testq %rax, %rax
je 0x47a8
movq %rax, %r12
movl $0x60, %edi
callq 0x31b0
testq %rax, %rax
je 0x47a8
movq %rax, %r14
movq %rax, (%r12)
movq %r12, 0x38(%rax)
movq %rax, (%r15)
movq %r15, 0x30(%rax)
movl %ebp, (%rax)
movl $0x0, 0x48(%rax)
leaq 0x4(%rax), %rsi
leaq 0xa(%rax), %r8
leaq 0x8(%rax), %rcx
leaq 0x6(%rax), %rdx
xorl %eax, %eax
movq %rax, 0x4(%r14)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x18(%r14)
movl $0x10001, 0x50(%r14)    # imm = 0x10001
movb %al, 0xc(%r14)
movq %rax, 0x40(%r14)
movb %al, 0x54(%r14)
movb %al, 0x28(%r14)
movl $0xffffffff, 0x58(%r14) # imm = 0xFFFFFFFF
movq %r14, %r9
addq $0x5c, %r9
movl %ebp, %edi
callq 0x5cc9
movq 0x7dd6(%rip), %r15      # 0xc3b8
movq %r15, %rdi
movl %ebp, %esi
callq 0x30d0
leaq 0x38(%rsp), %r12
movq %r15, %rdi
movl %eax, %esi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x3710
movl (%r12), %eax
testb $0x1, %al
je 0x460d
movb $0x1, 0xc(%r14)
testb $0x10, %al
je 0x4622
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 0x4637
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 0x510b
cmpb $0x0, 0xc(%r14)
jne 0x46b6
movq 0x818b(%rip), %rax      # 0xc7d8
movl (%rax), %esi
movq 0x7d62(%rip), %r15      # 0xc3b8
movq %r15, %rdi
callq 0x3510
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3680
movzwl 0x14(%rax), %ecx
movw %cx, 0x4(%r14)
movzwl 0x16(%rax), %ecx
movw %cx, 0x6(%r14)
movq %rax, %rdi
callq 0x32d0
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 0x4d70
cmpb $0x1, 0x8105(%rip)      # 0xc7c2
jne 0x46cd
movl 0x8143(%rip), %esi      # 0xc808
movq %r14, %rdi
callq 0x5b74
movq 0x7ce4(%rip), %rdi      # 0xc3b8
movl 0x8(%rbx), %esi
callq 0x3280
cmpl $-0x1, 0x8129(%rip)     # 0xc80c
je 0x4719
movswl 0x4(%r14), %edi
movswl 0x6(%r14), %esi
callq 0x5bc0
movq %rax, 0x40(%r14)
testq %rax, %rax
sete %cl
movq 0x810b(%rip), %rax      # 0xc810
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x4719
movq (%rax), %rax
movq %rax, 0x40(%r14)
movq %r14, %rdi
callq 0x4b33
movq 0x7c90(%rip), %rdi      # 0xc3b8
movl (%r14), %edx
movq 0x7c8e(%rip), %rax      # 0xc3c0
movl 0x84(%rax), %ecx
leaq 0x20(%rsp), %rax
xorl %esi, %esi
movl %ecx, %r8d
movl $0x20, %r9d
pushq %rax
pushq $0x2
callq 0x35b0
addq $0x10, %rsp
movq %r14, %rdi
callq 0x5c17
callq 0x5895
cmpb $0x0, 0x24(%r14)
jne 0x477c
movl 0x803a(%rip), %esi      # 0xc7a8
movl 0x803c(%rip), %edx      # 0xc7b0
movq %r14, %rdi
callq 0x5273
movl 0x58(%r14), %edx
movq 0x7c39(%rip), %rdi      # 0xc3c0
xorl %esi, %esi
callq 0x35c0
jmp 0x47a8
leaq 0x8(%rsp), %rdi
callq 0x3700
movq 0x7c17(%rip), %rdi      # 0xc3b8
movl %ebp, %esi
callq 0x3280
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq