int run_mpool(pagesize, cachesize, hits, npages, progname)
int pagesize, cachesize, hits, npages;
const char *progname;
{
  int ret;
  if ((ret = init("mpool", pagesize, npages, progname)) != 0)
    return (ret);
  if ((ret = run(hits, cachesize, pagesize, npages, progname)) != 0)
    return (ret);
  return (0);
}


x86 assembly (clang, -O0):
<run_mpool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <init@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1167 <run_mpool+0x47>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119c <run_mpool+0x7c>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    $0x0,%al
call   1030 <run@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     1195 <run_mpool+0x75>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119c <run_mpool+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_mpool>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %ecx,%ebp
mov    %edx,%r12d
mov    %esi,%r15d
mov    %edi,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ecx,%edx
mov    %r8,%rcx
xor    %eax,%eax
call   1040 <init@plt>
test   %eax,%eax
je     1157 <run_mpool+0x37>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12d,%edi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14,%r8
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <run@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"mpool\00"
define i32 @run_mpool(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
%13 = load i32, i32* %7
%14 = load i32, i32* %10
%15 = load i8*, i8** %11
%16 = call i32 (i8*, i32, i32, i8*, ...) bitcast (i32 (...)* @init to i32 (i8*, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i8* %15)
store i32 %16, i32* %12
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %5
%19 = load i32, i32* %12
store i32 %19, i32* %6
br label %31
20: ; preds = %5
%21 = load i32, i32* %9
%22 = load i32, i32* %8
%23 = load i32, i32* %7
%24 = load i32, i32* %10
%25 = load i8*, i8** %11
%26 = call i32 (i32, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @run to i32 (i32, i32, i32, i32, i8*, ...)*)(i32 %21, i32 %22, i32 %23, i32 %24, i8* %25)
store i32 %26, i32* %12
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %20
%29 = load i32, i32* %12
store i32 %29, i32* %6
br label %31
30: ; preds = %20
store i32 0, i32* %6
br label %31
31: ; preds = %30, %28, %18
%32 = load i32, i32* %6
ret i32 %32
}

LLVM IR (-O2):
@.str = [6 x i8] c"mpool\00"
define i32 @run_mpool(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 (i8*, i32, i32, i8*, ...) bitcast (i32 (...)* @init to i32 (i8*, i32, i32, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3, i8* %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (i32, i32, i32, i32, i8*, ...) bitcast (i32 (...)* @run to i32 (i32, i32, i32, i32, i8*, ...)*)(i32 %2, i32 %1, i32 %0, i32 %3, i8* %4)
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %6, %5 ], [ %9, %8 ]
ret i32 %11
}