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

	heights=(short *) calloc(sizeof(short), DisplayWidth(dpy, screen));
	over=0;
	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[i]);
		}
		if (yloc == DisplayHeight(dpy, screen))
			continue;
		dist=rnd(yloc/10+MIN_DIST);
		size=rnd(max(yloc+MIN_SIZE, MAX_SIZE));

		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[i] < (DisplayHeight(dpy, screen)-MIN_SIZE)) && (yloc >= (DisplayHeight(dpy, screen)-MIN_SIZE)))
				finished++;
			heights[i]=max(heights[i], yloc);
		}
		if (finished >= (DisplayWidth(dpy, screen)-FINISHED)) {
			XSync(dpy, 0);
			over=1;
		}
		usleep(USLEEP);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
movl $0x0, -0x10(%rbp)
movq 0x2659(%rip), %rax      # 0x40c0
movq 0xe8(%rax), %rax
movslq 0x2653(%rip), %rcx      # 0x40c8
shlq $0x7, %rcx
addq %rcx, %rax
movslq 0x18(%rax), %rsi
movl $0x2, %edi
callq 0x1110
movq %rax, -0x30(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1aa7
jmp 0x1d8b
callq 0x1130
movq 0x260d(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x2607(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
movslq 0x38(%rcx), %rcx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, 0x260f(%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 0x25bd(%rip), %rax      # 0x40c0
movq 0xe8(%rax), %rax
movslq 0x25b7(%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 0x1b6c
movl -0x1c(%rbp), %eax
movq -0x30(%rbp), %rcx
movslq -0x28(%rbp), %rdx
movswl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jge 0x1b4c
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x1b5b
movq -0x30(%rbp), %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 0x1b24
movl -0x1c(%rbp), %eax
movq 0x254a(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x2544(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
cmpl 0x1c(%rcx), %eax
jne 0x1b95
jmp 0x1a95
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 0x1bde
movl -0x1c(%rbp), %eax
addl $0xa, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1be8
movl $0x64, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1be8
movq -0x40(%rbp), %rax
movl -0x4c(%rbp), %ecx
movslq %ecx, %rcx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, -0x24(%rbp)
movq 0x24bd(%rip), %rdi      # 0x40c0
movq 0x24c6(%rip), %rsi      # 0x40d0
movq 0x24bf(%rip), %rdx      # 0x40d0
movq 0x24c0(%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 0x2472(%rip), %rdi      # 0x40c0
movq 0x247b(%rip), %rsi      # 0x40d0
movq 0x2484(%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 0x1d3e
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movq 0x241b(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x2415(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
movl 0x1c(%rcx), %ecx
subl $0xa, %ecx
cmpl %ecx, %eax
jge 0x1cf6
movl -0x1c(%rbp), %eax
movq 0x23f2(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x23ec(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
movl 0x1c(%rcx), %ecx
subl $0xa, %ecx
cmpl %ecx, %eax
jl 0x1cf6
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
cmpl -0x1c(%rbp), %eax
jle 0x1d18
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
movswl (%rax,%rcx,2), %eax
movl %eax, -0x50(%rbp)
jmp 0x1d1e
movl -0x1c(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movw %ax, %dx
movq -0x30(%rbp), %rax
movslq -0x28(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x1c81
movl -0x10(%rbp), %eax
movq 0x2378(%rip), %rcx      # 0x40c0
movq 0xe8(%rcx), %rcx
movslq 0x2372(%rip), %rdx      # 0x40c8
shlq $0x7, %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
subl $0x32, %ecx
cmpl %ecx, %eax
jl 0x1d7c
movq 0x2352(%rip), %rdi      # 0x40c0
xorl %esi, %esi
callq 0x1100
movl $0x1, -0xc(%rbp)
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x10d0
jmp 0x1a95
addq $0x68, %rsp
popq %rbx
popq %rbp
retq