// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0xb17(%rip), %rdi       # 0x3040
callq 0x10c0
movq %rax, 0x2c4b(%rip)      # 0x5180
cmpq $0x0, %rax
jne 0x2553
leaq 0xb76(%rip), %rdi       # 0x30b8
movb $0x0, %al
callq 0x1030
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1060
movq 0x2c26(%rip), %rax      # 0x5180
movl 0xe0(%rax), %eax
movl %eax, 0x2c22(%rip)      # 0x5188
movl $0x2, -0xb0(%rbp)
movq 0x2c09(%rip), %rax      # 0x5180
movq 0xe8(%rax), %rax
movslq 0x2c03(%rip), %rcx      # 0x5188
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x58(%rax), %rax
movq %rax, -0xd0(%rbp)
movq 0x2be2(%rip), %rax      # 0x5180
movq 0xe8(%rax), %rax
movslq 0x2bdc(%rip), %rcx      # 0x5188
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %rax
movq %rax, -0xc0(%rbp)
movl $0x190, -0x58(%rbp)     # imm = 0x190
movl $0x190, -0x54(%rbp)     # imm = 0x190
movq $0x8, -0x68(%rbp)
movq 0x2ba5(%rip), %rdi      # 0x5180
movq 0x2b9e(%rip), %rax      # 0x5180
movq 0xe8(%rax), %rax
movq 0x2b90(%rip), %rcx      # 0x5180
movslq 0xe0(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movl -0x58(%rbp), %r8d
movl -0x54(%rbp), %r9d
movq 0x2b6f(%rip), %rax      # 0x5180
movq 0xe8(%rax), %rax
movslq 0x2b69(%rip), %rcx      # 0x5188
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x58(%rax), %r10
movq 0x2b4f(%rip), %rax      # 0x5180
movq 0xe8(%rax), %rax
movslq 0x2b49(%rip), %rcx      # 0x5188
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %edx
movl $0x4, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x10b0
movq %rax, 0x2b25(%rip)      # 0x5190
movq 0x2b0e(%rip), %rdi      # 0x5180
movq 0x2b17(%rip), %rsi      # 0x5190
movq -0x10(%rbp), %r9
movl -0x4(%rbp), %r10d
leaq 0xa4b(%rip), %rdx       # 0x30d3
leaq 0xa50(%rip), %rcx       # 0x30df
xorl %eax, %eax
movl %eax, %r8d
leaq -0x68(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1160
movl $0x0, -0x14(%rbp)
cmpl $0x2, -0x14(%rbp)
jge 0x2748
movq 0x2ac2(%rip), %rdi      # 0x5180
movq 0x2acb(%rip), %rsi      # 0x5190
movl -0x58(%rbp), %r8d
movl -0x54(%rbp), %r9d
xorl %ecx, %ecx
xorl %eax, %eax
leaq -0xd8(%rbp), %rax
movl %ecx, %edx
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x1, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x42, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x1090
movq %rax, %rdx
movslq -0x14(%rbp), %rcx
leaq 0x2a85(%rip), %rax      # 0x51a0
movq %rdx, (%rax,%rcx,8)
movq 0x2a5a(%rip), %rdi      # 0x5180
movslq -0x14(%rbp), %rcx
leaq 0x2a6f(%rip), %rax      # 0x51a0
movq (%rax,%rcx,8), %rsi
callq 0x1110
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x26ad
movq 0x2a31(%rip), %rdi      # 0x5180
movq 0x2a3a(%rip), %rsi      # 0x5190
callq 0x1110
movq 0x2a1e(%rip), %rdi      # 0x5180
movq 0x2a27(%rip), %rsi      # 0x5190
callq 0x1070
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq