// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rdi, %r15
leaq 0x6046(%rip), %rbx      # 0xc7e0
movq (%rbx), %rdi
callq 0x34b0
leaq 0x600f(%rip), %r14      # 0xc7b8
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 0x6a11
movq $0x0, (%r14)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x67e6
callq 0x3210
movq %r15, %rdi
callq 0x5a14
movl %eax, %ebp
testb $0x1, %bpl
jne 0x6a06
movl $0x80, %edi
callq 0x3430
testq %rax, %rax
je 0x6f86
movq %rax, %r14
leaq 0x5f81(%rip), %r12      # 0xc798
movq (%r12), %rdi
movq %rax, %rsi
callq 0x5bce
movq %rax, (%r12)
leaq 0x5f72(%rip), %r12      # 0xc7a0
movq (%r12), %rdi
movq %r14, %rsi
callq 0x5c10
movq %rax, (%r12)
leaq 0x5f63(%rip), %r12      # 0xc7a8
movq (%r12), %rdi
movq %r14, %rsi
callq 0x5c10
movq %rax, (%r12)
movq %r13, 0x10(%r14)
movq %r15, (%r14)
xorl %eax, %eax
movl %eax, 0x20(%r14)
movl %eax, 0x7c(%r14)
movq (%rbx), %rdi
callq 0x33f0
leaq 0x5b73(%rip), %rax      # 0xc3e8
movl (%rax), %eax
movl %eax, 0x34(%r14)
shrl %ebp
andl $0x1, %ebp
movl %ebp, 0x78(%r14)
movq (%r14), %rdi
leaq 0x5dc2(%rip), %rax      # 0xc650
movq (%rax), %rdx
leaq 0x30(%rsp), %rcx
movq %rdx, %rsi
callq 0x4081
testq %rax, %rax
je 0x68c6
cmpq $0x3, 0x30(%rsp)
jb 0x68be
testb $0x2, (%rax)
je 0x68be
testb $0x3, 0x10(%rax)
jne 0x68be
movl $0x0, 0x34(%r14)
movq %rax, %rdi
callq 0x3210
movq (%r14), %rdi
movq 0x10(%r14), %rax
movl 0x40(%rax), %eax
movl %eax, 0x74(%r14)
leaq 0x5e05(%rip), %rax      # 0xc6e0
movq (%rax), %rsi
leaq 0x30(%rsp), %rcx
movl $0x6, %edx
callq 0x4081
testq %rax, %rax
je 0x6910
cmpq $0x0, 0x30(%rsp)
je 0x6908
movl (%rax), %ecx
leal 0x1(%rcx), %edx
cmpl $0x8, %edx
ja 0x6908
movl %ecx, 0x74(%r14)
movq %rax, %rdi
callq 0x3210
movq (%r14), %rdi
callq 0x5a14
shrl %eax
andl $0x1, %eax
movl %eax, 0x78(%r14)
movq (%rbx), %rdi
movq (%r14), %rsi
leaq 0x70(%rsp), %r12
movq %r12, %rdx
callq 0x35b0
movl 0x10(%r12), %eax
movl %eax, 0x70(%r14)
movq $0x0, 0x40(%r14)
movq 0x50(%r12), %rax
movq %rax, 0x18(%r14)
movq (%r14), %rdi
leaq 0x5d00(%rip), %rax      # 0xc658
movq (%rax), %rsi
leaq 0x30(%rsp), %rcx
movl $0x6, %edx
callq 0x4081
testq %rax, %rax
je 0x698c
cmpq $0x2, 0x30(%rsp)
jne 0x6984
movl (%rax), %ecx
movl %ecx, 0x38(%r14)
movl 0x8(%rax), %ecx
movl %ecx, 0x40(%r14)
movq %rax, %rdi
callq 0x3210
movq (%r14), %rdi
leaq 0x5cca(%rip), %rax      # 0xc660
movq (%rax), %rsi
leaq 0x30(%rsp), %rcx
movl $0x6, %edx
callq 0x4081
testq %rax, %rax
je 0x69ca
cmpq $0x2, 0x30(%rsp)
jne 0x69c2
movl (%rax), %ecx
movl %ecx, 0x3c(%r14)
movl 0x8(%rax), %ecx
movl %ecx, 0x44(%r14)
movq %rax, %rdi
callq 0x3210
movq %r13, 0x38(%rsp)
movq %r14, %rdi
callq 0x6f8d
movq %rax, %r13
movl 0x78(%rsp), %eax
movl 0x48(%r14), %ecx
cmpl %ecx, %eax
jl 0x69f0
movl 0x7c(%rsp), %edx
cmpl 0x4c(%r14), %edx
jge 0x6a1e
movl %ecx, 0x2c(%r14)
movl 0x4c(%r14), %eax
movl %eax, 0x30(%r14)
movq %r14, %rdi
callq 0x3bc8
jmp 0x6a26
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x35f0
movq (%rbx), %rdi
callq 0x33f0
jmp 0x6f74
movl %eax, 0x2c(%r14)
movl %edx, 0x30(%r14)
cmpl $0x2, 0xcc(%rsp)
je 0x6ad4
andl $0x1, %r13d
jne 0x6ad4
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 0x5c(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rax, (%rsp)
leaq 0x68(%rsp), %rcx
leaq 0x64(%rsp), %r13
leaq 0x44(%rsp), %r9
movq %rcx, %rdx
movq %r13, %r8
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
leaq 0x44(%rsp), %rcx
imull (%rcx), %eax
cltd
idivl %r12d
leaq 0x70(%rsp), %r12
movl %eax, 0x28(%r14)
movq %r14, %rdi
callq 0x3bc8
jmp 0x6ae4
movl 0x70(%rsp), %eax
movl %eax, 0x24(%r14)
movl 0x74(%rsp), %eax
movl %eax, 0x28(%r14)
movq %r15, 0x48(%rsp)
cmpl $0x2, 0xcc(%rsp)
jne 0x6af7
incl 0x20(%r14)
movl 0x70(%r14), %esi
addl %esi, 0x24(%r14)
addl %esi, 0x28(%r14)
negl %esi
movq %r14, %rdi
callq 0x3c2a
movl 0x34(%r14), %esi
movq %r14, %rdi
callq 0x3c2a
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)
movl $0x1, %ecx
movl %ecx, 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)
xorl %r12d, %r12d
movl %r12d, 0x10(%rsp)
movl %ebp, 0x8(%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 0x57dd(%rip), %r13      # 0xc3d4
movl (%r13), %edx
movq 0x8(%r14), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r12d, 0x8(%rsp)
movq %rbx, %r15
movl $0x1, %ebx
movl %ebx, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x3270
movq (%r15), %rdi
movl (%r13), %edx
orl $0x2, %edx
movq 0x8(%r14), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r12d, 0x8(%rsp)
movl %ebx, (%rsp)
movl $0x1, %ebx
xorl %esi, %esi
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x3270
movq (%r15), %rdi
leaq 0x5b1c(%rip), %rax      # 0xc780
movl (%r13), %edx
orl (%rax), %edx
movq %rax, %rbp
movq 0x8(%r14), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r12d, 0x8(%rsp)
movl %ebx, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x3270
movq (%r15), %rdi
movl (%rbp), %edx
orl (%r13), %edx
orl $0x2, %edx
movq 0x8(%r14), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r12d, 0x8(%rsp)
movl %ebx, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x3270
movq (%r15), %rdi
leaq 0x570c(%rip), %rbp      # 0xc3d8
movl (%rbp), %edx
orl (%r13), %edx
movq 0x8(%r14), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r12d, 0x8(%rsp)
movl %ebx, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x3270
movq (%r15), %rdi
movl (%r13), %edx
orl (%rbp), %edx
orl $0x2, %edx
movq 0x8(%r14), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r12d, 0x8(%rsp)
movl %ebx, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x3270
movl (%r13), %edx
leaq 0x5a4d(%rip), %rax      # 0xc780
orl (%rax), %edx
movq (%r15), %rdi
orl (%rbp), %edx
movq 0x8(%r14), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r12d, 0x8(%rsp)
movl %ebx, (%rsp)
xorl %esi, %esi
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x3270
movq (%r15), %rdi
leaq 0x5a17(%rip), %rax      # 0xc780
movl (%rax), %edx
orl (%r13), %edx
orl (%rbp), %edx
orl $0x2, %edx
movq 0x8(%r14), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
movl %r12d, 0x8(%rsp)
movl %ebx, (%rsp)
movq %r15, %rbx
xorl %esi, %esi
xorl %r8d, %r8d
movl $0xc, %r9d
callq 0x3270
leaq 0x5a6d(%rip), %rax      # 0xc810
cmpl %r12d, (%rax)
je 0x6dc0
movq (%rbx), %rdi
movq (%r14), %rsi
movl $0x1, %edx
callq 0x36b0
movq %r14, %rdi
callq 0x4004
callq 0x3030
testq %rax, %rax
movq 0x48(%rsp), %rsi
je 0x6f20
movq %rax, %r12
leaq 0x59b3(%rip), %rax      # 0xc790
movq (%rax), %r13
movq (%rbx), %rdi
movq %r12, %rdx
callq 0x3590
testq %r13, %r13
je 0x6f05
movq 0x8(%r13), %r15
movq (%r15), %rsi
testq %rsi, %rsi
je 0x6e1a
movq (%r12), %rdi
testq %rdi, %rdi
je 0x6efc
callq 0x3310
testl %eax, %eax
jne 0x6efc
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x6e3e
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x6efc
callq 0x3310
testl %eax, %eax
jne 0x6efc
movl 0x10(%r15), %eax
testb $0x4, %al
je 0x6e53
movl 0x58(%r14), %ecx
imull 0x1c(%r15), %ecx
movl %ecx, 0x2c(%r14)
testb $0x8, %al
je 0x6e64
movl 0x5c(%r14), %ecx
imull 0x20(%r15), %ecx
movl %ecx, 0x30(%r14)
testb $0x1, %al
je 0x6e9e
movl 0x14(%r15), %ecx
testb $0x10, %al
jne 0x6e76
addl 0x34(%r14), %ecx
jmp 0x6e9a
movq (%rbx), %rdx
movq 0xe8(%rdx), %rdx
movq 0x38(%rsp), %rsi
movslq (%rsi), %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 0x6ed8
movl 0x18(%r15), %ecx
testb $0x20, %al
jne 0x6eb0
addl 0x34(%r14), %ecx
jmp 0x6ed4
movq (%rbx), %rax
movq 0xe8(%rax), %rax
movq 0x38(%rsp), %rdx
movslq (%rdx), %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 0x73c5
cmpl $0x0, 0x24(%r15)
je 0x6eef
movl $0x1, 0x78(%r14)
movl 0x28(%r15), %eax
cmpl $-0x2, %eax
je 0x6efc
movl %eax, 0x74(%r14)
movq (%r13), %r13
jmp 0x6deb
movq (%r12), %rdi
callq 0x3210
movq 0x8(%r12), %rdi
callq 0x3210
movq %r12, %rdi
callq 0x3210
movq %r14, %rdi
callq 0x56cb
movq 0x10(%r14), %rdi
callq 0x57ec
movq 0x10(%r14), %rdi
callq 0x588d
movl 0x74(%r14), %eax
cmpl $-0x1, %eax
je 0x6f4d
movq 0x38(%rsp), %rcx
cmpl 0x40(%rcx), %eax
jne 0x6f5f
movq %r14, %rdi
callq 0x3a87
movq %r14, %rdi
callq 0x3ae2
jmp 0x6f6c
movq %r14, %rdi
movl $0x3, %esi
callq 0x3a3e
movq %r14, %rdi
callq 0x59d6
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x388b
jmp 0x6f74