// File: /workspace/github_cpp_makefile_star2_O2/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 0x3f9b
leaq 0x50(%rsp), %rdi
callq 0x20c0
leaq 0x60(%rsp), %rdi
movq 0x8(%rbx), %rsi
callq 0x2130
leaq 0x50(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x20b0
movq 0x50(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x70(%rsp,%rax)
je 0x3f8f
movq 0x4087(%rip), %rdi      # 0x7fe8
leaq 0x1218(%rip), %rsi      # 0x5180
callq 0x2130
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2130
leaq 0x1209(%rip), %rsi      # 0x5188
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x2080
leaq 0x50(%rsp), %rdi
callq 0x20e0
jmp 0x3fd2
jle 0x3fd2
movq 0x4044(%rip), %rdi      # 0x7fe8
leaq 0x11d5(%rip), %rsi      # 0x5180
callq 0x2130
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x2130
leaq 0x11c6(%rip), %rsi      # 0x5188
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x2080
callq 0x3ee3
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
andq $0x0, 0x20(%rsp)
leaq 0x50(%rsp), %rdi
pushq $0x8
popq %rsi
pushq $0x50
popq %rdx
callq 0x44a6
leaq 0x50(%rsp), %rdi
pushq $0x23
popq %rsi
callq 0x44e0
movb $0x0, 0x7(%rsp)
andl $0x0, 0x8(%rsp)
movq 0x3fb5(%rip), %rsi      # 0x7fc8
leaq 0x50(%rsp), %rdi
callq 0x4580
leaq 0x50(%rsp), %rbx
movq 0x3f9f(%rip), %r14      # 0x7fc8
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 0x409f
testl %eax, %eax
jle 0x4056
decl %eax
movl %eax, 0x8(%rsp)
movq %rbx, %rdi
callq 0x46a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4580
cmpb $0x0, 0x7(%rsp)
jne 0x4094
movq %r15, %rdi
movq %rbx, %rsi
callq 0x486e
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x480d
movq %r15, %rdi
callq 0x48d8
movl 0xc(%rsp), %edi
callq 0x2190
jmp 0x403d
leaq 0x50(%rsp), %rdi
callq 0x48d8
leaq 0x10(%rsp), %rdi
callq 0x495c
xorl %eax, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x40ee
jmp 0x40ee
movq %rax, %rbx
jmp 0x40fb
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x20e0
jmp 0x4105
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x48d8
jmp 0x40f1
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x48d8
leaq 0x10(%rsp), %rdi
callq 0x495c
movq %rbx, %rdi
callq 0x21e0