#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*/ lang_addArgument_int(int);
int /*<<< orphan*/ lang_addArgument_string(char *);
int lang_callFunction_int(char *);
int /*<<< orphan*/ lang_dump();
int /*<<< orphan*/ lang_loadFile(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  lang_loadFile("script");
  lang_addArgument_int(5);
  lang_addArgument_int(2);
  lang_addArgument_string("Calling myFunction from main\n");
  lang_dump();
  int ret;
  ret = lang_callFunction_int("myFunction");
  printf("Ret: %d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1060 <lang_loadFile@plt>
mov    $0x5,%edi
call   1050 <lang_addArgument_int@plt>
mov    $0x2,%edi
call   1050 <lang_addArgument_int@plt>
lea    0xe71(%rip),%rdi
call   1030 <lang_addArgument_string@plt>
mov    $0x0,%al
call   1070 <lang_dump@plt>
lea    0xe7c(%rip),%rdi
call   1080 <lang_callFunction_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe98(%rip),%rdi
call   1060 <lang_loadFile@plt>
mov    $0x5,%edi
call   1050 <lang_addArgument_int@plt>
mov    $0x2,%edi
call   1050 <lang_addArgument_int@plt>
lea    0xe7f(%rip),%rdi
call   1030 <lang_addArgument_string@plt>
xor    %eax,%eax
call   1070 <lang_dump@plt>
lea    0xe8a(%rip),%rdi
call   1080 <lang_callFunction_int@plt>
lea    0xe89(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"script\00"
@.str.1 = [30 x i8] c"Calling myFunction from main\0A\00"
@.str.2 = [11 x i8] c"myFunction\00"
@.str.3 = [9 x i8] c"Ret: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @lang_loadFile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @lang_addArgument_int(i32 5)
%5 = call i32 @lang_addArgument_int(i32 2)
%6 = call i32 @lang_addArgument_string(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @lang_dump()
%8 = call i32 @lang_callFunction_int(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"script\00"
@.str.1 = [30 x i8] c"Calling myFunction from main\0A\00"
@.str.2 = [11 x i8] c"myFunction\00"
@.str.3 = [9 x i8] c"Ret: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @lang_loadFile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @lang_addArgument_int(i32 5)
%3 = tail call i32 @lang_addArgument_int(i32 2)
%4 = tail call i32 @lang_addArgument_string(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @lang_dump()
%6 = tail call i32 @lang_callFunction_int(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %6)
ret i32 0
}