#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_mul(int, int);
int main(int argc, char **argv) {
  int size_inc = 100;
  int reps = 10;
  int i;
  for (i = 1; i < 21; ++i) {
    benchmark_mul(i * size_inc, reps);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x15,-0x1c(%rbp)
jge    1162 <main+0x52>
mov    -0x1c(%rbp),%edi
imul   -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <benchmark_mul@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0xc8,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x12c,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x190,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x1f4,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x258,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x2bc,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x320,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x384,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x3e8,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x44c,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x4b0,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x514,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x578,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x5dc,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x640,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x6a4,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x708,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x76c,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
mov    $0x7d0,%edi
mov    $0xa,%esi
call   1030 <benchmark_mul@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %6
store i32 10, i32* %7
store i32 1, i32* %8
br label %9
9: ; preds = %18, %2
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 21
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32, i32* %8
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %7
%17 = call i32 @benchmark_mul(i32 %15, i32 %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %8
%20 = add nsw i32 %19, 1
store i32 %20, i32* %8
br label %9
21: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @benchmark_mul(i32 100, i32 10)
%4 = tail call i32 @benchmark_mul(i32 200, i32 10)
%5 = tail call i32 @benchmark_mul(i32 300, i32 10)
%6 = tail call i32 @benchmark_mul(i32 400, i32 10)
%7 = tail call i32 @benchmark_mul(i32 500, i32 10)
%8 = tail call i32 @benchmark_mul(i32 600, i32 10)
%9 = tail call i32 @benchmark_mul(i32 700, i32 10)
%10 = tail call i32 @benchmark_mul(i32 800, i32 10)
%11 = tail call i32 @benchmark_mul(i32 900, i32 10)
%12 = tail call i32 @benchmark_mul(i32 1000, i32 10)
%13 = tail call i32 @benchmark_mul(i32 1100, i32 10)
%14 = tail call i32 @benchmark_mul(i32 1200, i32 10)
%15 = tail call i32 @benchmark_mul(i32 1300, i32 10)
%16 = tail call i32 @benchmark_mul(i32 1400, i32 10)
%17 = tail call i32 @benchmark_mul(i32 1500, i32 10)
%18 = tail call i32 @benchmark_mul(i32 1600, i32 10)
%19 = tail call i32 @benchmark_mul(i32 1700, i32 10)
%20 = tail call i32 @benchmark_mul(i32 1800, i32 10)
%21 = tail call i32 @benchmark_mul(i32 1900, i32 10)
%22 = tail call i32 @benchmark_mul(i32 2000, i32 10)
ret i32 0
}