// File: /workspace/github_c_makefile_star2_O3/veltzer[P]xmeltdown/src/draw.c
// Function: Initialize
void Initialize(int argc, char** argv)
{
	int count;
	XSizeHints size_hints;
	XSetWindowAttributes attributes;
	if (!(dpy=XOpenDisplay(""))) {
		printf ("Error: Can't open display.");
		exit(-1);
	}
	screen=DefaultScreen(dpy);

	attributes.backing_store=Always;
	attributes.background_pixel=WhitePixel(dpy, screen);
	attributes.border_pixel=BlackPixel(dpy, screen);

	size_hints.width=400;
	size_hints.height=400;
	size_hints.flags=PSize;

/*
 * win = XCreateWindow(
 * dpy, DefaultRootWindow(dpy),
 * 0,0,
 * size_hints.width,
 * size_hints.height,
 * 0,
 * CopyFromParent,
 * InputOutput,
 * CopyFromParent,
 * CWBackingStore | CWBackPixel | CWBorderPixel,
 * &attributes);
 */

	win=XCreateSimpleWindow(dpy,
		DefaultRootWindow(dpy),
		0, 0,
		size_hints.width,
		size_hints.height,
		4,
/*
 * BlackPixel(dpy, screen),
 * WhitePixel(dpy, screen));
 */
		WhitePixel(dpy, screen),
		BlackPixel(dpy, screen)),

	XSetStandardProperties (dpy, win, "application",
		"stickman",
		None, argv, argc, &size_hints);
	for (count=0; count < 2; count++) {
		buffer[count]=XCreateWindow(
			dpy, win,
			0, 0,
			size_hints.width,
			size_hints.height,
			0,
			CopyFromParent,
			InputOutput,
			CopyFromParent,
			CWBackingStore|CWBackPixel,
			&attributes);
		XMapWindow(dpy, buffer[count]);
	}
	XMapWindow(dpy, win);
	XRaiseWindow(dpy, win);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc0, %rsp
movq %rsi, %r14
movl %edi, %ebx
leaq 0xba6(%rip), %rdi       # 0x3040
callq 0x10d0
movq %rax, 0x2cda(%rip)      # 0x5180
testq %rax, %rax
je 0x2628
movslq 0xe0(%rax), %rcx
movl %ecx, 0x2ccc(%rip)      # 0x5188
leaq 0x50(%rsp), %r15
movl $0x2, 0x28(%r15)
movq 0xe8(%rax), %rdx
shlq $0x7, %rcx
movq 0x58(%rdx,%rcx), %r10
movq %r10, 0x8(%r15)
movq 0x60(%rdx,%rcx), %r11
movq %r11, 0x18(%r15)
movabsq $0x19000000190, %rsi    # imm = 0x19000000190
movq %rsp, %r13
movq %rsi, 0x10(%r13)
movq $0x8, (%r13)
movq 0x10(%rdx,%rcx), %rsi
subq $0x8, %rsp
xorl %r12d, %r12d
movq %rax, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x190, %r8d            # imm = 0x190
movl $0x190, %r9d            # imm = 0x190
pushq %r11
pushq %r10
pushq $0x4
callq 0x10c0
addq $0x20, %rsp
movq %rax, 0x2c5c(%rip)      # 0x5190
movq 0x2c45(%rip), %rdi      # 0x5180
leaq 0xbb9(%rip), %rdx       # 0x30fb
leaq 0xbbe(%rip), %rcx       # 0x3107
movq %rax, %rsi
xorl %r8d, %r8d
movq %r14, %r9
pushq %r13
pushq %rbx
callq 0x1170
addq $0x10, %rsp
movq 0x2c1b(%rip), %rdi      # 0x5180
movq 0x2c24(%rip), %rsi      # 0x5190
movl 0x10(%r13), %r8d
movl 0x14(%r13), %r9d
movl $0x42, %r14d
movl $0x1, %ebx
xorl %edx, %edx
xorl %ecx, %ecx
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %r12
pushq %r12
callq 0x10a0
addq $0x30, %rsp
movq %rax, 0x2c02(%rip)      # 0x51a0
movq 0x2bdb(%rip), %rdi      # 0x5180
movq %rax, %rsi
callq 0x1120
movq 0x2bcc(%rip), %rdi      # 0x5180
movq 0x2bd5(%rip), %rsi      # 0x5190
movl 0x10(%r13), %r8d
movl 0x14(%r13), %r9d
xorl %edx, %edx
xorl %ecx, %ecx
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %r12
pushq %r12
callq 0x10a0
addq $0x30, %rsp
movq %rax, 0x2bc6(%rip)      # 0x51a8
movq 0x2b97(%rip), %rdi      # 0x5180
movq %rax, %rsi
callq 0x1120
movq 0x2b88(%rip), %rdi      # 0x5180
movq 0x2b91(%rip), %rsi      # 0x5190
callq 0x1120
movq 0x2b75(%rip), %rdi      # 0x5180
movq 0x2b7e(%rip), %rsi      # 0x5190
callq 0x1080
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xab1(%rip), %rdi       # 0x30e0
xorl %eax, %eax
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1070