// File: /workspace/github_cpp_makefile_star2_O1/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 0x45b1
leaq 0x50(%rsp), %rdi
callq 0x20e0
leaq 0x60(%rsp), %r14
movq 0x8(%rbx), %r15
testq %r15, %r15
je 0x45fd
movq %r15, %rdi
callq 0x2080
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x461b
jle 0x474e
movq 0x4a2a(%rip), %r14      # 0x8fe8
leaq 0x1b7b(%rip), %rsi      # 0x6140
movl $0x7, %edx
movq %r14, %rdi
callq 0x2180
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x46fb
movq %rbx, %rdi
callq 0x2080
movq 0x49fb(%rip), %rdi      # 0x8fe8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x4713
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 0x46db
movq 0x49a3(%rip), %r14      # 0x8fe8
leaq 0x1af4(%rip), %rsi      # 0x6140
movl $0x7, %edx
movq %r14, %rdi
callq 0x2180
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x467d
movq %rbx, %rdi
callq 0x2080
movq 0x4978(%rip), %rdi      # 0x8fe8
movq %rbx, %rsi
movq %rax, %rdx
callq 0x2180
jmp 0x4695
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21f0
movq 0x494c(%rip), %rbx      # 0x8fe8
leaq 0x1aa5(%rip), %rsi      # 0x6148
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 0x491a(%rip), %rdi      # 0x8fe8
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movq 0x48c6(%rip), %rsi      # 0x8fa8
leaq 0x50(%rsp), %rdi
callq 0x2100
leaq 0xd0(%rsp), %rdi
callq 0x2050
jmp 0x474e
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x21f0
leaq 0x1a2e(%rip), %rsi      # 0x6148
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
xorl %r14d, %r14d
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x21d0
movl 0x8(%rbx), %edi
callq 0x2140
movq %r14, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq %r14, 0x10(%rbx)
movaps %xmm0, (%rbx)
movl $0x280, %edi            # imm = 0x280
callq 0x2160
leaq 0x50(%rsp), %rbx
movq %rax, (%rbx)
movq %rax, 0x8(%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 0x4e6c
movb $0x0, 0x7(%rsp)
movl $0x0, 0x8(%rsp)
movq 0x47e6(%rip), %rsi      # 0x8fc8
leaq 0x50(%rsp), %rdi
callq 0x4f2a
leaq 0x50(%rsp), %rbx
movq 0x47d0(%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 0x4887
testl %eax, %eax
jle 0x4825
decl %eax
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x5114
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4f2a
cmpb $0x0, 0x7(%rsp)
jne 0x487c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5348
movq 0x68(%rsp), %rax
movq %rax, 0x48(%rsp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x52c9
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x487c
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movl 0xc(%rsp), %edi
callq 0x21b0
jmp 0x480c
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x489e
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x48b5
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 0x4911
jmp 0x4911
movq %rax, %rbx
jmp 0x492b
movq %rax, %rbx
movq 0x46cc(%rip), %rsi      # 0x8fa8
leaq 0x50(%rsp), %rdi
callq 0x2100
leaq 0xd0(%rsp), %rdi
callq 0x2050
jmp 0x4942
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x4914
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
jmp 0x4914
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x492b
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x4942
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2170
movq %rbx, %rdi
callq 0x2210