// File: /workspace/github_c_makefile_star2_O0/zenlinux[P]cwm/cwm.c
// Function: x_setupscreen
static void
x_setupscreen(struct screen_ctx *sc, u_int which)
{
	Window			*wins, w0, w1;
	XWindowAttributes	 winattr;
	XSetWindowAttributes	 rootattr;
	u_int			 nwins, i;

	sc->which = which;
	sc->rootwin = RootWindow(X_Dpy, sc->which);

	xu_ewmh_net_supported(sc);
	xu_ewmh_net_supported_wm_check(sc);

	conf_gap(&Conf, sc);

	screen_update_geometry(sc);

	conf_color(&Conf, sc);

	group_init(sc);
	conf_font(&Conf, sc);

	TAILQ_INIT(&sc->mruq);

	/* Initialize menu window. */
	menu_init(sc);

	rootattr.cursor = Cursor_normal;
	rootattr.event_mask = CHILDMASK|PropertyChangeMask|EnterWindowMask|
	    LeaveWindowMask|ColormapChangeMask|BUTTONMASK;

	XChangeWindowAttributes(X_Dpy, sc->rootwin,
	    CWEventMask|CWCursor, &rootattr);

	/* Deal with existing clients. */
	XQueryTree(X_Dpy, sc->rootwin, &w0, &w1, &wins, &nwins);

	for (i = 0; i < nwins; i++) {
		XGetWindowAttributes(X_Dpy, wins[i], &winattr);
		if (winattr.override_redirect ||
		    winattr.map_state != IsViewable)
			continue;
		(void)client_new(wins[i], sc, winattr.map_state != IsUnmapped);
	}
	XFree(wins);

	screen_updatestackingorder(sc);

	if (HasRandr)
		XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);

	XSync(X_Dpy, False);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10(%rax)
movq 0x16915(%rip), %rax     # 0x1c7a8
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x10(%rcx), %ecx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rdi
callq 0xb300
movq -0x8(%rbp), %rdi
callq 0xb3b0
movq -0x8(%rbp), %rsi
leaq 0x147ef(%rip), %rdi     # 0x1a6c0
callq 0xbbd0
movq -0x8(%rbp), %rdi
callq 0x6250
movq -0x8(%rbp), %rsi
leaq 0x147d6(%rip), %rdi     # 0x1a6c0
callq 0xbc50
movq -0x8(%rbp), %rdi
callq 0xd710
movq -0x8(%rbp), %rsi
leaq 0x147bd(%rip), %rdi     # 0x1a6c0
callq 0xbc00
movq -0x8(%rbp), %rax
movq $0x0, 0xd8(%rax)
movq -0x8(%rbp), %rcx
addq $0xd8, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xe0(%rax)
movq -0x8(%rbp), %rdi
callq 0x8950
movq 0x16883(%rip), %rax     # 0x1c7c0
movq %rax, -0xb8(%rbp)
movq $0xd8003c, -0xd8(%rbp) # imm = 0xD8003C
movq 0x16852(%rip), %rdi     # 0x1c7a8
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movl $0x4800, %edx           # imm = 0x4800
leaq -0x120(%rbp), %rcx
callq 0x58a0
movq 0x16832(%rip), %rdi     # 0x1c7a8
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x20(%rbp), %rdx
leaq -0x28(%rbp), %rcx
leaq -0x18(%rbp), %r8
leaq -0x124(%rbp), %r9
callq 0x5850
movl $0x0, -0x128(%rbp)
movl -0x128(%rbp), %eax
cmpl -0x124(%rbp), %eax
jae 0x6011
movq 0x167f3(%rip), %rdi     # 0x1c7a8
movq -0x18(%rbp), %rax
movl -0x128(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x5710
cmpl $0x0, -0x38(%rbp)
jne 0x5fdb
cmpl $0x2, -0x54(%rbp)
je 0x5fdd
jmp 0x6000
movq -0x18(%rbp), %rax
movl -0x128(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
movq -0x8(%rbp), %rsi
cmpl $0x0, -0x54(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %edx
callq 0x6570
movl -0x128(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x5fa0
movq -0x18(%rbp), %rdi
callq 0x5060
movq -0x8(%rbp), %rdi
callq 0x60c0
cmpl $0x0, 0x167ae(%rip)     # 0x1c7d8
je 0x6045
movq 0x16775(%rip), %rdi     # 0x1c7a8
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movl $0x1, %edx
callq 0x52e0
movq 0x1675c(%rip), %rdi     # 0x1c7a8
xorl %esi, %esi
callq 0x55b0
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nopl (%rax)