#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*/ VMFilePrint(int, char *, ...);
void VMMain(int argc, char *argv[]) {
  int Index;
  VMFilePrint(1, "In VMMain:\n");
  for (Index = 0; Index < argc; Index++) {
    VMFilePrint(1, "%d = %s\n", Index, argv[Index]);
  }
  VMFilePrint(1, "Goodbye\n");
}


x86 assembly (clang, -O0):
<VMMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <VMFilePrint@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1175 <VMMain+0x65>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    $0x1,%edi
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1030 <VMFilePrint@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <VMMain+0x29>
mov    $0x1,%edi
lea    0xe94(%rip),%rsi
mov    $0x0,%al
call   1030 <VMFilePrint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VMMain>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %edi,%ebx
lea    0xedc(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <VMFilePrint@plt>
test   %ebx,%ebx
jle    115e <VMMain+0x4e>
mov    %ebx,%r12d
lea    0xece(%rip),%r14
xor    %ebx,%ebx
mov    (%r15,%rbx,8),%rcx
mov    $0x1,%edi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <VMFilePrint@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <VMMain+0x30>
lea    0xeb0(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <VMFilePrint@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"In VMMain:\0A\00"
@.str.1 = [9 x i8] c"%d = %s\0A\00"
@.str.2 = [9 x i8] c"Goodbye\0A\00"
define void @VMMain(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (i32, i8*, ...) @VMFilePrint(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %5
%13 = load i8**, i8*** %4
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, ...) @VMFilePrint(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
%23 = call i32 (i32, i8*, ...) @VMFilePrint(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"In VMMain:\0A\00"
@.str.1 = [9 x i8] c"%d = %s\0A\00"
@.str.2 = [9 x i8] c"Goodbye\0A\00"
define void @VMMain(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (i32, i8*, ...) @VMFilePrint(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 (i32, i8*, ...) @VMFilePrint(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %2
%16 = tail call i32 (i32, i8*, ...) @VMFilePrint(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}