#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*/ InitDynace(int *);
int atoi(char *);
int /*<<< orphan*/ fun(int);
int main(int argc, char *argv[]) {
  int m = 1, i;
  InitDynace(&argc);
  if (argc > 1)
    m = atoi(argv[1]);
  for (i = 0; i++ < m;)
    fun(i);
  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   $0x1,-0x14(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <InitDynace@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1170 <main+0x40>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
cmp    -0x14(%rbp),%eax
jge    1198 <main+0x68>
mov    -0x18(%rbp),%edi
call   1030 <fun@plt>
jmp    1177 <main+0x47>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1050 <InitDynace@plt>
mov    $0x1,%ebx
cmpl   $0x2,0xc(%rsp)
mov    $0x1,%r14d
jl     116c <main+0x3c>
mov    0x8(%r15),%rdi
call   1040 <atoi@plt>
mov    %eax,%r14d
test   %eax,%eax
jle    118a <main+0x5a>
neg    %r14d
nop
mov    %ebx,%edi
call   1030 <fun@plt>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%8 = call i32 @InitDynace(i32* %4)
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
br label %16
16: ; preds = %11, %2
store i32 0, i32* %7
br label %17
17: ; preds = %22, %16
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
%20 = load i32, i32* %6
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load i32, i32* %7
%24 = call i32 @fun(i32 %23)
br label %17
25: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @InitDynace(i32* %3)
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %2, %7
%13 = phi i32 [ %10, %7 ], [ 1, %2 ]
br label %14
14: ; preds = %12, %14
%15 = phi i32 [ %17, %14 ], [ 1, %12 ]
%16 = call i32 @fun(i32 %15)
%17 = add nuw i32 %15, 1
%18 = icmp eq i32 %15, %13
br i1 %18, label %19, label %14
19: ; preds = %14, %7
ret i32 0
}