// File: moporgic[P]2048-Framework/./statistics.h
// Function: statistics::show(bool, unsigned long) const
void show(bool tstat = true, size_t blk = 0) const {
		size_t num = std::min(data.size(), blk ?: block);
		size_t stat[64] = { 0 };
		size_t sop = 0, pop = 0, eop = 0;
		time_t sdu = 0, pdu = 0, edu = 0;
		board::score sum = 0, max = 0;
		auto it = data.end();
		for (size_t i = 0; i < num; i++) {
			auto& ep = *(--it);
			sum += ep.score();
			max = std::max(ep.score(), max);
			stat[*std::max_element(ep.state().begin(), ep.state().end())]++;
			sop += ep.step();
			pop += ep.step(action::slide::type);
			eop += ep.step(action::place::type);
			sdu += ep.time();
			pdu += ep.time(action::slide::type);
			edu += ep.time(action::place::type);
		}

		std::ios ff(nullptr);
		ff.copyfmt(std::cout);
		std::cout << std::fixed << std::setprecision(0);
		std::cout << count << "\t";
		std::cout << "avg = " << (sum / num) << ", ";
		std::cout << "max = " << (max) << ", ";
		std::cout << "ops = " << (sop * 1000.0 / sdu);
		std::cout <<     " (" << (pop * 1000.0 / pdu);
		std::cout <<      "|" << (eop * 1000.0 / edu) << ")";
		std::cout << std::endl;
		std::cout.copyfmt(ff);

		if (!tstat) return;
		for (size_t t = 0, c = 0; c < num; c += stat[t++]) {
			if (stat[t] == 0) continue;
			size_t accu = std::accumulate(std::begin(stat) + t, std::end(stat), size_t(0));
			std::cout << "\t" << ((1 << t) & -2u); // type
			std::cout << "\t" << (accu * 100.0 / num) << "%"; // win rate
			std::cout << "\t" "(" << (stat[t] * 100.0 / num) << "%" ")"; // percentage of ending
			std::cout << std::endl;
		}
		std::cout << std::endl;
	}

// Assembly:
subq $0x4a8, %rsp            # imm = 0x4A8
movb %sil, %al
movq %rdi, 0x4a0(%rsp)
andb $0x1, %al
movb %al, 0x49f(%rsp)
movq %rdx, 0x490(%rsp)
movq 0x4a0(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
addq $0x20, %rdi
callq 0x9e40
movq %rax, 0x480(%rsp)
movq 0x490(%rsp), %rax
movq %rax, 0xb8(%rsp)
cmpq $0x0, %rax
je 0xc4fc
movq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
jmp 0xc510
movq 0xb0(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rax
movq %rax, 0x478(%rsp)
leaq 0x480(%rsp), %rdi
leaq 0x478(%rsp), %rsi
callq 0xa680
movq (%rax), %rax
movq %rax, 0x488(%rsp)
leaq 0x270(%rsp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x41b0
movq 0xb0(%rsp), %rsi
movq $0x0, 0x268(%rsp)
movq $0x0, 0x260(%rsp)
movq $0x0, 0x258(%rsp)
movq $0x0, 0x250(%rsp)
movq $0x0, 0x248(%rsp)
movq $0x0, 0x240(%rsp)
movq $0x0, 0x238(%rsp)
movq $0x0, 0x230(%rsp)
addq $0x20, %rsi
leaq 0x210(%rsp), %rdi
callq 0xcd60
movq $0x0, 0x208(%rsp)
movq 0x208(%rsp), %rax
cmpq 0x488(%rsp), %rax
jae 0xc79b
leaq 0x210(%rsp), %rdi
callq 0xcd90
movq %rax, %rdi
callq 0xcdf0
movq %rax, 0x200(%rsp)
movq 0x200(%rsp), %rdi
callq 0xce00
addq 0x238(%rsp), %rax
movq %rax, 0x238(%rsp)
movq 0x200(%rsp), %rdi
callq 0xce00
movq %rax, 0x1f8(%rsp)
leaq 0x1f8(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x9770
movq (%rax), %rax
movq %rax, 0x230(%rsp)
movq 0x200(%rsp), %rdi
callq 0xce50
movq %rax, %rdi
callq 0xce60
movq %rax, 0xa0(%rsp)
movq 0x200(%rsp), %rdi
callq 0xce50
movq %rax, %rdi
callq 0xce80
movq 0xa0(%rsp), %rdi
movq %rax, %rsi
callq 0xce10
movl (%rax), %eax
movq 0x270(%rsp,%rax,8), %rcx
addq $0x1, %rcx
movq %rcx, 0x270(%rsp,%rax,8)
movq 0x200(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xcea0
addq 0x268(%rsp), %rax
movq %rax, 0x268(%rsp)
movq 0x200(%rsp), %rdi
movl $0x73000000, %esi       # imm = 0x73000000
callq 0xcea0
addq 0x260(%rsp), %rax
movq %rax, 0x260(%rsp)
movq 0x200(%rsp), %rdi
movl $0x70000000, %esi       # imm = 0x70000000
callq 0xcea0
addq 0x258(%rsp), %rax
movq %rax, 0x258(%rsp)
movq 0x200(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xcf40
addq 0x250(%rsp), %rax
movq %rax, 0x250(%rsp)
movq 0x200(%rsp), %rdi
movl $0x73000000, %esi       # imm = 0x73000000
callq 0xcf40
addq 0x248(%rsp), %rax
movq %rax, 0x248(%rsp)
movq 0x200(%rsp), %rdi
movl $0x70000000, %esi       # imm = 0x70000000
callq 0xcf40
addq 0x240(%rsp), %rax
movq %rax, 0x240(%rsp)
movq 0x208(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x208(%rsp)
jmp 0xc5d9
xorl %eax, %eax
movl %eax, %esi
leaq 0xf0(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x4430
movq 0x98(%rsp), %rdi
movq 0xe80d(%rip), %rsi      # 0x1afd0
movq (%rsi), %rax
movq -0x18(%rax), %rax
addq %rax, %rsi
callq 0x4190
jmp 0xc7d4
movq 0xe7f5(%rip), %rdi      # 0x1afd0
leaq 0x86e(%rip), %rsi       # 0xd050
callq 0x4100
movq %rax, 0x90(%rsp)
jmp 0xc7f1
xorl %edi, %edi
callq 0xd070
movl %eax, 0x8c(%rsp)
jmp 0xc801
movq 0x90(%rsp), %rdi
movl 0x8c(%rsp), %eax
movl %eax, 0xe0(%rsp)
movl 0xe0(%rsp), %esi
callq 0x4450
jmp 0xc825
movq 0xb0(%rsp), %rax
movq 0x18(%rax), %rsi
movq 0xe798(%rip), %rdi      # 0x1afd0
callq 0x40c0
movq %rax, 0x80(%rsp)
jmp 0xc847
movq 0x80(%rsp), %rdi
leaq 0x6905(%rip), %rsi      # 0x1315b
callq 0x42e0
jmp 0xc85d
movq 0xe76c(%rip), %rdi      # 0x1afd0
leaq 0x68f2(%rip), %rsi      # 0x1315d
callq 0x42e0
movq %rax, 0x78(%rsp)
jmp 0xc877
movq 0x78(%rsp), %rdi
movq 0x238(%rsp), %rax
movq 0x488(%rsp), %rcx
xorl %edx, %edx
divq %rcx
movq %rax, %rsi
callq 0x40c0
movq %rax, 0x70(%rsp)
jmp 0xc8a0
movq 0x70(%rsp), %rdi
leaq 0x68b8(%rip), %rsi      # 0x13164
callq 0x42e0
jmp 0xc8b3
movq 0xe716(%rip), %rdi      # 0x1afd0
leaq 0x68a6(%rip), %rsi      # 0x13167
callq 0x42e0
movq %rax, 0x68(%rsp)
jmp 0xc8cd
movq 0x68(%rsp), %rdi
movq 0x230(%rsp), %rsi
callq 0x40c0
movq %rax, 0x60(%rsp)
jmp 0xc8e6
movq 0x60(%rsp), %rdi
leaq 0x6872(%rip), %rsi      # 0x13164
callq 0x42e0
jmp 0xc8f9
movq 0xe6d0(%rip), %rdi      # 0x1afd0
leaq 0x6867(%rip), %rsi      # 0x1316e
callq 0x42e0
movq %rax, 0x58(%rsp)
jmp 0xc913
movq 0x58(%rsp), %rdi
movaps 0x6711(%rip), %xmm1     # 0x13030
movq 0x268(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x670c(%rip), %xmm1     # 0x13040
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x6705(%rip), %xmm1     # 0x13050
mulsd %xmm1, %xmm0
cvtsi2sdq 0x250(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x4560
jmp 0xc964
movq 0xe665(%rip), %rdi      # 0x1afd0
leaq 0x6803(%rip), %rsi      # 0x13175
callq 0x42e0
movq %rax, 0x50(%rsp)
jmp 0xc97e
movq 0x50(%rsp), %rdi
movaps 0x66a6(%rip), %xmm1     # 0x13030
movq 0x260(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x66a1(%rip), %xmm1     # 0x13040
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x669a(%rip), %xmm1     # 0x13050
mulsd %xmm1, %xmm0
cvtsi2sdq 0x248(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x4560
jmp 0xc9cf
movq 0xe5fa(%rip), %rdi      # 0x1afd0
leaq 0x679b(%rip), %rsi      # 0x13178
callq 0x42e0
movq %rax, 0x48(%rsp)
jmp 0xc9e9
movq 0x48(%rsp), %rdi
movaps 0x663b(%rip), %xmm1     # 0x13030
movq 0x258(%rsp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x6636(%rip), %xmm1     # 0x13040
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x662f(%rip), %xmm1     # 0x13050
mulsd %xmm1, %xmm0
cvtsi2sdq 0x240(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x4560
movq %rax, 0x40(%rsp)
jmp 0xca3f
movq 0x40(%rsp), %rdi
leaq 0x6735(%rip), %rsi      # 0x13180
callq 0x42e0
jmp 0xca52
movq 0xe577(%rip), %rdi      # 0x1afd0
movq 0xe558(%rip), %rsi      # 0x1afb8
callq 0x4320
jmp 0xca67
movq 0xe562(%rip), %rdi      # 0x1afd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
leaq 0xf0(%rsp), %rsi
callq 0x4190
jmp 0xca87
testb $0x1, 0x49f(%rsp)
jne 0xcac7
movl $0x1, 0xdc(%rsp)
jmp 0xcd31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xe8(%rsp)
movl %eax, 0xe4(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x4530
jmp 0xcd46
movq $0x0, 0xd0(%rsp)
movq $0x0, 0xc8(%rsp)
movq 0xc8(%rsp), %rax
cmpq 0x488(%rsp), %rax
jae 0xcd11
movq 0xd0(%rsp), %rax
cmpq $0x0, 0x270(%rsp,%rax,8)
jne 0xcb0d
jmp 0xccdd
leaq 0x270(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xd0e0
movq 0x28(%rsp), %rdi
movq 0xd0(%rsp), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, 0x30(%rsp)
callq 0xd0f0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xd090
movq %rax, 0x38(%rsp)
jmp 0xcb52
movq 0x38(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq 0xe46a(%rip), %rdi      # 0x1afd0
leaq 0x65ee(%rip), %rsi      # 0x1315b
callq 0x42e0
movq %rax, 0x20(%rsp)
jmp 0xcb79
movq 0x20(%rsp), %rdi
movb 0xd0(%rsp), %cl
movl $0x1, %esi
shll %cl, %esi
andl $-0x2, %esi
callq 0x43b0
jmp 0xcb96
movq 0xe433(%rip), %rdi      # 0x1afd0
leaq 0x65b7(%rip), %rsi      # 0x1315b
callq 0x42e0
movq %rax, 0x18(%rsp)
jmp 0xcbb0
movq 0x18(%rsp), %rdi
movq 0xc0(%rsp), %xmm0
movaps 0x646b(%rip), %xmm3     # 0x13030
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x646f(%rip), %xmm2     # 0x13040
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x6470(%rip), %xmm1     # 0x13058
mulsd %xmm1, %xmm0
movq 0x488(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x4560
movq %rax, 0x10(%rsp)
jmp 0xcc18
movq 0x10(%rsp), %rdi
leaq 0x6556(%rip), %rsi      # 0x1317a
callq 0x42e0
jmp 0xcc2b
movq 0xe39e(%rip), %rdi      # 0x1afd0
leaq 0x6543(%rip), %rsi      # 0x1317c
callq 0x42e0
movq %rax, 0x8(%rsp)
jmp 0xcc45
movq 0x8(%rsp), %rdi
movq 0xd0(%rsp), %rax
movq 0x270(%rsp,%rax,8), %xmm0
movaps 0x63ce(%rip), %xmm3     # 0x13030
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x63d2(%rip), %xmm2     # 0x13040
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x63d3(%rip), %xmm1     # 0x13058
mulsd %xmm1, %xmm0
movq 0x488(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x4560
movq %rax, (%rsp)
jmp 0xccb4
movq (%rsp), %rdi
leaq 0x64c0(%rip), %rsi      # 0x1317f
callq 0x42e0
jmp 0xccc6
movq 0xe303(%rip), %rdi      # 0x1afd0
movq 0xe2e4(%rip), %rsi      # 0x1afb8
callq 0x4320
jmp 0xccdb
jmp 0xccdd
movq 0xd0(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0xd0(%rsp)
movq 0x270(%rsp,%rax,8), %rax
addq 0xc8(%rsp), %rax
movq %rax, 0xc8(%rsp)
jmp 0xcadf
movq 0xe2b8(%rip), %rdi      # 0x1afd0
movq 0xe299(%rip), %rsi      # 0x1afb8
callq 0x4320
jmp 0xcd26
movl $0x0, 0xdc(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x4530
addq $0x4a8, %rsp            # imm = 0x4A8
retq
movq 0xe8(%rsp), %rdi
callq 0x44f0
nopw %cs:(%rax,%rax)
nopl (%rax)