// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, (%rdi)
movq 0x87c0(%rip), %r14      # 0xb988
movq 0xe8(%r14), %rax
movslq %esi, %r13
shlq $0x7, %r13
movq 0x10(%rax,%r13), %rcx
movq %rcx, 0x8(%rdi)
movq 0x50(%rax,%r13), %rcx
movq %rcx, 0x18(%rdi)
movl 0x6c(%rax,%r13), %eax
movl %eax, 0x48(%rdi)
movq 0xd8(%r14), %r15
movq %r15, %rdi
movl $0x3a, %esi
callq 0x21b0
leaq 0x78(%rbx), %rdi
testq %rax, %rax
je 0x3279
cmpl $0x2, 0x8804(%rip)      # 0xba18
jl 0x3279
movq %rax, %r12
movabsq $0x3d59414c50534944, %rax # imm = 0x3D59414C50534944
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
movq %r15, %rsi
callq 0x2510
subq %r15, %r12
leaq (%rbx,%r12), %r14
addq $0x80, %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x2160
testq %rax, %rax
jne 0x325d
movq %r14, %rdi
callq 0x2140
addq %r14, %rax
leaq 0x4104(%rip), %rsi      # 0x7368
movq %rax, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x2520
movq 0x8711(%rip), %r14      # 0xb988
jmp 0x327c
movb $0x0, (%rdi)
movq 0xe8(%r14), %rax
movq 0x60(%rax,%r13), %rcx
movq %rcx, 0x28(%rbx)
movq 0x58(%rax,%r13), %rax
movq %rax, 0x30(%rbx)
movq %rcx, 0x38(%rbx)
movq %rax, 0x40(%rbx)
xorq %rax, %rcx
movq %rcx, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movl $0x6, 0x18(%rsp)
movl $0x0, 0x38(%rsp)
movl $0x1, 0x78(%rsp)
movq 0x8697(%rip), %rax      # 0xb960
testq %rax, %rax
je 0x32de
movq 0x8(%rax), %rax
movq %rax, 0x70(%rsp)
movl $0xc01d, %edx           # imm = 0xC01D
jmp 0x32e3
movl $0x801d, %edx           # imm = 0x801D
movq 0x8(%rbx), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %rdi
callq 0x2420
movq %rax, 0x20(%rbx)
movq %rbx, %rdi
callq 0x6a97
movq 0x68(%rbx), %rax
leaq 0x98(%rsp), %rcx
movq %rax, 0x68(%rcx)
movq $0xd8000c, 0x48(%rcx)   # imm = 0xD8000C
movq 0x8669(%rip), %rdi      # 0xb988
movq 0x8(%rbx), %rsi
movl $0x4800, %edx           # imm = 0x4800
callq 0x21e0
movq 0x8654(%rip), %rdi      # 0xb988
xorl %esi, %esi
callq 0x23b0
movq 0x8646(%rip), %rdi      # 0xb988
movq 0x8(%rbx), %rsi
movups 0x28(%rbx), %xmm0
movups %xmm0, 0x8(%rsp)
movl $0x1, (%rsp)
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x2450
movq %rax, 0x10(%rbx)
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq