#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 */
struct hash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t, size_t, size_t,
                           size_t);
int /*<<< orphan*/ hash_stats(struct hash *, size_t *, size_t *, size_t *,
                              size_t *);
int /*<<< orphan*/ stdout;
void print_hash_stat(struct hash *c) {
  size_t cap = 0, used = 0, cls = 0, maxb = 0;
  hash_stats(c, &cap, &used, &cls, &maxb);
  fprintf(stdout,
          "capacity:         %zu\n"
          "used:             %zu\n"
          "collisions (avg): %zu\n"
          "max. row:         %zu\n",
          cap, used, cls, maxb);
}


x86 assembly (clang, -O0):
<print_hash_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1040 <hash_stats@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xe7b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hash_stat>:
sub    $0x28,%rsp
movq   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x20(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1040 <hash_stats@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%r8
mov    0x8(%rsp),%r9
lea    0xe7b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.hash = type { i32 }
@stdout = global i32 0
@.str = [89 x i8] c"capacity: %zu\0Aused: %zu\0Acollisions (avg): %zu\0Amax. row: %zu\0A\00"
define void @print_hash_stat(%struct.hash* %0) {
%2 = alloca %struct.hash*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store %struct.hash* %0, %struct.hash** %2
store i64 0, i64* %3
store i64 0, i64* %4
store i64 0, i64* %5
store i64 0, i64* %6
%7 = load %struct.hash*, %struct.hash** %2
%8 = call i32 @hash_stats(%struct.hash* %7, i64* %3, i64* %4, i64* %5, i64* %6)
%9 = load i32, i32* @stdout
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = load i64, i64* %6
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i64 %10, i64 %11, i64 %12, i64 %13)
ret void
}

LLVM IR (-O2):
%struct.hash = type { i32 }
@stdout = global i32 0
@.str = [89 x i8] c"capacity: %zu\0Aused: %zu\0Acollisions (avg): %zu\0Amax. row: %zu\0A\00"
define void @print_hash_stat(%struct.hash* %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%7 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%8 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%9 = bitcast i64* %5 to i8*
store i64 0, i64* %5
%10 = call i32 @hash_stats(%struct.hash* %0, i64* %2, i64* %3, i64* %4, i64* %5)
%11 = load i32, i32* @stdout
%12 = load i64, i64* %2
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13, i64 %14, i64 %15)
ret void
}