// File: /workspace/github_c_makefile_star2_O1/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 0xb11(%rip), %rdi       # 0x3040
callq 0x10d0
movq %rax, 0x2c45(%rip)      # 0x5180
testq %rax, %rax
je 0x268d
movslq 0xe0(%rax), %rcx
movl %ecx, 0x2c37(%rip)      # 0x5188
leaq 0x50(%rsp), %r15
movl $0x2, 0x28(%r15)
movq 0xe8(%rax), %rdx
shlq $0x7, %rcx
movq 0x58(%rdx,%rcx), %rsi
movq %rsi, 0x8(%r15)
movq 0x60(%rdx,%rcx), %rsi
movq %rsi, 0x18(%r15)
movabsq $0x19000000190, %rsi    # imm = 0x19000000190
movq %rsp, %r13
movq %rsi, 0x10(%r13)
movq $0x8, (%r13)
movq 0x10(%rdx,%rcx), %rsi
movups 0x58(%rdx,%rcx), %xmm0
subq $0x20, %rsp
movups %xmm0, 0x8(%rsp)
movl $0x4, (%rsp)
xorl %r12d, %r12d
movq %rax, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x190, %r8d            # imm = 0x190
movl $0x190, %r9d            # imm = 0x190
callq 0x10c0
addq $0x20, %rsp
movq %rax, 0x2bbc(%rip)      # 0x5190
movq 0x2ba5(%rip), %rdi      # 0x5180
leaq 0xb01(%rip), %rdx       # 0x30e3
leaq 0xb06(%rip), %rcx       # 0x30ef
movq %rax, %rsi
xorl %r8d, %r8d
movq %r14, %r9
pushq %r13
pushq %rbx
callq 0x1170
addq $0x10, %rsp
leaq 0x2b9b(%rip), %rbx      # 0x51a0
xorl %r14d, %r14d
movq 0x2b71(%rip), %rdi      # 0x5180
movq 0x2b7a(%rip), %rsi      # 0x5190
movl 0x10(%rsp), %r8d
movl 0x14(%rsp), %r9d
xorl %edx, %edx
xorl %ecx, %ecx
pushq %r15
pushq $0x42
pushq $0x0
pushq $0x1
pushq %r12
pushq %r12
callq 0x10a0
addq $0x30, %rsp
movq %rax, (%r14,%rbx)
movq 0x2b3c(%rip), %rdi      # 0x5180
movq %rax, %rsi
callq 0x1120
addq $0x8, %r14
cmpq $0x8, %r14
je 0x2608
movq 0x2b23(%rip), %rdi      # 0x5180
movq 0x2b2c(%rip), %rsi      # 0x5190
callq 0x1120
movq 0x2b10(%rip), %rdi      # 0x5180
movq 0x2b19(%rip), %rsi      # 0x5190
callq 0x1080
addq $0xc0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xa34(%rip), %rdi       # 0x30c8
xorl %eax, %eax
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1070