// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x368, %rsp            # imm = 0x368
movq %rdx, %r14
movl %esi, 0xc(%rsp)
movq %rdi, %rbx
addq $0x20, %rdi
callq 0x5158
movq %rax, %r15
testq %r14, %r14
jne 0x5ad6
movq 0x8(%rbx), %r14
cmpq %r15, %r14
cmovbq %r14, %r15
leaq 0x160(%rsp), %rdi
movq $0x0, 0x10(%rsp)
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x3190
movq 0x50(%rbx), %r13
movq 0x58(%rbx), %rbp
movq %rbx, 0x50(%rsp)
movq 0x68(%rbx), %rax
movq %rax, 0x20(%rsp)
movq %r15, (%rsp)
xorl %ebx, %ebx
movq $0x0, 0x38(%rsp)
xorl %r14d, %r14d
movq $0x0, 0x48(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
subq $0x1, %r15
jb 0x5c0e
cmpq %rbp, %r13
jne 0x5b6e
movq 0x20(%rsp), %rax
movq -0x8(%rax), %rbp
addq $-0x8, %rax
movq %rax, 0x20(%rsp)
leaq 0x180(%rbp), %r13
leaq -0xc0(%r13), %r12
movq -0x78(%r13), %rax
addq %rax, 0x48(%rsp)
movq 0x10(%rsp), %rcx
cmpq %rcx, %rax
cmovaq %rax, %rcx
movq %rcx, 0x10(%rsp)
leaq -0x80(%r13), %rsi
movq %r12, %rdi
callq 0x6001
movl (%rax), %eax
incq 0x160(%rsp,%rax,8)
movq -0x68(%r13), %rax
subq -0x70(%r13), %rax
shrq $0x5, %rax
movslq %eax, %rsi
addq %rsi, 0x40(%rsp)
leal -0x1(%rsi), %ecx
movl %ecx, %eax
cltd
pushq $0x2
popq %rdi
idivl %edi
cltq
addq %rax, 0x30(%rsp)
movl %ecx, %eax
cltd
pushq $-0x2
popq %rcx
idivl %ecx
addl %esi, %eax
cltq
addq %rax, 0x28(%rsp)
addq -0x8(%r13), %rbx
subq -0x30(%r13), %rbx
movq %r12, %rdi
movl $0x73000000, %esi       # imm = 0x73000000
callq 0x5f98
addq %rax, 0x38(%rsp)
movq %r12, %rdi
movl $0x70000000, %esi       # imm = 0x70000000
callq 0x5f98
addq %rax, %r14
movq %r12, %r13
jmp 0x5b46
movq %r14, %r15
leaq 0x58(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x3430
movq 0x73a9(%rip), %r13      # 0xcfd0
movq (%r13), %rax
movq -0x18(%rax), %rsi
addq %r13, %rsi
movq %r14, %rdi
callq 0x3160
movq (%r13), %rax
movq -0x18(%rax), %rcx
movl $0xfffffefb, %edx       # imm = 0xFFFFFEFB
andl 0x18(%r13,%rcx), %edx
orl $0x4, %edx
movl %edx, 0x18(%r13,%rcx)
movq -0x18(%rax), %rax
andq $0x0, 0x8(%r13,%rax)
movq 0x50(%rsp), %rax
movq 0x18(%rax), %rsi
movq %r13, %rdi
callq 0x31e0
leaq 0x24e5(%rip), %rsi      # 0x815b
movq %rax, %rdi
callq 0x3270
movq 0x734b(%rip), %rdi      # 0xcfd0
leaq 0x24d1(%rip), %rsi      # 0x815d
callq 0x3270
movq %rax, %rdi
movq 0x48(%rsp), %rax
xorl %edx, %edx
divq (%rsp)
movq %rax, %rsi
callq 0x31e0
leaq 0x24b6(%rip), %rsi      # 0x8164
movq %rax, %rdi
callq 0x3270
movq 0x7313(%rip), %rdi      # 0xcfd0
leaq 0x24a3(%rip), %rsi      # 0x8167
callq 0x3270
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x31e0
leaq 0x2487(%rip), %rsi      # 0x8164
movq %rax, %rdi
callq 0x3270
movq 0x72e4(%rip), %rdi      # 0xcfd0
leaq 0x247b(%rip), %rsi      # 0x816e
callq 0x3270
movsd 0x40(%rsp), %xmm1
unpcklps 0x231b(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2323(%rip), %xmm1     # 0x8030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x232f(%rip), %xmm0     # 0x8050
cvtsi2sd %rbx, %xmm1
divsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x33c0
movq 0x7297(%rip), %rdi      # 0xcfd0
leaq 0x2435(%rip), %rsi      # 0x8175
callq 0x3270
movsd 0x30(%rsp), %xmm1
unpcklps 0x22ce(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x22d6(%rip), %xmm1     # 0x8030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x22e2(%rip), %xmm0     # 0x8050
cvtsi2sdq 0x38(%rsp), %xmm1
divsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x33c0
movq 0x7248(%rip), %rdi      # 0xcfd0
leaq 0x23e9(%rip), %rsi      # 0x8178
callq 0x3270
movsd 0x28(%rsp), %xmm1
unpcklps 0x227f(%rip), %xmm1     # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2287(%rip), %xmm1     # 0x8030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x2293(%rip), %xmm0     # 0x8050
cvtsi2sd %r15, %xmm1
divsd %xmm1, %xmm0
movq %rax, %rdi
callq 0x33c0
leaq 0x23ab(%rip), %rsi      # 0x8180
movq %rax, %rdi
callq 0x3270
movq 0x71ec(%rip), %r14      # 0xcfd0
movq %r14, %rdi
callq 0x3170
movq (%r14), %rax
addq -0x18(%rax), %r14
leaq 0x58(%rsp), %rsi
movq %r14, %rdi
callq 0x3160
cmpb $0x0, 0xc(%rsp)
je 0x5f65
movsd (%rsp), %xmm0
unpcklps 0x2209(%rip), %xmm0     # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0x2211(%rip), %xmm0     # 0x8030
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
xorl %r14d, %r14d
movq 0x7195(%rip), %r15      # 0xcfd0
leaq 0x2319(%rip), %r12      # 0x815b
xorl %ebx, %ebx
cmpq (%rsp), %rbx
jae 0x5f59
movq 0x160(%rsp,%r14,8), %rbp
testq %rbp, %rbp
je 0x5f4e
leaq (,%r14,8), %rax
xorl %r13d, %r13d
cmpq $0x200, %rax            # imm = 0x200
je 0x5e80
addq 0x160(%rsp,%rax), %r13
addq $0x8, %rax
jmp 0x5e6a
movq %r15, %rdi
movq %r12, %rsi
callq 0x3270
pushq $0x1
popq %rcx
movl %ecx, %esi
movl %r14d, %ecx
shll %cl, %esi
andl $-0x2, %esi
movq %rax, %rdi
callq 0x31e0
movq %r15, %rdi
movq %r12, %rsi
callq 0x3270
movq %r13, %xmm1
punpckldq 0x2168(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2170(%rip), %xmm1     # 0x8030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x2184(%rip), %xmm0     # 0x8058
divsd 0x10(%rsp), %xmm0
movq %rax, %rdi
callq 0x33c0
movq %rax, %rdi
leaq 0x228e(%rip), %rsi      # 0x817a
callq 0x3270
movq %r15, %rdi
leaq 0x2281(%rip), %rsi      # 0x817c
callq 0x3270
movq %rbp, %xmm1
punpckldq 0x2113(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x211b(%rip), %xmm1     # 0x8030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
mulsd 0x212f(%rip), %xmm0     # 0x8058
divsd 0x10(%rsp), %xmm0
movq %rax, %rdi
callq 0x33c0
movq %rax, %rdi
leaq 0x223e(%rip), %rsi      # 0x817f
callq 0x3270
movq %r15, %rdi
callq 0x3170
incq %r14
addq %rbp, %rbx
jmp 0x5e44
movq 0x7070(%rip), %rdi      # 0xcfd0
callq 0x3170
leaq 0x58(%rsp), %rdi
callq 0x30e0
addq $0x368, %rsp            # imm = 0x368
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5f83
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x30e0
movq %rbx, %rdi
callq 0x3420