#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*/ strcmp(char *, char *);
int /*<<< orphan*/ testAllocaOrder(unsigned int);
int main(int argc, char **argv) {
  unsigned int i, noPrint = 1;
  if (argc > 1 && !strcmp(argv[1], "-d"))
    noPrint = 0;
  for (i = 0; i < 10; ++i)
    testAllocaOrder(noPrint);
  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,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    116b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    116b <main+0x4b>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jae    1192 <main+0x72>
mov    -0x18(%rbp),%edi
call   1040 <testAllocaOrder@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1172 <main+0x52>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     1142 <main+0x22>
mov    0x8(%rsi),%rdi
lea    0xeca(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
mov    %ebx,%edi
call   1040 <testAllocaOrder@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-d\00"
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* %7
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %10
store i32 0, i32* %7
br label %17
17: ; preds = %16, %10, %2
store i32 0, i32* %6
br label %18
18: ; preds = %24, %17
%19 = load i32, i32* %6
%20 = icmp ult i32 %19, 10
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i32, i32* %7
%23 = call i32 @testAllocaOrder(i32 %22)
br label %24
24: ; preds = %21
%25 = load i32, i32* %6
%26 = add i32 %25, 1
store i32 %26, i32* %6
br label %18
27: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %2
%11 = phi i32 [ 1, %2 ], [ %9, %4 ]
%12 = tail call i32 @testAllocaOrder(i32 %11)
%13 = tail call i32 @testAllocaOrder(i32 %11)
%14 = tail call i32 @testAllocaOrder(i32 %11)
%15 = tail call i32 @testAllocaOrder(i32 %11)
%16 = tail call i32 @testAllocaOrder(i32 %11)
%17 = tail call i32 @testAllocaOrder(i32 %11)
%18 = tail call i32 @testAllocaOrder(i32 %11)
%19 = tail call i32 @testAllocaOrder(i32 %11)
%20 = tail call i32 @testAllocaOrder(i32 %11)
%21 = tail call i32 @testAllocaOrder(i32 %11)
ret i32 0
}