// File: /workspace/github_c_makefile_star2_O3/zenlinux[P]cwm/client.c
// Function: client_new
struct client_ctx *
client_new(Window win, struct screen_ctx *sc, int mapped)
{
	struct client_ctx	*cc;
	XWindowAttributes	 wattr;
	XWMHints		*wmhints;
	int			 state;

	if (win == None)
		return (NULL);

	cc = xcalloc(1, sizeof(*cc));

	XGrabServer(X_Dpy);

	cc->state = mapped ? NormalState : IconicState;
	cc->sc = sc;
	cc->win = win;
	cc->size = XAllocSizeHints();

	client_getsizehints(cc);

	TAILQ_INIT(&cc->nameq);
	client_setname(cc);

	conf_client(cc);

	/* Saved pointer position */
	cc->ptr.x = -1;
	cc->ptr.y = -1;

	XGetWindowAttributes(X_Dpy, cc->win, &wattr);
	cc->geom.x = wattr.x;
	cc->geom.y = wattr.y;
	cc->geom.w = wattr.width;
	cc->geom.h = wattr.height;
	cc->cmap = wattr.colormap;

	if (wattr.map_state != IsViewable) {
		client_placecalc(cc);
		if ((wmhints = XGetWMHints(X_Dpy, cc->win)) != NULL) {
			if (wmhints->flags & StateHint)
				xu_setstate(cc, wmhints->initial_state);

			XFree(wmhints);
		}
		client_move(cc);
	}
	client_draw_border(cc);

	if (xu_getstate(cc, &state) < 0)
		state = NormalState;

	XSelectInput(X_Dpy, cc->win, ColormapChangeMask | EnterWindowMask |
	    PropertyChangeMask | KeyReleaseMask);

	XAddToSaveSet(X_Dpy, cc->win);

	client_transient(cc);

	/* Notify client of its configuration. */
	xu_configure(cc);

	(state == IconicState) ? client_hide(cc) : client_unhide(cc);
	xu_setstate(cc, cc->state);

	XSync(X_Dpy, False);
	XUngrabServer(X_Dpy);

	TAILQ_INSERT_TAIL(&sc->mruq, cc, mru_entry);
	TAILQ_INSERT_TAIL(&Clientq, cc, entry);

	xu_ewmh_net_client_list(sc);

	client_gethints(cc);
	client_update(cc);

	if (mapped)
		group_autogroup(cc);

	return (cc);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
testq %rdi, %rdi
je 0x6330
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x108, %esi            # imm = 0x108
callq 0x6198
movq %rax, %rbx
leaq 0x10616(%rip), %rbp     # 0x16848
movq (%rbp), %rdi
callq 0x5120
xorl %eax, %eax
testl %r12d, %r12d
sete %al
leal 0x1(,%rax,2), %eax
movl %eax, 0xac(%rbx)
movq %r14, 0x30(%rbx)
movq %r15, 0x38(%rbx)
callq 0x5750
movq %rax, 0x40(%rbx)
movq %rbx, %rdi
callq 0x6690
leaq 0xc0(%rbx), %rax
movq $0x0, 0xc0(%rbx)
movq %rax, 0xc8(%rbx)
movq %rbx, %rdi
callq 0x6799
movq %rbx, %rdi
callq 0x9a22
movq $-0x1, 0x9c(%rbx)
movq (%rbp), %rdi
movq 0x38(%rbx), %rsi
leaq 0x20(%rsp), %r15
movq %r15, %rdx
callq 0x5710
movdqa (%r15), %xmm0
movdqu %xmm0, 0x54(%rbx)
movq 0x50(%r15), %rax
movq %rax, 0x48(%rbx)
cmpl $0x2, 0x5c(%r15)
je 0x64c9
movq 0x30(%rbx), %r15
movq 0x40(%rbx), %rax
testb $0x5, (%rax)
je 0x6337
movl 0x50(%rbx), %edx
addl %edx, %edx
negl %edx
pshufd $0xff, %xmm0, %xmm1     # xmm1 = xmm0[3,3,3,3]
movd %xmm1, %esi
movl %edx, %ecx
subl %esi, %ecx
addl 0xb0(%r15), %ecx
movl 0x8(%rax), %esi
testl %esi, %esi
jle 0x6318
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movd %xmm0, %edi
subl %edi, %edx
addl 0xac(%r15), %edx
cmpl %edx, %esi
cmovll %esi, %edx
movl %edx, 0x54(%rbx)
movl 0xc(%rax), %eax
testl %eax, %eax
jle 0x6480
cmpl %ecx, %eax
cmovll %eax, %ecx
movl %ecx, 0x58(%rbx)
jmp 0x6480
xorl %ebx, %ebx
jmp 0x667b
movl %r12d, (%rsp)
movq 0x18(%r15), %rdi
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %r12, %rsi
movq %r13, %rdx
callq 0x8854
movl (%r12), %esi
movl (%r13), %edx
movq %r15, %rdi
callq 0x6055
testq %rax, %rax
je 0x6381
movswl 0x4(%rax), %edx
movswl 0x6(%rax), %ecx
movswl 0x8(%rax), %r8d
addl %edx, %r8d
movswl 0xa(%rax), %eax
addl %ecx, %eax
jmp 0x6393
movl 0xac(%r15), %r8d
movl 0xb0(%r15), %eax
xorl %edx, %edx
xorl %ecx, %ecx
movl 0x50(%rbx), %r11d
movl 0x5c(%rbx), %r10d
movl 0x8(%rsp), %esi
cmpl %ecx, %esi
cmovlel %ecx, %esi
movl 0x60(%rbx), %r12d
movl %r12d, %edi
shrl $0x1f, %edi
addl %r12d, %edi
sarl %edi
subl %edi, %esi
cmpl %ecx, %esi
cmovlel %ecx, %esi
addl %r11d, %r11d
movl %r8d, %r9d
subl %r10d, %r9d
subl %r11d, %r9d
movl %eax, %edi
subl %r12d, %edi
subl %r11d, %edi
cmpl %edx, %r9d
jge 0x63ed
movl 0xcc(%r15), %r9d
addl %r9d, %edx
movl %edx, 0x54(%rbx)
subl %r9d, %r8d
movl %r8d, 0x5c(%rbx)
movl (%rsp), %r12d
jmp 0x6441
movl %r10d, %r8d
shrl $0x1f, %r8d
addl %r10d, %r8d
sarl %r8d
movl 0x10(%rsp), %r10d
cmpl %edx, %r10d
cmovlel %edx, %r10d
subl %r8d, %r10d
cmpl %edx, %r10d
cmovlel %edx, %r10d
cmpl %r9d, %r10d
cmovgel %r9d, %r10d
addl 0xcc(%r15), %edx
cmpl %edx, %r10d
cmovgl %r10d, %edx
movl %edx, 0x54(%rbx)
movl 0xd0(%r15), %r8d
subl %r8d, %r9d
cmpl %r9d, %edx
movl (%rsp), %r12d
jle 0x6441
subl %r8d, %edx
movl %edx, 0x54(%rbx)
cmpl %ecx, %edi
jge 0x6458
movl 0xc4(%r15), %edx
addl %edx, %ecx
movl %ecx, 0x58(%rbx)
subl %edx, %eax
movl %eax, 0x60(%rbx)
jmp 0x6480
cmpl %edi, %esi
cmovgel %edi, %esi
addl 0xc4(%r15), %ecx
cmpl %ecx, %esi
cmovgl %esi, %ecx
movl %ecx, 0x58(%rbx)
movl 0xc8(%r15), %eax
subl %eax, %edi
cmpl %edi, %ecx
jle 0x6480
subl %eax, %ecx
jmp 0x6328
movq (%rbp), %rdi
movq 0x38(%rbx), %rsi
callq 0x54f0
testq %rax, %rax
je 0x64ae
movq %rax, %r15
testb $0x2, (%rax)
je 0x64a6
movl 0xc(%r15), %esi
movq %rbx, %rdi
callq 0x8c69
movq %r15, %rdi
callq 0x5060
movq (%rbp), %rdi
movq 0x38(%rbx), %rsi
movl 0x54(%rbx), %edx
movl 0x58(%rbx), %ecx
callq 0x5070
movq %rbx, %rdi
callq 0x89fb
movq %rbx, %rdi
callq 0x6936
leaq 0x4(%rsp), %rsi
movq %rbx, %rdi
callq 0x8c1c
testl %eax, %eax
jns 0x64ea
movl $0x1, 0x4(%rsp)
movq (%rbp), %rdi
movq 0x38(%rbx), %rsi
movl $0xc00012, %edx         # imm = 0xC00012
callq 0x5560
movq (%rbp), %rdi
movq 0x38(%rbx), %rsi
callq 0x53b0
movq %rbx, %rdi
callq 0x69a3
movq %rbx, %rdi
callq 0x89fb
cmpl $0x3, 0x4(%rsp)
jne 0x652a
movq %rbx, %rdi
callq 0x6a0f
jmp 0x6532
movq %rbx, %rdi
callq 0x6a65
movl 0xac(%rbx), %esi
movq %rbx, %rdi
callq 0x8c69
movq (%rbp), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x55b0
movq (%rbp), %rdi
callq 0x5420
movq %rbx, %rax
addq $0x20, %rax
movq %r15, 0x20(%rbx)
movq 0xe0(%r14), %rcx
movq %rcx, 0x28(%rbx)
movq %rbx, (%rcx)
movq %rax, 0xe0(%r14)
movq %r15, (%rbx)
leaq 0xdeff(%rip), %rax      # 0x14480
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rbx)
movq %rbx, (%rcx)
movq %rbx, 0x8(%rax)
movq %r14, %rdi
callq 0x8f29
movq (%rbp), %rdi
movq 0x38(%rbx), %rsi
leaq 0x10(%rsp), %rdx
callq 0x53d0
testl %eax, %eax
je 0x65d0
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x65bf
movq %rax, 0x100(%rbx)
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x65d0
movq %rax, 0xf8(%rbx)
movq 0x38(%rbx), %rdi
leaq 0xdeb5(%rip), %r14      # 0x14490
movq 0x48(%r14), %rsi
leaq 0x8(%rsp), %r8
movl $0x4, %edx
movl $0x3, %ecx
callq 0x8ac3
cmpl $0x3, %eax
jne 0x660f
movq 0x8(%rsp), %rax
testb $0x2, (%rax)
je 0x660f
testb $0x3, 0x10(%rax)
jne 0x660f
movl $0x0, 0x50(%rbx)
movq 0x38(%rbx), %rdi
movq 0x38(%r14), %rsi
leaq 0x10(%rsp), %r8
movl $0x4, %edx
movl $0x14, %ecx
callq 0x8ac3
testl %eax, %eax
jle 0x666e
movq 0x10(%rsp), %rdi
movq 0x18(%r14), %rcx
movq 0x28(%r14), %rdx
movl %eax, %eax
xorl %esi, %esi
movq (%rdi,%rsi,8), %r9
movl $0x1, %r8d
cmpq %rcx, %r9
je 0x665a
movl $0x2, %r8d
cmpq %rdx, %r9
jne 0x6661
orl %r8d, 0xa4(%rbx)
incq %rsi
cmpq %rsi, %rax
jne 0x6640
callq 0x5060
testl %r12d, %r12d
je 0x667b
movq %rbx, %rdi
callq 0xabcd
movq %rbx, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq