// File: /workspace/github_cpp_makefile_star2_O3/sgielen[P]clife/single.cpp
// Function: main
int main(int argc, char *argv[]) {
	int microsleeptime = 100000;
	if(argc == 2) {
		std::stringstream ss;
		ss << argv[1];
		ss >> microsleeptime;
		if(!ss) {
			std::cerr << "Usage: " << argv[0] << " [microsleeptime]" << std::endl;
		}
	} else if(argc > 2) {
		std::cerr << "Usage: " << argv[0] << " [microsleeptime]" << std::endl;
	}

	init_random();

	std::vector<uint64_t> earlier_hashes;
	GameOfLifeField<SimpleValue<char(0x80), 0>> field(8, 80);

	field.generateRandom(35);

	bool field_done = false;
	int repeats_to_do = 0;
	field.print(std::cout);
	while(!field_done || repeats_to_do > 0) {
		if(repeats_to_do > 0) {
			--repeats_to_do;
		}
		field.nextState();
		field.print(std::cout);
		if(!field_done) {
			check_stop_condition(field, earlier_hashes, field_done, repeats_to_do);
		}
		usleep(microsleeptime);
		continue;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rsi, %rbx
movl $0x186a0, 0xc(%rsp)     # imm = 0x186A0
cmpl $0x2, %edi
jne 0x4711
leaq 0x50(%rsp), %rdi
callq 0x20e0
leaq 0x60(%rsp), %r14
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x475d
movq %r15, %rdi
callq 0x2080
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x477b
jle 0x48ae
movq 0x48ca(%rip), %r14      # 0x8fe8
leaq 0x1a5b(%rip), %rsi      # 0x6180
movl $0x7, %edx
movq %r14, %rdi
callq 0x2180
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x485b
movq %rbx, %rdi
callq 0x2080
movq 0x489b(%rip), %rdi      # 0x8fe8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x4873
movq 0x60(%rsp), %rax
movq -0x18(%rax), %rax
addq %rax, %r14
movl 0x80(%rsp,%rax), %esi
orl $0x1, %esi
movq %r14, %rdi
callq 0x21f0
leaq 0x50(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x20c0
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x70(%rsp,%rax)
je 0x483b
movq 0x4843(%rip), %r14      # 0x8fe8
leaq 0x19d4(%rip), %rsi      # 0x6180
movl $0x7, %edx
movq %r14, %rdi
callq 0x2180
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x47dd
movq %rbx, %rdi
callq 0x2080
movq 0x4818(%rip), %rdi      # 0x8fe8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x47f5
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21f0
movq 0x47ec(%rip), %rbx      # 0x8fe8
leaq 0x1985(%rip), %rsi      # 0x6188
movl $0x11, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq 0x47ba(%rip), %rdi      # 0x8fe8
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq 0x4766(%rip), %rsi      # 0x8fa8
leaq 0x50(%rsp), %rdi
callq 0x2100
leaq 0xd0(%rsp), %rdi
callq 0x2050
jmp 0x48ae
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21f0
leaq 0x190e(%rip), %rsi      # 0x6188
movl $0x11, %edx
movq %r14, %rdi
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21d0
movl 0x8(%rbx), %edi
callq 0x2140
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x280, %edi            # imm = 0x280
callq 0x2160
leaq 0x50(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, %r14
addq $0x280, %r14            # imm = 0x280
movq %r14, 0x10(%rbx)
movl $0x280, %edx            # imm = 0x280
movq %rax, %rdi
xorl %esi, %esi
callq 0x20b0
movq %r14, 0x8(%rbx)
movabsq $0x800000050, %rax      # imm = 0x800000050
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
movl $0x23, %esi
callq 0x4fc6
movb $0x0, 0x7(%rsp)
movl $0x0, 0x8(%rsp)
movq 0x4690(%rip), %rsi      # 0x8fc8
leaq 0x50(%rsp), %rdi
callq 0x508a
leaq 0x50(%rsp), %rbx
movq 0x467a(%rip), %r14      # 0x8fc8
leaq 0x30(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0x7(%rsp), %r13
leaq 0x8(%rsp), %rbp
movl 0x8(%rsp), %eax
testl %eax, %eax
setle %cl
testb %cl, 0x7(%rsp)
jne 0x49dd
testl %eax, %eax
jle 0x497b
decl %eax
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x5274
movq %rbx, %rdi
movq %r14, %rsi
callq 0x508a
cmpb $0x0, 0x7(%rsp)
jne 0x49d2
movq %r15, %rdi
movq %rbx, %rsi
callq 0x54ae
movq 0x68(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x542f
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x49d2
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movl 0xc(%rsp), %edi
callq 0x21b0
jmp 0x4962
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x49f4
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4a0b
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
xorl %eax, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4a67
jmp 0x4a67
movq %rax, %rbx
jmp 0x4a81
movq %rax, %rbx
movq 0x4576(%rip), %rsi      # 0x8fa8
leaq 0x50(%rsp), %rdi
callq 0x2100
leaq 0xd0(%rsp), %rdi
callq 0x2050
jmp 0x4a98
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4a6a
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x4a6a
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x4a81
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4a98
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2210