#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*/ getNum(int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ tripleNum(int *);
int main() {
  int num = 23;
  int *ptr;
  ptr = &num;
  printf("Number is %i\n", num);
  tripleNum(&num);
  printf("Number is %i\n", num);
  tripleNum(ptr);
  printf("Number is %i\n", num);
  getNum(&num);
  printf("Number is %i\n", num);
  getNum(ptr);
  printf("Number is %i\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x17,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <tripleNum@plt>
mov    -0x8(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <tripleNum@plt>
mov    -0x8(%rbp),%esi
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1050 <getNum@plt>
mov    -0x8(%rbp),%esi
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <getNum@plt>
mov    -0x8(%rbp),%esi
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x17,0x4(%rsp)
lea    0xebd(%rip),%r14
mov    %r14,%rdi
mov    $0x17,%esi
call   1040 <printf@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <tripleNum@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <tripleNum@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <getNum@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <getNum@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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