// File: /workspace/github_c_makefile_star2_O0/veltzer[P]xmeltdown/src/xmeltdown.c
// Function: do_planes
void do_planes() {
	int over=0;
	int finished=0;
	int width, xloc, yloc, dist, size, i;
	short** heights;

	heights=(short **) malloc(DisplayPlanes(dpy, screen));
	for (i=0; i < DisplayPlanes(dpy, screen); i++) {
		heights[i]=(short *) calloc(sizeof(short),
			DisplayWidth(dpy, screen));
	}
	while (!over) {
		depth=rnd(DisplayPlanes(dpy, screen));
		width=rnd(MIN_WIDTH)+WIDTH_ADD;

		xloc=calc_xloc(width);

		yloc=DisplayHeight(dpy, screen);
		for (i=xloc; i < (xloc+width); i++) {
			yloc=min(yloc, heights[depth][i]);
		}
		if (yloc == DisplayHeight(dpy, screen))
			continue;
		dist=rnd(yloc/10+MIN_DIST);
		size=rnd(max(yloc+MIN_SIZE, MAX_SIZE));

		XSetPlaneMask(dpy, copygc, 1<<depth);
		XSetPlaneMask(dpy, fillgc, 1<<depth);
		XCopyArea(dpy, win, win, copygc,
			xloc, yloc,
			width, size,
			xloc, yloc+dist);
		XFillRectangle(dpy, win, fillgc,
			xloc, yloc,
			width, dist);
		yloc+=dist;
		for (i=xloc; i < (xloc+width); i++) {
			if ((heights[depth][i] < (DisplayHeight(dpy, screen)-MIN_SIZE)) && (yloc >= (DisplayHeight(dpy, screen)-MIN_SIZE)))
				finished++;
			heights[depth][i]=max(heights[depth][i], yloc);
		}
		if (finished >= (DisplayWidth(dpy, screen)-FINISHED)) {
			XSync(dpy, 0);
			over=1;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movq 0x2b32(%rip), %rax      # 0x40c0
movq 0xe8(%rax), %rax
movslq 0x2b2c(%rip), %rcx      # 0x40c8
shlq $0x7, %rcx
addq %rcx, %rax
movslq 0x38(%rax), %rdi
callq 0x1050
movq %rax, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq 0x2aff(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x2af9(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
cmpl 0x38(%rcx), %eax
jge 0x161f
movq 0x2ade(%rip), %rax      # 0x40c0
movq 0xe8(%rax), %rax
movslq 0x2ad8(%rip), %rcx      # 0x40c8
shlq $0x7, %rcx
addq %rcx, %rax
movslq 0x18(%rax), %rsi
movl $0x2, %edi
callq 0x1110
movq %rax, %rdx
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x15b7
jmp 0x1621
cmpl $0x0, -0xc(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1633
jmp 0x1995
callq 0x1130
movq 0x2a81(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x2a7b(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
movslq 0x38(%rcx), %rcx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, 0x2a83(%rip)      # 0x40e8
callq 0x1130
movl $0x1e, %ecx
cqto
idivq %rcx
addq $0x14, %rdx
movl %edx, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %edi
callq 0x19a0
movl %eax, -0x18(%rbp)
movq 0x2a31(%rip), %rax      # 0x40c0
movq 0xe8(%rax), %rax
movslq 0x2a2b(%rip), %rcx      # 0x40c8
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x18(%rbp), %ecx
addl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jge 0x170e
movl -0x1c(%rbp), %eax
movq -0x30(%rbp), %rcx
movslq 0x2a1d(%rip), %rdx      # 0x40e8
movq (%rcx,%rdx,8), %rcx
movslq -0x28(%rbp), %rdx
movswl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jge 0x16e3
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x16fd
movq -0x30(%rbp), %rax
movslq 0x29fa(%rip), %rcx      # 0x40e8
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x16b0
movl -0x1c(%rbp), %eax
movq 0x29a8(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x29a2(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
cmpl 0x1c(%rcx), %eax
jne 0x1737
jmp 0x1621
callq 0x1130
movq %rax, -0x48(%rbp)
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x48(%rbp), %rax
addl $0x2, %ecx
movslq %ecx, %rcx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, -0x20(%rbp)
callq 0x1130
movq %rax, -0x40(%rbp)
movl -0x1c(%rbp), %eax
addl $0xa, %eax
cmpl $0x64, %eax
jle 0x1780
movl -0x1c(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x4c(%rbp)
jmp 0x178a
movl $0x64, %eax
movl %eax, -0x4c(%rbp)
jmp 0x178a
movq -0x40(%rbp), %rax
movl -0x4c(%rbp), %ecx
movslq %ecx, %rcx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, -0x24(%rbp)
movq 0x291b(%rip), %rdi      # 0x40c0
movq 0x292c(%rip), %rsi      # 0x40d8
movl 0x2936(%rip), %ecx      # 0x40e8
movl $0x1, %eax
shll %cl, %eax
movslq %eax, %rdx
callq 0x1120
movq 0x28f8(%rip), %rdi      # 0x40c0
movq 0x2911(%rip), %rsi      # 0x40e0
movl 0x2913(%rip), %ecx      # 0x40e8
movl $0x1, %eax
shll %cl, %eax
movslq %eax, %rdx
callq 0x1120
movq 0x28d5(%rip), %rdi      # 0x40c0
movq 0x28de(%rip), %rsi      # 0x40d0
movq 0x28d7(%rip), %rdx      # 0x40d0
movq 0x28d8(%rip), %rcx      # 0x40d8
movl -0x18(%rbp), %r8d
movl -0x1c(%rbp), %r9d
movl -0x14(%rbp), %ebx
movl -0x24(%rbp), %r11d
movl -0x18(%rbp), %r10d
movl -0x1c(%rbp), %eax
addl -0x20(%rbp), %eax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0x10a0
movq 0x288a(%rip), %rdi      # 0x40c0
movq 0x2893(%rip), %rsi      # 0x40d0
movq 0x289c(%rip), %rdx      # 0x40e0
movl -0x18(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movl -0x14(%rbp), %r9d
movl -0x20(%rbp), %eax
movl %eax, (%rsp)
callq 0x10b0
movl -0x20(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl -0x18(%rbp), %ecx
addl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jge 0x1952
movq -0x30(%rbp), %rax
movslq 0x2863(%rip), %rcx      # 0x40e8
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movq 0x2828(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x2822(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
movl 0x1c(%rcx), %ecx
subl $0xa, %ecx
cmpl %ecx, %eax
jge 0x18e9
movl -0x1c(%rbp), %eax
movq 0x27ff(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x27f9(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
movl 0x1c(%rcx), %ecx
subl $0xa, %ecx
cmpl %ecx, %eax
jl 0x18e9
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x30(%rbp), %rax
movslq 0x27f4(%rip), %rcx      # 0x40e8
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
cmpl -0x1c(%rbp), %eax
jle 0x1921
movq -0x30(%rbp), %rax
movslq 0x27d8(%rip), %rcx      # 0x40e8
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movl %eax, -0x50(%rbp)
jmp 0x1927
movl -0x1c(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movw %ax, %dx
movq -0x30(%rbp), %rax
movslq 0x27b0(%rip), %rcx      # 0x40e8
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1869
movl -0x10(%rbp), %eax
movq 0x2764(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x275e(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
subl $0x32, %ecx
cmpl %ecx, %eax
jl 0x1990
movq 0x273e(%rip), %rdi      # 0x40c0
xorl %esi, %esi
callq 0x1100
movl $0x1, -0xc(%rbp)
jmp 0x1621
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)