// File: /workspace/github_c_makefile_star2_O1/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
movaps 0x4cb3(%rip), %xmm0     # 0x9140
movaps %xmm0, 0x20(%rsp)
movq 0x7f2f(%rip), %rax      # 0xc3c8
testq %rax, %rax
je 0x44b2
movl 0x8(%rbx), %ecx
movq (%rax), %r14
cmpl %ecx, (%r14)
je 0x44b5
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x44a1
xorl %r14d, %r14d
testq %r14, %r14
je 0x458f
movq 0x7ef3(%rip), %rdi      # 0xc3b8
movl 0x8(%rbx), %esi
callq 0x3280
cmpl $-0x1, 0x8338(%rip)     # 0xc80c
je 0x450a
movswl 0x4(%r14), %edi
movswl 0x6(%r14), %esi
callq 0x5c65
movq %rax, 0x40(%r14)
testq %rax, %rax
sete %cl
movq 0x831a(%rip), %rax      # 0xc810
testq %rax, %rax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x450a
movq (%rax), %rax
movq %rax, 0x40(%r14)
movq %r14, %rdi
callq 0x4bf6
movq 0x7e9f(%rip), %rdi      # 0xc3b8
movl (%r14), %edx
movq 0x7e9d(%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 0x5cbc
callq 0x594d
cmpb $0x0, 0x24(%r14)
jne 0x456d
movl 0x8249(%rip), %esi      # 0xc7a8
movl 0x824b(%rip), %edx      # 0xc7b0
movq %r14, %rdi
callq 0x532f
movq 0x7e4c(%rip), %rdi      # 0xc3c0
movl 0x58(%r14), %edx
xorl %esi, %esi
callq 0x35c0
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %ebp
movq 0x7e27(%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 0x4637
movl 0x8(%rsp), %eax
testq %rax, %rax
je 0x4637
movq 0x10(%rsp), %rcx
movq 0x7df3(%rip), %rdi      # 0xc3c0
movl 0xd8(%rdi), %edx
movl (%rcx), %r8d
cmpl %edx, %r8d
je 0x461a
movl 0xd4(%rdi), %esi
cmpl %esi, %r8d
je 0x461a
movl 0xd0(%rdi), %edi
movb $0x1, %r9b
movl $0x1, %r10d
cmpl %edi, %r8d
je 0x4614
cmpq %r10, %rax
je 0x4637
seta %r9b
movl (%rcx,%r10,4), %r8d
cmpl %edx, %r8d
je 0x4614
incq %r10
cmpl %esi, %r8d
jne 0x45f5
testb $0x1, %r9b
je 0x4637
leaq 0x8(%rsp), %rdi
callq 0x3700
movq 0x7d8d(%rip), %rdi      # 0xc3b8
movl %ebp, %esi
callq 0x3280
jmp 0x4792
leaq 0x30(%rsp), %rcx
movl $0x200010, (%rcx)       # imm = 0x200010
movq 0x7d6f(%rip), %rdi      # 0xc3b8
movl %ebp, %esi
movl $0x800, %edx            # imm = 0x800
callq 0x3460
movq 0x7d5c(%rip), %rdi      # 0xc3b8
xorl %r14d, %r14d
xorl %esi, %esi
movl %ebp, %edx
callq 0x35a0
movq 0x7d51(%rip), %rdi      # 0xc3c0
movl %ebp, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3450
leaq 0x7d46(%rip), %rdi      # 0xc3c8
callq 0x85d2
testq %rax, %rax
je 0x4795
movq %rax, %r15
leaq 0x7d36(%rip), %rdi      # 0xc3d0
callq 0x85d2
testq %rax, %rax
je 0x4792
movq %rax, %r12
movl $0x60, %edi
callq 0x31b0
testq %rax, %rax
je 0x4792
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)
xorps %xmm0, %xmm0
movups %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
movq %r14, %rdi
callq 0x5d6e
movq 0x7c8b(%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 0x4758
movb $0x1, 0xc(%r14)
testb $0x10, %al
je 0x4770
movzwl 0x4c(%rsp), %ecx
movw %cx, 0x48(%r14)
movzwl 0x50(%rsp), %ecx
movw %cx, 0x4a(%r14)
testb $0x40, %al
je 0x4788
movzwl 0x5c(%rsp), %eax
movw %ax, 0x50(%r14)
movzwl 0x60(%rsp), %eax
movw %ax, 0x52(%r14)
movq %r14, %rdi
callq 0x51c7
jmp 0x4795
xorl %r14d, %r14d
testq %r14, %r14
je 0x457f
cmpb $0x0, 0xc(%r14)
jne 0x482b
movq 0x8028(%rip), %rax      # 0xc7d8
movq 0x7c01(%rip), %r15      # 0xc3b8
movl (%rax), %esi
movq %r15, %rdi
callq 0x3510
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3680
movq %rax, %r15
movzwl 0x14(%rax), %eax
movw %ax, 0x4(%r14)
movzwl 0x16(%r15), %eax
movw %ax, 0x6(%r14)
movq %r15, %rdi
callq 0x32d0
testq %r15, %r15
jne 0x47f8
movl $0x0, 0x4(%r14)
movzwl 0x8(%r14), %eax
shrl %eax
movl (%r14), %edi
movl 0x4(%r14), %ecx
subl %eax, %ecx
movw %cx, 0x4(%r14)
movzwl 0xa(%r14), %eax
shrl %eax
movzwl 0x6(%r14), %edx
subl %eax, %edx
movw %dx, 0x6(%r14)
movswl %cx, %esi
movswl %dx, %edx
callq 0x4e11
cmpb $0x1, 0x7f90(%rip)      # 0xc7c2
jne 0x44be
movl 0x7fca(%rip), %esi      # 0xc808
movq %r14, %rdi
callq 0x5c14
jmp 0x44be