#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*/ benchmark(int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
void bench(int copysize, int times) {
  printf("benchmark(size=%d bytes, times=%d):\n", copysize, times);
  benchmark(1, 1, copysize, times);
  benchmark(1, 0, copysize, times);
  benchmark(0, 1, copysize, times);
  benchmark(0, 0, copysize, times);
  printf("\n");
}


x86 assembly (clang, -O0):
<bench>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%esi
mov    %esi,%edi
call   1040 <benchmark@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <benchmark@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <benchmark@plt>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <benchmark@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bench>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xec2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1050 <benchmark@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1050 <benchmark@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1050 <benchmark@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1050 <benchmark@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"benchmark(size=%d bytes, times=%d):\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @bench(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @benchmark(i32 1, i32 1, i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @benchmark(i32 1, i32 0, i32 %11, i32 %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @benchmark(i32 0, i32 1, i32 %14, i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = call i32 @benchmark(i32 0, i32 0, i32 %17, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"benchmark(size=%d bytes, times=%d):\0A\00"
define void @bench(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 @benchmark(i32 1, i32 1, i32 %0, i32 %1)
%5 = tail call i32 @benchmark(i32 1, i32 0, i32 %0, i32 %1)
%6 = tail call i32 @benchmark(i32 0, i32 1, i32 %0, i32 %1)
%7 = tail call i32 @benchmark(i32 0, i32 0, i32 %0, i32 %1)
%8 = tail call i32 @putchar(i32 10)
ret void
}