#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dump_hash_results(char *name, int counts[10][10]) {
  int srv, nsrv;
  printf("%s:\n", name);
  for (nsrv = 0; nsrv < 10; nsrv++) {
    printf("%02d srv: ", nsrv + 1);
    for (srv = 0; srv <= nsrv; srv++) {
      printf("%3.1f ",
             100.0 * (counts[nsrv][srv] - (double)counts[0][0] / (nsrv + 1)) /
                 (double)counts[0][0]);
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_hash_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    11ec <dump_hash_results+0xdc>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     11d0 <dump_hash_results+0xc0>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mov    -0x10(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movsd  0xe5c(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
cvtsi2sdl (%rax),%xmm1
divsd  %xmm1,%xmm0
lea    0xe5d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115e <dump_hash_results+0x4e>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1139 <dump_hash_results+0x29>
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_hash_results>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
lea    0xecd(%rip),%r15
mov    %r13,%rbp
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
lea    0xea2(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movsd  %xmm0,(%rsp)
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm0,%xmm0
cvtsi2sdl 0x0(%rbp,%r14,4),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x0(%r13),%xmm1
movapd %xmm1,%xmm2
divsd  (%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  0xe48(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%rbx
jne    1190 <dump_hash_results+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
add    $0x28,%rbp
cmp    $0xa,%r12
jne    1160 <dump_hash_results+0x40>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s:\0A\00"
@.str.1 = [11 x i8] c"%02d srv: \00"
@.str.2 = [7 x i8] c"%3.1f \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @dump_hash_results(i8* %0, [10 x i32]* %1) {
%3 = alloca i8*
%4 = alloca [10 x i32]*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store [10 x i32]* %1, [10 x i32]** %4
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 0, i32* %6
br label %9
9: ; preds = %53, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %56
12: ; preds = %9
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i32 0, i32* %5
br label %16
16: ; preds = %48, %12
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %51
20: ; preds = %16
%21 = load [10 x i32]*, [10 x i32]** %4
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %21, i64 %23
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [10 x i32], [10 x i32]* %24, i64 0, i64 %26
%28 = load i32, i32* %27
%29 = sitofp i32 %28 to double
%30 = load [10 x i32]*, [10 x i32]** %4
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %30, i64 0
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %31, i64 0, i64 0
%33 = load i32, i32* %32
%34 = sitofp i32 %33 to double
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
%37 = sitofp i32 %36 to double
%38 = fdiv double %34, %37
%39 = fsub double %29, %38
%40 = fmul double 1.000000e+02, %39
%41 = load [10 x i32]*, [10 x i32]** %4
%42 = getelementptr inbounds [10 x i32], [10 x i32]* %41, i64 0
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %42, i64 0, i64 0
%44 = load i32, i32* %43
%45 = sitofp i32 %44 to double
%46 = fdiv double %40, %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %46)
br label %48
48: ; preds = %20
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %16
51: ; preds = %16
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %51
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %9
56: ; preds = %9
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s:\0A\00"
@.str.1 = [11 x i8] c"%02d srv: \00"
@.str.2 = [7 x i8] c"%3.1f \00"
define void @dump_hash_results(i8* %0, [10 x i32]* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
br label %5
5: ; preds = %2, %26
%6 = phi i64 [ 0, %2 ], [ %8, %26 ]
%7 = phi i64 [ 1, %2 ], [ %28, %26 ]
%8 = add nuw nsw i64 %6, 1
%9 = trunc i64 %8 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = sitofp i32 %9 to double
br label %12
12: ; preds = %5, %12
%13 = phi i64 [ 0, %5 ], [ %24, %12 ]
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 %6, i64 %13
%15 = load i32, i32* %14
%16 = sitofp i32 %15 to double
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, %11
%20 = fsub double %16, %19
%21 = fmul double %20, 1.000000e+02
%22 = fdiv double %21, %18
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %22)
%24 = add nuw nsw i64 %13, 1
%25 = icmp eq i64 %24, %7
br i1 %25, label %26, label %12
26: ; preds = %12
%27 = tail call i32 @putchar(i32 10)
%28 = add nuw nsw i64 %7, 1
%29 = icmp eq i64 %8, 10
br i1 %29, label %30, label %5
30: ; preds = %26
%31 = tail call i32 @putchar(i32 10)
ret void
}