// File: /workspace/github_c_makefile_star2_O3/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 0x608a(%rip), %rbx      # 0xc7e0
movq (%rbx), %rdi
callq 0x34b0
leaq 0x6053(%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 0x69b3
movq $0x0, (%r14)
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x67a2
callq 0x3210
movq %r15, %rdi
callq 0x59c8
movl %eax, %ebp
testb $0x1, %bpl
jne 0x69a8
movl $0x80, %edi
callq 0x3430
testq %rax, %rax
je 0x6f64
movq %rax, %r14
leaq 0x5fc5(%rip), %r12      # 0xc798
movq (%r12), %rdi
movq %rax, %rsi
callq 0x5b79
movq %rax, (%r12)
leaq 0x5fb6(%rip), %r12      # 0xc7a0
movq (%r12), %rdi
movq %r14, %rsi
callq 0x5bb2
movq %rax, (%r12)
leaq 0x5fa7(%rip), %r12      # 0xc7a8
movq (%r12), %rdi
movq %r14, %rsi
callq 0x5bb2
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 0x5bb7(%rip), %rax      # 0xc3e8
movl (%rax), %eax
movl %eax, 0x34(%r14)
shrl %ebp
andl $0x1, %ebp
movl %ebp, 0x78(%r14)
movq (%r14), %rdi
leaq 0x5e06(%rip), %rax      # 0xc650
movq (%rax), %rdx
leaq 0x30(%rsp), %rcx
movq %rdx, %rsi
callq 0x404d
testq %rax, %rax
je 0x6882
cmpq $0x3, 0x30(%rsp)
jb 0x687a
testb $0x2, (%rax)
je 0x687a
testb $0x3, 0x10(%rax)
jne 0x687a
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 0x5e49(%rip), %rax      # 0xc6e0
movq (%rax), %rsi
leaq 0x30(%rsp), %rcx
movl $0x6, %edx
callq 0x404d
testq %rax, %rax
je 0x68cc
cmpq $0x0, 0x30(%rsp)
je 0x68c4
movl (%rax), %ecx
leal 0x1(%rcx), %edx
cmpl $0x8, %edx
ja 0x68c4
movl %ecx, 0x74(%r14)
movq %rax, %rdi
callq 0x3210
movq (%r14), %rdi
callq 0x59c8
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 0x5d44(%rip), %rax      # 0xc658
movq (%rax), %rsi
leaq 0x30(%rsp), %rcx
movl $0x6, %edx
callq 0x404d
testq %rax, %rax
je 0x6948
cmpq $0x2, 0x30(%rsp)
jne 0x6940
movl (%rax), %ecx
movl %ecx, 0x38(%r14)
movl 0x8(%rax), %ecx
movl %ecx, 0x40(%r14)
movq %rax, %rdi
callq 0x3210
movq (%r14), %rdi
leaq 0x5d0e(%rip), %rax      # 0xc660
movq (%rax), %rsi
leaq 0x30(%rsp), %rcx
movl $0x6, %edx
callq 0x404d
testq %rax, %rax
je 0x6986
cmpq $0x2, 0x30(%rsp)
jne 0x697e
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 0x6f6b
movq %rax, %r13
movl 0x78(%rsp), %ecx
movl 0x48(%r14), %eax
cmpl %eax, %ecx
jge 0x69c0
movl 0x4c(%r14), %edx
jmp 0x69cc
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x35f0
movq (%rbx), %rdi
callq 0x33f0
jmp 0x6f52
movl 0x7c(%rsp), %esi
movl 0x4c(%r14), %edx
cmpl %edx, %esi
jge 0x69de
movl %eax, 0x2c(%r14)
movl %edx, 0x30(%r14)
movq %r14, %rdi
callq 0x3bac
jmp 0x69e6
movl %ecx, 0x2c(%r14)
movl %esi, 0x30(%r14)
movl 0xcc(%rsp), %eax
cmpl $0x2, %eax
je 0x6a9d
andl $0x1, %r13d
jne 0x6a9d
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 0x3bac
movl 0xcc(%rsp), %eax
jmp 0x6aa6
movq 0x70(%rsp), %rcx
movq %rcx, 0x24(%r14)
movq %r15, 0x48(%rsp)
cmpl $0x2, %eax
jne 0x6ab4
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 0x3bfb
movl 0x34(%r14), %esi
movq %r14, %rdi
callq 0x3bfb
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 0x580f(%rip), %r13      # 0xc3d4
movl (%r13), %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %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
pxor %xmm0, %xmm0
movdqu %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 0x5b4a(%rip), %rax      # 0xc780
movl (%r13), %edx
orl (%rax), %edx
movq %rax, %rbp
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %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
pxor %xmm0, %xmm0
movdqu %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 0x5736(%rip), %rbp      # 0xc3d8
movl (%rbp), %edx
orl (%r13), %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %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
pxor %xmm0, %xmm0
movdqu %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 0x5a73(%rip), %rax      # 0xc780
orl (%rax), %edx
movq (%r15), %rdi
orl (%rbp), %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %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 0x5a3b(%rip), %rax      # 0xc780
movl (%rax), %edx
orl (%r13), %edx
orl (%rbp), %edx
orl $0x2, %edx
movq 0x8(%r14), %rcx
pxor %xmm0, %xmm0
movdqu %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 0x5a8f(%rip), %rax      # 0xc810
cmpl %r12d, (%rax)
je 0x6d9e
movq (%rbx), %rdi
movq (%r14), %rsi
movl $0x1, %edx
callq 0x36b0
movq %r14, %rdi
callq 0x3fd0
callq 0x3030
testq %rax, %rax
movq 0x48(%rsp), %rsi
je 0x6efe
movq %rax, %r12
leaq 0x59d5(%rip), %rax      # 0xc790
movq (%rax), %r13
movq (%rbx), %rdi
movq %r12, %rdx
callq 0x3590
testq %r13, %r13
je 0x6ee3
movq 0x8(%r13), %r15
movq (%r15), %rsi
testq %rsi, %rsi
je 0x6df8
movq (%r12), %rdi
testq %rdi, %rdi
je 0x6eda
callq 0x3310
testl %eax, %eax
jne 0x6eda
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x6e1c
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x6eda
callq 0x3310
testl %eax, %eax
jne 0x6eda
movl 0x10(%r15), %eax
testb $0x4, %al
je 0x6e31
movl 0x58(%r14), %ecx
imull 0x1c(%r15), %ecx
movl %ecx, 0x2c(%r14)
testb $0x8, %al
je 0x6e42
movl 0x5c(%r14), %ecx
imull 0x20(%r15), %ecx
movl %ecx, 0x30(%r14)
testb $0x1, %al
je 0x6e7c
movl 0x14(%r15), %ecx
testb $0x10, %al
jne 0x6e54
addl 0x34(%r14), %ecx
jmp 0x6e78
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 0x6eb6
movl 0x18(%r15), %ecx
testb $0x20, %al
jne 0x6e8e
addl 0x34(%r14), %ecx
jmp 0x6eb2
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 0x738f
cmpl $0x0, 0x24(%r15)
je 0x6ecd
movl $0x1, 0x78(%r14)
movl 0x28(%r15), %eax
cmpl $-0x2, %eax
je 0x6eda
movl %eax, 0x74(%r14)
movq (%r13), %r13
jmp 0x6dc9
movq (%r12), %rdi
callq 0x3210
movq 0x8(%r12), %rdi
callq 0x3210
movq %r12, %rdi
callq 0x3210
movq %r14, %rdi
callq 0x567f
movq 0x10(%r14), %rdi
callq 0x57a0
movq 0x10(%r14), %rdi
callq 0x5841
movl 0x74(%r14), %eax
cmpl $-0x1, %eax
je 0x6f2b
movq 0x38(%rsp), %rcx
cmpl 0x40(%rcx), %eax
jne 0x6f3d
movq %r14, %rdi
callq 0x3a75
movq %r14, %rdi
callq 0x3ad0
jmp 0x6f4a
movq %r14, %rdi
movl $0x3, %esi
callq 0x3a2c
movq %r14, %rdi
callq 0x598a
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x388b
jmp 0x6f52