// File: /workspace/github_c_makefile_star2_O2/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 0x86c2(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
leaq 0x26a1(%rip), %rsi      # 0x7d59
xorl %eax, %eax
callq 0x2170
leaq 0x26a8(%rip), %rdi      # 0x7d6e
pushq $0x18
popq %rsi
pushq $0x1
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x21f0
movl 0x87fe(%rip), %esi      # 0xdedc
movq 0x868b(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
leaq 0x21f0(%rip), %r15      # 0x78df
movq %rbx, %rdi
xorl %ecx, %ecx
movq %r15, %r8
callq 0x5d19
leaq 0x2684(%rip), %rdi      # 0x7d87
pushq $0x15
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x21f0
movl 0x87c9(%rip), %esi      # 0xdee0
movq 0x8652(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
leaq 0x1bad(%rip), %r12      # 0x72d5
pushq $0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %ecx
movq %r12, %r8
callq 0x5d19
movl 0x87a6(%rip), %esi      # 0xdee4
movq 0x862b(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
movq %rbx, %rdi
movl %ebp, %ecx
movq %r12, %r8
callq 0x5d19
movl 0x878d(%rip), %esi      # 0xdee8
movq 0x860e(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
movq %rbx, %rdi
movl %ebp, %ecx
movq %r12, %r8
callq 0x5d19
movl 0x8774(%rip), %esi      # 0xdeec
movq 0x85f1(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
movq %rbx, %rdi
movl %ebp, %ecx
movq %r15, %r8
callq 0x5d19
leaq 0x2607(%rip), %rdi      # 0x7d9d
pushq $0x28
popq %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x21f0
leaq 0x2045(%rip), %r14      # 0x77f0
leaq 0x872a(%rip), %r15      # 0xdedc
pushq $0x4
popq %rbp
leaq 0x261b(%rip), %r12      # 0x7dd7
xorl %r13d, %r13d
cmpq $0x26, %r13
je 0x5823
cmpl $0x0, 0x14(%r15,%r13,4)
je 0x581a
movq %rbx, %rdi
leaq 0x25ef(%rip), %rsi      # 0x7dc6
movl %r13d, %edx
xorl %eax, %eax
callq 0x2170
imull $0x64, 0x14(%r15,%r13,4), %esi
movq 0x8582(%rip), %rax      # 0xdd70
movl 0x8(%rax), %edx
shll $0x2, %edx
movq %rbx, %rdi
movl %ebp, %ecx
leaq 0x25d3(%rip), %r8       # 0x7dd3
callq 0x5d19
movl (%r14), %esi
movq %rbx, %rdi
movl $0x2710, %edx           # imm = 0x2710
movl %ebp, %ecx
movq %r12, %r8
callq 0x5d19
incq %r13
addq $0x4, %r14
jmp 0x57bf
leaq 0x25b1(%rip), %rdi      # 0x7ddb
pushq $0x2d
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x21f0
leaq 0x2468(%rip), %rax      # 0x7ca7
movq %rax, (%rsp)
leaq 0x25bf(%rip), %rsi      # 0x7e09
leaq 0x25d0(%rip), %rdx      # 0x7e21
leaq 0x2454(%rip), %rcx      # 0x7cac
leaq 0x2453(%rip), %r8       # 0x7cb2
leaq 0x2451(%rip), %r9       # 0x7cb7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2170
pushq $0x4
popq %r14
leaq 0x871d(%rip), %r13      # 0xdf98
leaq 0x200e(%rip), %r15      # 0x7890
leaq 0x2056(%rip), %r12      # 0x78df
pushq $0x1
popq %rbp
movslq 0x87d5(%rip), %rax      # 0xe068
cmpq %rax, %r14
jg 0x58f0
movl (%r13), %ecx
movl 0x38(%r13), %r8d
movl 0x70(%r13), %r9d
movl 0xa8(%r13), %eax
movl %eax, (%rsp)
movq %rbx, %rdi
leaq 0x2570(%rip), %rsi      # 0x7e28
movl %r14d, %edx
xorl %eax, %eax
callq 0x2170
imull $0x64, (%r15,%r14,4), %esi
movq 0x84a2(%rip), %rcx      # 0xdd70
movl $0x5f5e100, %eax        # imm = 0x5F5E100
xorl %edx, %edx
idivl 0x8(%rcx)
movq %rbx, %rdi
movl %eax, %edx
movl %ebp, %ecx
movq %r12, %r8
callq 0x5d19
incq %r14
addq $0x4, %r13
jmp 0x588c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq