#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 EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ finalize_vm();
int /*<<< orphan*/ initialize_vm(char *);
int /*<<< orphan*/ loop();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("[ERROR]: too few parameters\n");
    return EXIT_FAILURE;
  }
  initialize_vm(argv[1]);
  loop();
  finalize_vm();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    117d <main+0x3d>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <main+0x64>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <initialize_vm@plt>
mov    $0x0,%al
call   1040 <loop@plt>
mov    $0x0,%al
call   1060 <finalize_vm@plt>
mov    0x2e39(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     115b <main+0x1b>
lea    0xeb3(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e87(%rip),%rax
jmp    1179 <main+0x39>
mov    0x8(%rsi),%rdi
call   1030 <initialize_vm@plt>
xor    %eax,%eax
call   1050 <loop@plt>
xor    %eax,%eax
call   1060 <finalize_vm@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"[ERROR]: too few parameters\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
store i32 %10, i32* %3
br label %19
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @initialize_vm(i8* %14)
%16 = call i32 (...) @loop()
%17 = call i32 (...) @finalize_vm()
%18 = load i32, i32* @EXIT_SUCCESS
store i32 %18, i32* %3
br label %19
19: ; preds = %11, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [28 x i8] c"[ERROR]: too few parameters\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @initialize_vm(i8* %8)
%10 = tail call i32 (...) @loop()
%11 = tail call i32 (...) @finalize_vm()
br label %12
12: ; preds = %6, %4
%13 = phi i32* [ @EXIT_FAILURE, %4 ], [ @EXIT_SUCCESS, %6 ]
%14 = load i32, i32* %13
ret i32 %14
}