// File: /workspace/github_c_makefile_star2_O3/hansvanstaveren[P]BigDeal/output.c
// Function: print_stat
static void
print_stat(FILE *out)
{
	int i, length;

	fprintf(out, "Number of deals: %d\n", prparp->pp_nboards);

	fprintf(out, "Average sum of squares: ");
	print_avg(out, stats.st_sumsquare, prparp->pp_nboards, 0, "\n");

	fprintf(out, "Average points NESW: ");
	print_avg(out, stats.st_hcp[0], prparp->pp_nboards, 2, " ");
	print_avg(out, stats.st_hcp[1], prparp->pp_nboards, 2, " ");
	print_avg(out, stats.st_hcp[2], prparp->pp_nboards, 2, " ");
	print_avg(out, stats.st_hcp[3], prparp->pp_nboards, 2, "\n");

	fprintf(out, "Frequency of high card points per hand:\n");
	for (i=0; i<38; i++) {
		if (stats.st_hcpfreq[i] == 0)
			continue;
		fprintf(out, "%2d points: ", i);
		print_avg(out, stats.st_hcpfreq[i]*100, prparp->pp_nboards*4, 4, "% (");
		print_avg(out, theory_hcpfreq[i], 10000, 4, "%)\n");
	}

	fprintf(out, "Frequency of longest suitlength per compass:\n");
	fprintf(out, "%8s%8s%8s%8s%8s Theory\n", "Length",
		"North", "East", "South", "West");
	for(length = 4; length <= stats.st_longestsuit; length++) {
		fprintf(out, "%8d%8d%8d%8d%8d ", length,
			stats.st_lsuitfreq[COMPASS_NORTH][length],
			stats.st_lsuitfreq[COMPASS_EAST][length],
			stats.st_lsuitfreq[COMPASS_SOUTH][length],
			stats.st_lsuitfreq[COMPASS_WEST][length]);
		print_avg(out, 100*theory_lsuitfreq[length],
			100000000/prparp->pp_nboards, 1, "\n");
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8299(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
leaq 0x22f8(%rip), %rsi      # 0x7dd9
xorl %eax, %eax
callq 0x2180
leaq 0x22ff(%rip), %rdi      # 0x7dee
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2200
movq 0x8268(%rip), %rax      # 0xdd70
movl 0x8(%rax), %ecx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
addl 0x83c2(%rip), %eax      # 0xdedc
cltd
idivl %ecx
leaq 0x227b(%rip), %rsi      # 0x7d9f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2180
leaq 0x1e28(%rip), %r14      # 0x795f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20e0
leaq 0x22be(%rip), %rdi      # 0x7e07
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2200
movl 0x837f(%rip), %esi      # 0xdee0
movq 0x8208(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
leaq 0x1763(%rip), %r15      # 0x72d5
movq %rbx, %rdi
movl $0x2, %ecx
movq %r15, %r8
callq 0x618b
movl 0x835c(%rip), %esi      # 0xdee4
movq 0x81e1(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r15, %r8
callq 0x618b
movl 0x8340(%rip), %esi      # 0xdee8
movq 0x81c1(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r15, %r8
callq 0x618b
movl 0x8324(%rip), %esi      # 0xdeec
movq 0x81a1(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r14, %r8
callq 0x618b
leaq 0x2234(%rip), %rdi      # 0x7e1d
movl $0x28, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2200
leaq 0x1c6e(%rip), %r14      # 0x7870
leaq 0x82d3(%rip), %rbp      # 0xdedc
leaq 0x2243(%rip), %r15      # 0x7e53
leaq 0x2240(%rip), %r12      # 0x7e57
xorl %r13d, %r13d
cmpl $0x0, 0x14(%rbp,%r13,4)
je 0x5c71
movq %rbx, %rdi
leaq 0x221a(%rip), %rsi      # 0x7e46
movl %r13d, %edx
xorl %eax, %eax
callq 0x2180
imull $0x64, 0x14(%rbp,%r13,4), %esi
movq 0x812d(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
shll $0x2, %edx
movq %rbx, %rdi
movl $0x4, %ecx
movq %r15, %r8
callq 0x618b
movl (%r14), %esi
movq %rbx, %rdi
movl $0x2710, %edx           # imm = 0x2710
movl $0x4, %ecx
movq %r12, %r8
callq 0x618b
incq %r13
addq $0x4, %r14
cmpq $0x26, %r13
jne 0x5c1a
leaq 0x21d6(%rip), %rdi      # 0x7e5b
movl $0x2d, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2200
leaq 0x2089(%rip), %rax      # 0x7d27
movq %rax, (%rsp)
leaq 0x21e0(%rip), %rsi      # 0x7e89
leaq 0x21f1(%rip), %rdx      # 0x7ea1
leaq 0x2075(%rip), %rcx      # 0x7d2c
leaq 0x2074(%rip), %r8       # 0x7d32
leaq 0x2072(%rip), %r9       # 0x7d37
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2180
cmpl $0x4, 0x8392(%rip)      # 0xe068
jl 0x5d60
leaq 0x1c2d(%rip), %r13      # 0x7910
leaq 0x1c75(%rip), %r15      # 0x795f
xorl %r14d, %r14d
movl 0xbc(%rbp,%r14,4), %ecx
movl 0xf4(%rbp,%r14,4), %r8d
movl 0x12c(%rbp,%r14,4), %r9d
movl 0x164(%rbp,%r14,4), %eax
leaq 0x4(%r14), %r12
movl %eax, (%rsp)
movq %rbx, %rdi
leaq 0x218a(%rip), %rsi      # 0x7ea8
movl %r12d, %edx
xorl %eax, %eax
callq 0x2180
imull $0x64, 0x10(%r13,%r14,4), %esi
movq 0x803b(%rip), %rcx      # 0xdd70
movl $0x5f5e100, %eax        # imm = 0x5F5E100
xorl %edx, %edx
idivl 0x8(%rcx)
movq %rbx, %rdi
movl %eax, %edx
movl $0x1, %ecx
movq %r15, %r8
callq 0x618b
movslq 0x8310(%rip), %rax      # 0xe068
incq %r14
cmpq %rax, %r12
jl 0x5ced
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq