#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*/ add(int, int);
int /*<<< orphan*/ addWithReference(int *, int *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int x = 5;
  int y = 2;
  int a = 6;
  int b = 3;
  add(x, y);
  addWithReference(&a, &b);
  printf("x is equal to: %i\n", x);
  printf("y is equal to: %i\n", y);
  printf("a is equal to: %i\n", a);
  printf("b is equal to: %i\n", b);
  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   $0x5,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x6,-0x1c(%rbp)
movl   $0x3,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <add@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <addWithReference@plt>
mov    -0x14(%rbp),%esi
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x6,0x4(%rsp)
movl   $0x3,(%rsp)
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <add@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <addWithReference@plt>
lea    0xe9d(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    (%rsp),%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"x is equal to: %i\0A\00"
@.str.1 = [19 x i8] c"y is equal to: %i\0A\00"
@.str.2 = [19 x i8] c"a is equal to: %i\0A\00"
@.str.3 = [19 x i8] c"b is equal to: %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
store i32 2, i32* %7
store i32 6, i32* %8
store i32 3, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @add(i32 %10, i32 %11)
%13 = call i32 @addWithReference(i32* %8, i32* %9)
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %8
%19 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %9
%21 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"x is equal to: %i\0A\00"
@.str.1 = [19 x i8] c"y is equal to: %i\0A\00"
@.str.2 = [19 x i8] c"a is equal to: %i\0A\00"
@.str.3 = [19 x i8] c"b is equal to: %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store i32 6, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 3, i32* %4
%7 = tail call i32 @add(i32 5, i32 2)
%8 = call i32 @addWithReference(i32* %3, i32* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 5)
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 2)
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %13)
ret i32 0
}