// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq 0x78c5(%rip), %rax      # 0xc150
movq %rax, -0x30(%rbp)
movq 0x78c2(%rip), %rax      # 0xc158
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x4ff0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4990
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x6b20
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x48d2
jmp 0x4a8e
movq -0x18(%rbp), %rax
testb $0x1, 0xc(%rax)
jne 0x4976
movq 0xaf11(%rip), %rdi      # 0xf7f8
movq -0x18(%rbp), %rsi
addq $0x4, %rsi
movq -0x18(%rbp), %rdx
addq $0x4, %rdx
addq $0x2, %rdx
callq 0x6f20
testb $0x1, %al
jne 0x4918
movq -0x18(%rbp), %rax
movw $0x0, 0x6(%rax)
movq -0x18(%rbp), %rax
movw $0x0, 0x4(%rax)
movq -0x18(%rbp), %rax
movzwl 0x8(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x18(%rbp), %rax
movswl 0x4(%rax), %ecx
subl %edx, %ecx
movw %cx, 0x4(%rax)
movq -0x18(%rbp), %rax
movzwl 0xa(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movq -0x18(%rbp), %rax
movswl 0x6(%rax), %ecx
subl %edx, %ecx
movw %cx, 0x6(%rax)
movq -0x18(%rbp), %rax
movl (%rax), %edi
movq -0x18(%rbp), %rax
movw 0x4(%rax), %cx
movq -0x18(%rbp), %rax
movswl %cx, %esi
movswl 0x6(%rax), %edx
callq 0x5460
testb $0x1, 0xae65(%rip)      # 0xf7e2
je 0x498e
movq -0x18(%rbp), %rdi
movl 0xae9f(%rip), %esi      # 0xf828
callq 0x6fa0
jmp 0x4990
movq 0xaa41(%rip), %rdi      # 0xf3d8
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x3280
movl %eax, -0x34(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x49b2
jmp 0x4a8e
cmpl $-0x1, 0xae73(%rip)     # 0xf82c
je 0x4a07
movq -0x18(%rbp), %rax
movw 0x4(%rax), %cx
movq -0x18(%rbp), %rax
movswl %cx, %edi
movswl 0x6(%rax), %esi
callq 0x7000
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0x4a05
cmpq $0x0, 0xae3f(%rip)      # 0xf830
je 0x4a05
movq 0xae36(%rip), %rax      # 0xf830
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
jmp 0x4a07
movq -0x18(%rbp), %rdi
callq 0x5060
movq 0xa9c1(%rip), %rdi      # 0xf3d8
movq -0x18(%rbp), %rax
movl (%rax), %edx
movq 0xa9bc(%rip), %rax      # 0xf3e0
movl 0x84(%rax), %ecx
movq 0xa9af(%rip), %rax      # 0xf3e0
movl 0x84(%rax), %r8d
leaq -0x30(%rbp), %rax
xorl %esi, %esi
movl $0x20, %r9d
movl $0x2, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x35b0
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x70b0
callq 0x6750
movq -0x18(%rbp), %rax
testb $0x1, 0x24(%rax)
jne 0x4a85
movq -0x18(%rbp), %rdi
movl 0xad4e(%rip), %esi      # 0xf7c8
movl 0xad50(%rip), %edx      # 0xf7d0
callq 0x5d90
movq -0x18(%rbp), %rdi
callq 0x7210
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)