// File: /workspace/github_c_makefile_star2_O0/9wm[P]9wm/9wm.c
// Function: initscreen
void
initscreen(ScreenInfo * s, int i)
{
	char *ds, *colon, *dot1;
	unsigned long mask;
	XGCValues gv;
	XSetWindowAttributes attr;

	s->num = i;
	s->root = RootWindow(dpy, i);
	s->def_cmap = DefaultColormap(dpy, i);
	s->min_cmaps = MinCmapsOfScreen(ScreenOfDisplay(dpy, i));

	ds = DisplayString(dpy);
	colon = strrchr(ds, ':');
	if (colon && num_screens > 1) {
		strcpy(s->display, "DISPLAY=");
		strcat(s->display, ds);
		colon = s->display + 8 + (colon - ds);	/* use version in buf */
		dot1 = strchr(colon, '.');	/* first period after colon */
		if (!dot1)
			dot1 = colon + strlen(colon);	/* if not there, append */
		sprintf(dot1, ".%d", i);
	} else
		s->display[0] = '\0';

	s->black = BlackPixel(dpy, i);
	s->white = WhitePixel(dpy, i);
	/*
	 * Setup color for border
	 */
	s->active = s->black;
	s->inactive = s->white;
#ifdef COLOR
	if (activestr != NULL || inactivestr != NULL) {
		Colormap cmap = DefaultColormap(dpy,s->num);
		if (cmap != 0) {
			unsigned long active;
			unsigned long inactive;
			Status sa = getcolor(cmap, &active, activestr);
			Status si = getcolor(cmap, &inactive, inactivestr);
			if (sa != 0)
				s->active = active;
			if (si != 0)
				s->inactive = inactive;
		}
	}
#endif
	gv.foreground = s->black ^ s->white;
	gv.background = s->white;
	gv.function = GXxor;
	gv.line_width = 0;
	gv.subwindow_mode = IncludeInferiors;
	mask = GCForeground | GCBackground | GCFunction | GCLineWidth | GCSubwindowMode;
	if (font != 0) {
		gv.font = font->fid;
		mask |= GCFont;
	}
	s->gc = XCreateGC(dpy, s->root, mask, &gv);

	initcurs(s);

	attr.cursor = s->arrow;
	attr.event_mask = SubstructureRedirectMask
	    | SubstructureNotifyMask | ColormapChangeMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
	mask = CWCursor | CWEventMask;
	XChangeWindowAttributes(dpy, s->root, mask, &attr);
	XSync(dpy, False);

	s->menuwin = XCreateSimpleWindow(dpy, s->root, 0, 0, 1, 1, 1, s->black, s->white);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq 0x9926(%rip), %rax      # 0xc978
movq 0xe8(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x9901(%rip), %rax      # 0xc978
movq 0xe8(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x50(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq 0x98dc(%rip), %rax      # 0xc978
movq 0xe8(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x6c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x48(%rax)
movq 0x98b9(%rip), %rax      # 0xc978
movq 0xd8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl $0x3a, %esi
callq 0x21c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x318c
cmpl $0x1, 0x991a(%rip)      # 0xca08
jle 0x318c
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
leaq 0x625f(%rip), %rsi      # 0x9362
callq 0x20b0
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
movq -0x18(%rbp), %rsi
callq 0x2500
movq -0x8(%rbp), %rax
addq $0x78, %rax
addq $0x8, %rax
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rdx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2e, %esi
callq 0x2170
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x3175
movq -0x20(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2150
movq %rax, %rcx
movq -0x128(%rbp), %rax
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0x61e8(%rip), %rsi      # 0x936b
movb $0x0, %al
callq 0x2510
jmp 0x3194
movq -0x8(%rbp), %rax
movb $0x0, 0x78(%rax)
movq 0x97dd(%rip), %rax      # 0xc978
movq 0xe8(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq 0x97b8(%rip), %rax      # 0xc978
movq 0xe8(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x58(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x8(%rbp), %rcx
xorq 0x30(%rcx), %rax
movq %rax, -0xa0(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x98(%rbp)
movl $0x6, -0xb0(%rbp)
movl $0x0, -0x90(%rbp)
movl $0x1, -0x50(%rbp)
movq $0x801d, -0x30(%rbp)    # imm = 0x801D
cmpq $0x0, 0x9701(%rip)      # 0xc950
je 0x326e
movq 0x96f8(%rip), %rax      # 0xc950
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x30(%rbp), %rax
orq $0x4000, %rax           # imm = 0x4000
movq %rax, -0x30(%rbp)
movq 0x9703(%rip), %rdi      # 0xc978
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x30(%rbp), %rdx
leaq -0xb0(%rbp), %rcx
callq 0x2410
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rdi
callq 0x8ae0
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0xb8(%rbp)
movq $0xd8000c, -0xd8(%rbp) # imm = 0xD8000C
movq $0x4800, -0x30(%rbp)    # imm = 0x4800
movq 0x96ae(%rip), %rdi      # 0xc978
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x30(%rbp), %rdx
leaq -0x120(%rbp), %rcx
callq 0x21f0
movq 0x968f(%rip), %rdi      # 0xc978
xorl %esi, %esi
callq 0x23a0
movq 0x9681(%rip), %rdi      # 0xc978
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %r10
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
xorl %ecx, %ecx
movl $0x1, %r9d
movl %ecx, %edx
movl %r9d, %r8d
movl $0x1, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x2440
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
nopw %cs:(%rax,%rax)