// File: /workspace/github_c_makefile_star2_O1/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 0x82e9(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
leaq 0x22c8(%rip), %rsi      # 0x7d59
xorl %eax, %eax
callq 0x2180
leaq 0x22cf(%rip), %rdi      # 0x7d6e
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2200
movq 0x82b8(%rip), %rax      # 0xdd70
movl 0x8(%rax), %ecx
movl %ecx, %eax
shrl $0x1f, %eax
addl %ecx, %eax
sarl %eax
addl 0x8412(%rip), %eax      # 0xdedc
cltd
idivl %ecx
leaq 0x224b(%rip), %rsi      # 0x7d1f
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x2180
leaq 0x1df8(%rip), %r14      # 0x78df
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20e0
leaq 0x228e(%rip), %rdi      # 0x7d87
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2200
movl 0x83cf(%rip), %esi      # 0xdee0
movq 0x8258(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
leaq 0x17b3(%rip), %r15      # 0x72d5
movq %rbx, %rdi
movl $0x2, %ecx
movq %r15, %r8
callq 0x613b
movl 0x83ac(%rip), %esi      # 0xdee4
movq 0x8231(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r15, %r8
callq 0x613b
movl 0x8390(%rip), %esi      # 0xdee8
movq 0x8211(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r15, %r8
callq 0x613b
movl 0x8374(%rip), %esi      # 0xdeec
movq 0x81f1(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
movq %rbx, %rdi
movl $0x2, %ecx
movq %r14, %r8
callq 0x613b
leaq 0x2204(%rip), %rdi      # 0x7d9d
movl $0x28, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2200
leaq 0x1c3e(%rip), %r14      # 0x77f0
leaq 0x8323(%rip), %rbp      # 0xdedc
leaq 0x2213(%rip), %r15      # 0x7dd3
leaq 0x2210(%rip), %r12      # 0x7dd7
xorl %r13d, %r13d
cmpl $0x0, 0x14(%rbp,%r13,4)
je 0x5c21
movq %rbx, %rdi
leaq 0x21ea(%rip), %rsi      # 0x7dc6
movl %r13d, %edx
xorl %eax, %eax
callq 0x2180
imull $0x64, 0x14(%rbp,%r13,4), %esi
movq 0x817d(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
shll $0x2, %edx
movq %rbx, %rdi
movl $0x4, %ecx
movq %r15, %r8
callq 0x613b
movl (%r14), %esi
movq %rbx, %rdi
movl $0x2710, %edx           # imm = 0x2710
movl $0x4, %ecx
movq %r12, %r8
callq 0x613b
incq %r13
addq $0x4, %r14
cmpq $0x26, %r13
jne 0x5bca
leaq 0x21a6(%rip), %rdi      # 0x7ddb
movl $0x2d, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2200
leaq 0x2059(%rip), %rax      # 0x7ca7
movq %rax, (%rsp)
leaq 0x21b0(%rip), %rsi      # 0x7e09
leaq 0x21c1(%rip), %rdx      # 0x7e21
leaq 0x2045(%rip), %rcx      # 0x7cac
leaq 0x2044(%rip), %r8       # 0x7cb2
leaq 0x2042(%rip), %r9       # 0x7cb7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2180
cmpl $0x4, 0x83e2(%rip)      # 0xe068
jl 0x5d10
leaq 0x1bfd(%rip), %r13      # 0x7890
leaq 0x1c45(%rip), %r15      # 0x78df
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 0x215a(%rip), %rsi      # 0x7e28
movl %r12d, %edx
xorl %eax, %eax
callq 0x2180
imull $0x64, 0x10(%r13,%r14,4), %esi
movq 0x808b(%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 0x613b
movslq 0x8360(%rip), %rax      # 0xe068
incq %r14
cmpq %rax, %r12
jl 0x5c9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq