#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_SUCCESS;
int /*<<< orphan*/ demo(char *, char *, char *, char *, char *, char *);
int /*<<< orphan*/ fun(int, int, int, int, int);
int /*<<< orphan*/ system(char *);
int main() {
  int a = 1;
  int b = 2;
  int c = 3;
  int d = 4;
  fun(4, a, b, c, d);
  system("pause");
  demo("DEMO", "This", "is", "a", "demo!", "");
  system("pause");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    $0x4,%edi
call   1030 <fun@plt>
lea    0xe87(%rip),%rdi
call   1040 <system@plt>
lea    0xe81(%rip),%rdi
lea    0xe7f(%rip),%rsi
lea    0xe7a(%rip),%rdx
lea    0xe76(%rip),%rcx
lea    0xe71(%rip),%r8
lea    0xe6f(%rip),%r9
call   1050 <demo@plt>
lea    0xe4c(%rip),%rdi
call   1040 <system@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
call   1030 <fun@plt>
lea    0xea9(%rip),%rbx
mov    %rbx,%rdi
call   1040 <system@plt>
lea    0xea0(%rip),%rdi
lea    0xe9e(%rip),%rsi
lea    0xe99(%rip),%rdx
lea    0xe95(%rip),%rcx
lea    0xe90(%rip),%r8
lea    0xe8e(%rip),%r9
call   1050 <demo@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
mov    0x2e43(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
@.str.1 = [5 x i8] c"DEMO\00"
@.str.2 = [5 x i8] c"This\00"
@.str.3 = [3 x i8] c"is\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [6 x i8] c"demo!\00"
@.str.6 = [1 x i8] zeroinitializer
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
store i32 4, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @fun(i32 4, i32 %6, i32 %7, i32 %8, i32 %9)
%11 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @demo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
@.str.1 = [5 x i8] c"DEMO\00"
@.str.2 = [5 x i8] c"This\00"
@.str.3 = [3 x i8] c"is\00"
@.str.4 = [2 x i8] c"a\00"
@.str.5 = [6 x i8] c"demo!\00"
@.str.6 = [1 x i8] zeroinitializer
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @fun(i32 4, i32 1, i32 2, i32 3, i32 4)
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @demo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}