// File: /workspace/github_c_makefile_star2_O2/kek[P]evilwm/new.c
// Function: make_new_client
void make_new_client(Window w, ScreenInfo *s) {
	Client *c;
	char *name;
	XClassHint *class;
	unsigned int window_type;

	LOG_ENTER("make_new_client(window=%lx)", w);

	XGrabServer(dpy);

	/* First a bit of interaction with the error handler due to X's
	 * tendency to batch event notifications.  We set a global variable to
	 * the id of the window we're initialising then do simple X call on
	 * that window.  If an error is raised by this (and nothing else should
	 * do so as we've grabbed the server), the error handler resets the
	 * variable indicating the window has already disappeared, so we stop
	 * trying to manage it. */
	initialising = w;
	XFetchName(dpy, w, &name);
	XSync(dpy, False);
	/* If 'initialising' is now set to None, that means doing the
	 * XFetchName raised BadWindow - the window has been removed before
	 * we got a chance to grab the server. */
	if (initialising == None) {
		LOG_DEBUG("XError occurred for initialising window - aborting...\n");
		XUngrabServer(dpy);
		LOG_LEAVE();
		return;
	}
	initialising = None;
	LOG_DEBUG("screen=%d\n", s->screen);
	LOG_DEBUG("name=%s\n", name ? name : "Untitled");
	if (name)
		XFree(name);

	window_type = ewmh_get_net_wm_window_type(w);
	/* Don't manage DESKTOP type windows */
	if (window_type & EWMH_WINDOW_TYPE_DESKTOP) {
		XMapWindow(dpy, w);
		XUngrabServer(dpy);
		return;
	}

	c = malloc(sizeof(Client));
	/* Don't crash the window manager, just fail the operation. */
	if (!c) {
		LOG_ERROR("out of memory in new_client; limping onward\n");
		LOG_LEAVE();
		XUngrabServer(dpy);
		return;
	}
	clients_tab_order = list_prepend(clients_tab_order, c);
	clients_mapping_order = list_append(clients_mapping_order, c);
	clients_stacking_order = list_append(clients_stacking_order, c);

	c->screen = s;
	c->window = w;
	c->ignore_unmap = 0;
	c->remove = 0;

	/* Ungrab the X server as soon as possible. Now that the client is
	 * malloc()ed and attached to the list, it is safe for any subsequent
	 * X calls to raise an X error and thus flag it for removal. */
	XUngrabServer(dpy);

	c->border = opt_bw;

	update_window_type_flags(c, window_type);
	init_geometry(c);

#ifdef DEBUG
	{
		struct list *iter;
		int i = 0;
		for (iter = clients_tab_order; iter; iter = iter->next)
			i++;
		LOG_DEBUG("new window %dx%d+%d+%d, wincount=%d\n", c->width, c->height, c->x, c->y, i);
	}
#endif

	XSelectInput(dpy, c->window, ColormapChangeMask | EnterWindowMask | PropertyChangeMask);

	reparent(c);

#ifdef SHAPE
	if (have_shape) {
		XShapeSelectInput(dpy, c->window, ShapeNotifyMask);
		set_shape(c);
	}
#endif

	/* Read instance/class information for client and check against list
	 * built with -app options */
	class = XAllocClassHint();
	if (class) {
		struct list *aiter = applications;
		XGetClassHint(dpy, w, class);
		while (aiter) {
			Application *a = aiter->data;
			if ((!a->res_name || (class->res_name && !strcmp(class->res_name, a->res_name)))
					&& (!a->res_class || (class->res_class && !strcmp(class->res_class, a->res_class)))) {
				if (a->geometry_mask & WidthValue)
					c->width = a->width * c->width_inc;
				if (a->geometry_mask & HeightValue)
					c->height = a->height * c->height_inc;
				if (a->geometry_mask & XValue) {
					if (a->geometry_mask & XNegative)
						c->x = a->x + DisplayWidth(dpy, s->screen)-c->width-c->border;
					else
						c->x = a->x + c->border;
				}
				if (a->geometry_mask & YValue) {
					if (a->geometry_mask & YNegative)
						c->y = a->y + DisplayHeight(dpy, s->screen)-c->height-c->border;
					else
						c->y = a->y + c->border;
				}
				moveresize(c);
				if (a->is_dock) c->is_dock = 1;
#ifdef VWM
				if (a->vdesk != VDESK_NONE) c->vdesk = a->vdesk;
#endif
			}
			aiter = aiter->next;
		}
		XFree(class->res_name);
		XFree(class->res_class);
		XFree(class);
	}
	ewmh_init_client(c);
	ewmh_set_net_client_list(c->screen);
	ewmh_set_net_client_list_stacking(c->screen);

	/* Only map the window frame (and thus the window) if it's supposed
	 * to be visible on this virtual desktop. */
#ifdef VWM
	if (is_fixed(c) || c->vdesk == s->vdesk)
#endif
	{
		client_show(c);
		client_raise(c);
#ifndef MOUSE
		select_client(c);
#ifdef WARP_POINTER
		setmouse(c->window, c->width + c->border - 1,
				c->height + c->border - 1);
#endif
		discard_enter_events(c);
#endif
	}
#ifdef VWM
	else {
		set_wm_state(c, IconicState);
	}
	ewmh_set_net_wm_desktop(c);
#endif
	LOG_LEAVE();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %r12
movq %rdi, %r15
leaq 0x73e2(%rip), %rbx      # 0xd7e0
movq (%rbx), %rdi
callq 0x34b0
leaq 0x73ab(%rip), %r14      # 0xd7b8
movq %r15, (%r14)
movq (%rbx), %rdi
leaq 0x50(%rsp), %rdx
movq %r15, %rsi
callq 0x32e0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x3490
cmpq $0x0, (%r14)
je 0x6650
movq %r12, 0x40(%rsp)
movq $0x0, (%r14)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x644f
callq 0x3210
movq %r15, %rdi
callq 0x56c6
movl %eax, %ebp
testb $0x1, %bpl
jne 0x6645
movl $0x80, %edi
callq 0x3430
testq %rax, %rax
je 0x6bd5
movq %rax, %r14
leaq 0x7318(%rip), %r12      # 0xd798
movq (%r12), %rdi
movq %rax, %rsi
callq 0x585c
movq %rax, (%r12)
leaq 0x7309(%rip), %r12      # 0xd7a0
movq (%r12), %rdi
movq %r14, %rsi
callq 0x5867
movq %rax, (%r12)
leaq 0x72fa(%rip), %r12      # 0xd7a8
movq (%r12), %rdi
movq %r14, %rsi
callq 0x5867
movq %rax, (%r12)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%r14)
movq %r15, (%r14)
andl $0x0, 0x20(%r14)
andl $0x0, 0x7c(%r14)
movq (%rbx), %rdi
callq 0x33f0
leaq 0x6f05(%rip), %rax      # 0xd3e8
movl (%rax), %eax
movl %eax, 0x34(%r14)
shrl %ebp
andl $0x1, %ebp
movl %ebp, 0x78(%r14)
movq (%r14), %rdi
leaq 0x7154(%rip), %rax      # 0xd650
movq (%rax), %rdx
leaq 0x38(%rsp), %rcx
movq %rdx, %rsi
callq 0x3e55
testq %rax, %rax
je 0x6531
cmpq $0x3, 0x38(%rsp)
jb 0x6529
testb $0x2, (%rax)
je 0x6529
testb $0x3, 0x10(%rax)
jne 0x6529
andl $0x0, 0x34(%r14)
movq %rax, %rdi
callq 0x3210
movq (%r14), %rdi
movq 0x10(%r14), %rax
movl 0x40(%rax), %eax
movl %eax, 0x74(%r14)
leaq 0x719a(%rip), %rax      # 0xd6e0
movq (%rax), %rsi
pushq $0x6
popq %rdx
leaq 0x38(%rsp), %rcx
callq 0x3e55
testq %rax, %rax
je 0x6579
cmpq $0x0, 0x38(%rsp)
je 0x6571
movl (%rax), %ecx
leal 0x1(%rcx), %edx
cmpl $0x8, %edx
ja 0x6571
movl %ecx, 0x74(%r14)
movq %rax, %rdi
callq 0x3210
movq %r14, %rdi
callq 0x6cda
movq (%rbx), %rdi
movq (%r14), %rsi
leaq 0x70(%rsp), %r12
movq %r12, %rdx
callq 0x35b0
movl 0x10(%r12), %eax
movl %eax, 0x70(%r14)
andq $0x0, 0x40(%r14)
movq 0x50(%r12), %rax
movq %rax, 0x18(%r14)
movq (%r14), %rdi
leaq 0x70a3(%rip), %rax      # 0xd658
movq (%rax), %rsi
pushq $0x6
popq %rdx
leaq 0x38(%rsp), %rcx
callq 0x3e55
testq %rax, %rax
je 0x65e7
cmpq $0x2, 0x38(%rsp)
jne 0x65df
movl (%rax), %ecx
movl %ecx, 0x38(%r14)
movl 0x8(%rax), %ecx
movl %ecx, 0x40(%r14)
movq %rax, %rdi
callq 0x3210
movq (%r14), %rdi
leaq 0x706f(%rip), %rax      # 0xd660
movq (%rax), %rsi
pushq $0x6
popq %rdx
leaq 0x38(%rsp), %rcx
callq 0x3e55
testq %rax, %rax
je 0x6623
cmpq $0x2, 0x38(%rsp)
jne 0x661b
movl (%rax), %ecx
movl %ecx, 0x3c(%r14)
movl 0x8(%rax), %ecx
movl %ecx, 0x44(%r14)
movq %rax, %rdi
callq 0x3210
movq %r15, 0x48(%rsp)
movq %r14, %rdi
callq 0x6bf6
movq %rax, %r13
movl 0x78(%rsp), %ecx
movl 0x48(%r14), %eax
cmpl %eax, %ecx
jge 0x665d
movl 0x4c(%r14), %edx
jmp 0x6669
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x35f0
movq (%rbx), %rdi
callq 0x33f0
jmp 0x6bc3
movl 0x7c(%rsp), %esi
movl 0x4c(%r14), %edx
cmpl %edx, %esi
jge 0x667b
movl %eax, 0x2c(%r14)
movl %edx, 0x30(%r14)
movq %r14, %rdi
callq 0x39f2
jmp 0x6683
movl %ecx, 0x2c(%r14)
movl %esi, 0x30(%r14)
movl 0xcc(%rsp), %eax
cmpl $0x2, %eax
je 0x6739
andl $0x1, %r13d
jne 0x6739
movq (%rbx), %rdi
movq 0xe8(%rdi), %rax
movq 0x10(%r14), %rcx
movslq (%rcx), %rdx
shlq $0x7, %rdx
movl 0x18(%rax,%rdx), %ebp
movl 0x1c(%rax,%rdx), %r12d
movq 0x8(%rcx), %rsi
leaq 0x58(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x5c(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x68(%rsp), %rcx
leaq 0x64(%rsp), %r13
leaq 0x60(%rsp), %r15
movq %rcx, %rdx
movq %r13, %r8
movq %r15, %r9
callq 0x3390
movl 0x34(%r14), %ecx
movl 0x2c(%r14), %edx
addl %ecx, %edx
movl %ebp, %eax
subl %edx, %eax
imull (%r13), %eax
cltd
idivl %ebp
movl %eax, 0x24(%r14)
addl 0x30(%r14), %ecx
movl %r12d, %eax
subl %ecx, %eax
imull (%r15), %eax
cltd
idivl %r12d
leaq 0x70(%rsp), %r12
movl %eax, 0x28(%r14)
movq %r14, %rdi
callq 0x39f2
movl 0xcc(%rsp), %eax
jmp 0x6742
movq 0x70(%rsp), %rcx
movq %rcx, 0x24(%r14)
cmpl $0x2, %eax
jne 0x674b
incl 0x20(%r14)
movl 0x70(%r14), %esi
movq 0x24(%r14), %xmm0
movd %esi, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
paddd %xmm0, %xmm1
movq %xmm1, 0x24(%r14)
negl %esi
movq %r14, %rdi
callq 0x3a3e
movl 0x34(%r14), %esi
movq %r14, %rdi
callq 0x3a3e
movq (%rbx), %rdi
movq (%r14), %rsi
movl $0xc00010, %edx         # imm = 0xC00010
callq 0x34a0
movq 0x10(%r14), %rax
movq 0x30(%rax), %rcx
movq %rcx, 0x88(%rsp)
pushq $0x1
popq %r15
movl %r15d, 0xc8(%rsp)
movq $0x180014, 0xb8(%rsp) # imm = 0x180014
movq (%rbx), %rdi
movq 0x8(%rax), %rsi
movl 0x34(%r14), %r10d
movl 0x24(%r14), %edx
movl 0x28(%r14), %ecx
subl %r10d, %edx
subl %r10d, %ecx
movl 0x2c(%r14), %r8d
movl 0x30(%r14), %r9d
movq 0xe8(%rdi), %r11
movslq (%rax), %rax
shlq $0x7, %rax
movl 0x38(%r11,%rax), %ebp
movq 0x40(%r11,%rax), %rax
movq %r12, 0x28(%rsp)
movq %rax, 0x18(%rsp)
movl %ebp, 0x8(%rsp)
andl $0x0, 0x10(%rsp)
movl %r10d, (%rsp)
movq $0xa08, 0x20(%rsp)      # imm = 0xA08
callq 0x3470
movq %rax, 0x8(%r14)
movq (%rbx), %rdi
movq (%r14), %rsi
callq 0x3560
movq (%rbx), %rdi
movq (%r14), %rsi
xorl %edx, %edx
callq 0x33b0
movq (%rbx), %rdi
movq (%r14), %rsi
movq 0x8(%r14), %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3060
movq (%rbx), %rdi
movq (%r14), %rsi
callq 0x35f0
movq (%rbx), %rdi
leaq 0x6b7b(%rip), %r12      # 0xd3d4
movl (%r12), %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movl %r15d, (%rsp)
pushq $0xc
popq %rbp
xorl %esi, %esi
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x3270
movq (%rbx), %rdi
movl (%r12), %edx
orl $0x2, %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movl %r15d, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x3270
movq (%rbx), %rdi
leaq 0x6ec4(%rip), %rax      # 0xd780
movl (%r12), %edx
orl (%rax), %edx
movq %rax, %r13
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movl %r15d, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x3270
movq (%rbx), %rdi
movl (%r13), %edx
orl (%r12), %edx
orl $0x2, %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movl %r15d, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x3270
movq (%rbx), %rdi
leaq 0x6ab3(%rip), %r13      # 0xd3d8
movl (%r13), %edx
orl (%r12), %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movl %r15d, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x3270
movq (%rbx), %rdi
movl (%r12), %edx
orl (%r13), %edx
orl $0x2, %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movl %r15d, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x3270
movl (%r12), %edx
leaq 0x6df2(%rip), %rax      # 0xd780
orl (%rax), %edx
movq (%rbx), %rdi
orl (%r13), %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movl %r15d, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x3270
movq (%rbx), %rdi
leaq 0x6dbb(%rip), %rax      # 0xd780
movl (%rax), %edx
orl (%r12), %edx
orl (%r13), %edx
orl $0x2, %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %xmm0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movl %r15d, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl %ebp, %r9d
callq 0x3270
leaq 0x6e13(%rip), %rax      # 0xd810
xorl %ecx, %ecx
cmpl %ecx, (%rax)
je 0x6a19
movq (%rbx), %rdi
movq (%r14), %rsi
pushq $0x1
popq %rdx
callq 0x36b0
movq %r14, %rdi
callq 0x3dd1
callq 0x3030
testq %rax, %rax
movq 0x40(%rsp), %rbp
je 0x6b76
movq %rax, %r12
leaq 0x6d5a(%rip), %rax      # 0xd790
movq (%rax), %r13
movq (%rbx), %rdi
movq 0x48(%rsp), %rsi
movq %r12, %rdx
callq 0x3590
testq %r13, %r13
je 0x6b5b
movq 0x8(%r13), %r15
movq (%r15), %rsi
testq %rsi, %rsi
je 0x6a78
movq (%r12), %rdi
testq %rdi, %rdi
je 0x6b52
callq 0x3310
testl %eax, %eax
jne 0x6b52
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x6a9c
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x6b52
callq 0x3310
testl %eax, %eax
jne 0x6b52
movl 0x10(%r15), %eax
testb $0x4, %al
je 0x6ab1
movl 0x58(%r14), %ecx
imull 0x1c(%r15), %ecx
movl %ecx, 0x2c(%r14)
testb $0x8, %al
je 0x6ac2
movl 0x5c(%r14), %ecx
imull 0x20(%r15), %ecx
movl %ecx, 0x30(%r14)
testb $0x1, %al
je 0x6af8
movl 0x14(%r15), %ecx
testb $0x10, %al
jne 0x6ad4
addl 0x34(%r14), %ecx
jmp 0x6af4
movq (%rbx), %rdx
movq 0xe8(%rdx), %rdx
movslq (%rbp), %rsi
shlq $0x7, %rsi
addl 0x18(%rdx,%rsi), %ecx
movl 0x2c(%r14), %edx
addl 0x34(%r14), %edx
subl %edx, %ecx
movl %ecx, 0x24(%r14)
testb $0x2, %al
je 0x6b2e
movl 0x18(%r15), %ecx
testb $0x20, %al
jne 0x6b0a
addl 0x34(%r14), %ecx
jmp 0x6b2a
movq (%rbx), %rax
movq 0xe8(%rax), %rax
movslq (%rbp), %rdx
shlq $0x7, %rdx
addl 0x1c(%rax,%rdx), %ecx
movl 0x30(%r14), %eax
addl 0x34(%r14), %eax
subl %eax, %ecx
movl %ecx, 0x28(%r14)
movq %r14, %rdi
callq 0x701d
cmpl $0x0, 0x24(%r15)
je 0x6b45
movl $0x1, 0x78(%r14)
movl 0x28(%r15), %eax
cmpl $-0x2, %eax
je 0x6b52
movl %eax, 0x74(%r14)
movq (%r13), %r13
jmp 0x6a49
movq (%r12), %rdi
callq 0x3210
movq 0x8(%r12), %rdi
callq 0x3210
movq %r12, %rdi
callq 0x3210
movq %r14, %rdi
callq 0x53a1
movq 0x10(%r14), %rdi
callq 0x54bc
movq 0x10(%r14), %rdi
callq 0x555a
movl 0x74(%r14), %eax
cmpl $-0x1, %eax
je 0x6b9e
cmpl 0x40(%rbp), %eax
jne 0x6bb0
movq %r14, %rdi
callq 0x38f8
movq %r14, %rdi
callq 0x391b
jmp 0x6bbb
pushq $0x3
popq %rsi
movq %r14, %rdi
callq 0x38b4
movq %r14, %rdi
callq 0x568e
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x641c(%rip), %rax      # 0xcff8
movq (%rax), %rcx
leaq 0x2bca(%rip), %rdi      # 0x97b0
pushq $0x2c
popq %rsi
pushq $0x1
popq %rdx
callq 0x3670
jmp 0x6650