// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x659a
movq $0x0, -0x8(%rbp)
jmp 0x689e
movl $0x1, %edi
movl $0x108, %esi            # imm = 0x108
callq 0x6460
movq %rax, -0x28(%rbp)
leaq 0x161f4(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
callq 0x5120
movl -0x1c(%rbp), %edx
movl $0x3, %ecx
movl $0x1, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0xac(%rax)
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
callq 0x5750
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x28(%rbp), %rdi
callq 0x68b0
movq -0x28(%rbp), %rax
movq $0x0, 0xc0(%rax)
movq -0x28(%rbp), %rcx
addq $0xc0, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0xc8(%rax)
movq -0x28(%rbp), %rdi
callq 0x6b60
movq -0x28(%rbp), %rdi
callq 0xc770
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x9c(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0xa0(%rax) # imm = 0xFFFFFFFF
leaq 0x16144(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x5710
movl -0xb0(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x54(%rax)
movl -0xac(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x58(%rax)
movl -0xa8(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x5c(%rax)
movl -0xa4(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x60(%rax)
movq -0x60(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x48(%rax)
cmpl $0x2, -0x54(%rbp)
je 0x672a
movq -0x28(%rbp), %rdi
callq 0x6de0
leaq 0x160d7(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x54f0
movq %rax, -0xb8(%rbp)
cmpq $0x0, %rax
je 0x6721
movq -0xb8(%rbp), %rax
movq (%rax), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x6715
movq -0x28(%rbp), %rdi
movq -0xb8(%rbp), %rax
movl 0xc(%rax), %esi
callq 0xb1c0
movq -0xb8(%rbp), %rdi
callq 0x5060
movq -0x28(%rbp), %rdi
callq 0x71d0
movq -0x28(%rbp), %rdi
callq 0x7210
movq -0x28(%rbp), %rdi
leaq -0xbc(%rbp), %rsi
callq 0xb140
cmpl $0x0, %eax
jge 0x6752
movl $0x1, -0xbc(%rbp)
leaq 0x1604f(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rsi
movl $0xc00012, %edx         # imm = 0xC00012
callq 0x5560
leaq 0x16033(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x53b0
movq -0x28(%rbp), %rdi
callq 0x72d0
movq -0x28(%rbp), %rdi
callq 0xae30
cmpl $0x3, -0xbc(%rbp)
jne 0x67ab
movq -0x28(%rbp), %rdi
callq 0x7370
jmp 0x67b4
movq -0x28(%rbp), %rdi
callq 0x73f0
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0xac(%rax), %esi
callq 0xb1c0
leaq 0x15fda(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
xorl %esi, %esi
callq 0x55b0
leaq 0x15fc9(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
callq 0x5420
movq -0x28(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x18(%rbp), %rax
movq 0xe0(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0xe0(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
addq $0x20, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0xe0(%rax)
jmp 0x682d
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
leaq 0x12c41(%rip), %rax     # 0x19480
movq 0x8(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rcx
leaq 0x12c2a(%rip), %rax     # 0x19480
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
leaq 0x12c18(%rip), %rax     # 0x19480
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0xb650
movq -0x28(%rbp), %rdi
callq 0x7460
movq -0x28(%rbp), %rdi
callq 0x7530
cmpl $0x0, -0x1c(%rbp)
je 0x6896
movq -0x28(%rbp), %rdi
callq 0xe780
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
nopl (%rax,%rax)