#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 atoi(char *);
int /*<<< orphan*/ func(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc != 3) {
    printf("This program requires 2 arguments.\n");
    printf("./executable <string> <iterations>\n");
    return 0;
  }
  int i;
  for (i = 0; i < atoi(argv[2]); ++i) {
    func(argv[1]);
  }
}


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)
cmpl   $0x3,-0x8(%rbp)
je     1174 <main+0x44>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11b6 <main+0x86>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    11b6 <main+0x86>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <func@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117b <main+0x4b>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x3,%edi
jne    116b <main+0x3b>
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   1050 <atoi@plt>
test   %eax,%eax
jle    1183 <main+0x53>
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    0x8(%rbx),%rdi
call   1040 <func@plt>
add    $0x1,%ebp
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
cmp    %eax,%ebp
jl     1150 <main+0x20>
jmp    1183 <main+0x53>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"This program requires 2 arguments.\0A\00"
@.str.1 = [36 x i8] c"./executable <string> <iterations>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 3
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %28
12: ; preds = %2
store i32 0, i32* %6
br label %13
13: ; preds = %25, %12
%14 = load i32, i32* %6
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = icmp slt i32 %14, %18
br i1 %19, label %20, label %28
20: ; preds = %13
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @func(i8* %23)
br label %25
25: ; preds = %20
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %13
28: ; preds = %9, %13
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@str = [35 x i8] c"This program requires 2 arguments.\00"
@str.2 = [35 x i8] c"./executable <string> <iterations>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 2
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 1
br label %14
11: ; preds = %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.2, i64 0, i64 0))
br label %22
14: ; preds = %9, %14
%15 = phi i32 [ 0, %9 ], [ %18, %14 ]
%16 = load i8*, i8** %10
%17 = tail call i32 @func(i8* %16)
%18 = add nuw nsw i32 %15, 1
%19 = load i8*, i8** %5
%20 = tail call i32 @atoi(i8* %19)
%21 = icmp slt i32 %18, %20
br i1 %21, label %14, label %22
22: ; preds = %14, %4, %11
ret i32 0
}