#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 get(int *, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int sum(int *, int *);
int main() {
  int x = 10;
  int y = 20;
  int z = sum(&x, &y);
  puts("This is Main");
  printf("Z:%d\n", z);
  x = 20;
  z = get(&x, &y);
  printf("Z:%d\n", z);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <sum@plt>
mov    %eax,-0x10(%rbp)
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
movl   $0x14,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <get@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe64(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movl   $0xa,(%rsp)
movl   $0x14,0x4(%rsp)
mov    %rsp,%r15
lea    0x4(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <sum@plt>
mov    %eax,%ebp
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8f(%rip),%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
movl   $0x14,(%rsp)
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <get@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"This is Main\00"
@.str.1 = [6 x i8] c"Z:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%5 = call i32 @sum(i32* %2, i32* %3)
store i32 %5, i32* %4
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32 20, i32* %2
%9 = call i32 @get(i32* %2, i32* %3)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"This is Main\00"
@.str.1 = [6 x i8] c"Z:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%5 = call i32 @sum(i32* %1, i32* %2)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5)
store i32 20, i32* %1
%8 = call i32 @get(i32* %1, i32* %2)
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 1
}