// File: /workspace/github_c_makefile_star2_O0/kyx0r[P]xkeyboard/xkeyboard.c
// Function: init_display
void init_display(int argc, char **argv)
{
	XColor mycolor;

	if (!getenv("DISPLAY")) {
		fprintf(stderr, "DISPLAY not set.\n");
		exit(1);
	}
	if (!(dpy = XOpenDisplay(getenv("DISPLAY")))) {
		fprintf(stderr, "Unable to open display.\n");
		exit(1);
	}
	XSetErrorHandler(handle_error);
	XFlush(dpy);
#if 0
	/* for acting as a window manager */
	XSelectInput(dpy, DefaultRootWindow(dpy),
		SubstructureRedirectMask);
#endif
	myscreen = DefaultScreen(dpy);
	screenwidth = DisplayWidth(dpy, myscreen);
	screenheight = DisplayHeight(dpy, myscreen);
	root = DefaultRootWindow(dpy);
	mybackground = BlackPixel(dpy, myscreen);
	myforeground = WhitePixel(dpy, myscreen);
	myhint.width = 16;
	myhint.height = 16;
	myhint.x = 0;
	myhint.y = screenheight - 16;
	myhint.flags = PSize | PMinSize | PMaxSize | PPosition;
	myattribs.event_mask = ButtonPressMask | VisibilityChangeMask |
		EnterWindowMask;
	myattribs.background_pixel = mybackground;
	myattribs.override_redirect = True;
	mywindow = XCreateWindow(dpy, DefaultRootWindow(dpy),
		myhint.x, myhint.y, myhint.width, myhint.height, 0,
		attribs.depth, InputOutput, attribs.visual,
		CWEventMask | CWBackPixel | CWOverrideRedirect, &myattribs);
	strcpy(tmpbuf, "xkeyboard");
	myattribs.event_mask = ButtonPressMask | VisibilityChangeMask |
		EnterWindowMask;
	XSetStandardProperties(dpy, mywindow, tmpbuf, tmpbuf, None,
	       argv, argc, &myhint);
	gcvals.foreground = mybackground;
	gcvals.background = myforeground;
	mygc = XCreateGC(dpy, mywindow, GCForeground | GCBackground,
		&gcvals);
	font_struct = XLoadQueryFont(dpy,
		"-*-*-medium-r-*-*-*-100-*-*-*-*-*-*");
	if(!font_struct)
	{
		fprintf(stderr, "Missing fonts.\n");
		exit(1);
	}
	XSetFont(dpy, mygc, font_struct->fid);
	mycolor.red = 0xFFFF;
	mycolor.green = 0xFFFF;
	mycolor.blue = 0;
	mycolor.flags = DoRed | DoGreen | DoBlue;
	XAllocColor(dpy, DefaultColormap(dpy, myscreen), &mycolor);
	gcvals.foreground = mycolor.pixel;
	mygcled = XCreateGC(dpy, mywindow, GCForeground |
		GCBackground, &gcvals);
	XSetFont(dpy, mygcled, font_struct->fid);
	mycolor.green = 0;
	XAllocColor(dpy, DefaultColormap(dpy, myscreen), &mycolor);
	gcvals.foreground = mycolor.pixel;
	mygcred = XCreateGC(dpy, mywindow, GCForeground |
		GCBackground, &gcvals);
	XSetFont(dpy, mygcred, font_struct->fid);

	gcvals.foreground = mybackground;
	XMapRaised(dpy, mywindow);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x4c52(%rip), %rdi      # 0x7158
callq 0x2040
cmpq $0x0, %rax
jne 0x2533
movq 0x6ae0(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x4c3e(%rip), %rsi      # 0x7160
movb $0x0, %al
callq 0x21a0
movl $0x1, %edi
callq 0x2360
leaq 0x4c1e(%rip), %rdi      # 0x7158
callq 0x2040
movq %rax, %rdi
callq 0x2190
movq %rax, 0x172aa(%rip)     # 0x197f8
cmpq $0x0, %rax
jne 0x2576
movq 0x6a9d(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x4c0d(%rip), %rsi      # 0x7172
movb $0x0, %al
callq 0x21a0
movl $0x1, %edi
callq 0x2360
leaq 0x423(%rip), %rdi       # 0x29a0
callq 0x21f0
movq 0x1726f(%rip), %rdi     # 0x197f8
callq 0x2300
movq 0x17263(%rip), %rax     # 0x197f8
movl 0xe0(%rax), %eax
movl %eax, 0x1725f(%rip)     # 0x19800
movq 0x17250(%rip), %rax     # 0x197f8
movq 0xe8(%rax), %rax
movslq 0x1724a(%rip), %rcx     # 0x19800
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, 0x1723e(%rip)     # 0x19804
movq 0x1722b(%rip), %rax     # 0x197f8
movq 0xe8(%rax), %rax
movslq 0x17225(%rip), %rcx     # 0x19800
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, 0x1721d(%rip)     # 0x19808
movq 0x17206(%rip), %rax     # 0x197f8
movq 0xe8(%rax), %rax
movq 0x171f8(%rip), %rcx     # 0x197f8
movslq 0xe0(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, 0x171f7(%rip)     # 0x19810
movq 0x171d8(%rip), %rax     # 0x197f8
movq 0xe8(%rax), %rax
movslq 0x171d2(%rip), %rcx     # 0x19800
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %rax
movq %rax, 0x171d8(%rip)     # 0x19818
movq 0x171b1(%rip), %rax     # 0x197f8
movq 0xe8(%rax), %rax
movslq 0x171ab(%rip), %rcx     # 0x19800
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x58(%rax), %rax
movq %rax, 0x171b9(%rip)     # 0x19820
movl $0x10, 0x171c7(%rip)    # 0x19838
movl $0x10, 0x171c1(%rip)    # 0x1983c
movl $0x0, 0x171ab(%rip)     # 0x19830
movl 0x1717d(%rip), %eax     # 0x19808
subl $0x10, %eax
movl %eax, 0x171a0(%rip)     # 0x19834
movq $0x3c, 0x17189(%rip) # 0x19828
movq $0x10014, 0x17216(%rip) # imm = 0x10014
movq 0x17167(%rip), %rax     # 0x19818
movq %rax, 0x171c8(%rip)     # 0x19880
movl $0x1, 0x1720e(%rip)     # 0x198d0
movq 0x1712f(%rip), %rdi     # 0x197f8
movq 0x17128(%rip), %rax     # 0x197f8
movq 0xe8(%rax), %rax
movq 0x1711a(%rip), %rcx     # 0x197f8
movslq 0xe0(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movl 0x1713a(%rip), %edx     # 0x19830
movl 0x17138(%rip), %ecx     # 0x19834
movl 0x17135(%rip), %r8d     # 0x19838
movl 0x17132(%rip), %r9d     # 0x1983c
movl 0x171eb(%rip), %r11d    # 0x198fc
movq 0x171e8(%rip), %r10     # 0x19900
xorl %eax, %eax
leaq 0x17157(%rip), %rax     # 0x19878
movl $0x0, (%rsp)
movl %r11d, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq $0xa02, 0x20(%rsp)      # imm = 0xA02
movq %rax, 0x28(%rsp)
callq 0x2240
movq %rax, 0x1721c(%rip)     # 0x19970
leaq 0x17225(%rip), %rdi     # 0x19980
leaq 0x4a29(%rip), %rsi      # 0x718b
callq 0x20a0
movq $0x10014, 0x1714e(%rip) # imm = 0x10014
movq 0x1707f(%rip), %rdi     # 0x197f8
movq 0x171f0(%rip), %rsi     # 0x19970
movq -0x10(%rbp), %r9
movl -0x4(%rbp), %r10d
leaq 0x171f1(%rip), %rcx     # 0x19980
xorl %eax, %eax
movl %eax, %r8d
leaq 0x1708d(%rip), %rax     # 0x19828
movq %rcx, %rdx
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x2070
movq 0x17065(%rip), %rax     # 0x19818
movq %rax, 0x171e6(%rip)     # 0x199a0
movq 0x1705f(%rip), %rax     # 0x19820
movq %rax, 0x171e0(%rip)     # 0x199a8
movq 0x17029(%rip), %rdi     # 0x197f8
movq 0x1719a(%rip), %rsi     # 0x19970
movl $0xc, %edx
leaq 0x171ae(%rip), %rcx     # 0x19990
callq 0x2290
movq %rax, 0x17222(%rip)     # 0x19a10
movq 0x17003(%rip), %rdi     # 0x197f8
leaq 0x4999(%rip), %rsi      # 0x7195
callq 0x2150
movq %rax, 0x17210(%rip)     # 0x19a18
cmpq $0x0, 0x17208(%rip)     # 0x19a18
jne 0x2834
movq 0x67df(%rip), %rax      # 0x8ff8
movq (%rax), %rdi
leaq 0x4996(%rip), %rsi      # 0x71b9
movb $0x0, %al
callq 0x21a0
movl $0x1, %edi
callq 0x2360
movq 0x16fbd(%rip), %rdi     # 0x197f8
movq 0x171ce(%rip), %rsi     # 0x19a10
movq 0x171cf(%rip), %rax     # 0x19a18
movq 0x8(%rax), %rdx
callq 0x2130
movw $0xffff, -0x18(%rbp)    # imm = 0xFFFF
movw $0xffff, -0x16(%rbp)    # imm = 0xFFFF
movw $0x0, -0x14(%rbp)
movb $0x7, -0x12(%rbp)
movq 0x16f89(%rip), %rdi     # 0x197f8
movq 0x16f82(%rip), %rax     # 0x197f8
movq 0xe8(%rax), %rax
movslq 0x16f7c(%rip), %rcx     # 0x19800
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x50(%rax), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2080
movq -0x20(%rbp), %rax
movq %rax, 0x170fd(%rip)     # 0x199a0
movq 0x16f4e(%rip), %rdi     # 0x197f8
movq 0x170bf(%rip), %rsi     # 0x19970
movl $0xc, %edx
leaq 0x170d3(%rip), %rcx     # 0x19990
callq 0x2290
movq %rax, 0x17157(%rip)     # 0x19a20
movq 0x16f28(%rip), %rdi     # 0x197f8
movq 0x17149(%rip), %rsi     # 0x19a20
movq 0x1713a(%rip), %rax     # 0x19a18
movq 0x8(%rax), %rdx
callq 0x2130
movw $0x0, -0x16(%rbp)
movq 0x16f04(%rip), %rdi     # 0x197f8
movq 0x16efd(%rip), %rax     # 0x197f8
movq 0xe8(%rax), %rax
movslq 0x16ef7(%rip), %rcx     # 0x19800
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x50(%rax), %rsi
leaq -0x20(%rbp), %rdx
callq 0x2080
movq -0x20(%rbp), %rax
movq %rax, 0x17078(%rip)     # 0x199a0
movq 0x16ec9(%rip), %rdi     # 0x197f8
movq 0x1703a(%rip), %rsi     # 0x19970
movl $0xc, %edx
leaq 0x1704e(%rip), %rcx     # 0x19990
callq 0x2290
movq %rax, 0x170da(%rip)     # 0x19a28
movq 0x16ea3(%rip), %rdi     # 0x197f8
movq 0x170cc(%rip), %rsi     # 0x19a28
movq 0x170b5(%rip), %rax     # 0x19a18
movq 0x8(%rax), %rdx
callq 0x2130
movq 0x16ea5(%rip), %rax     # 0x19818
movq %rax, 0x17026(%rip)     # 0x199a0
movq 0x16e77(%rip), %rdi     # 0x197f8
movq 0x16fe8(%rip), %rsi     # 0x19970
callq 0x2220
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)