#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*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  long num1 = 0L;
  long num2 = 0L;
  long *pnum = NULL;
  pnum = &num1;
  *pnum = 2L;
  printf("Address of num1 is %p\n", &num1);
  printf("The value of num1 is %ld\n", num1);
  printf("Address of pnum is %p\n", &pnum);
  printf("The address value of pnum is %p\n", pnum);
  printf("The value of pnum is %ld\n", *pnum);
  ++num2;
  num2 += *pnum;
  pnum = &num2;
  ++*pnum;
  printf("Address of num2 is %p\n", &num2);
  printf("Address of pnum is %p\n", &pnum);
  printf("The address value of pnum is %p\n", pnum);
  printf("The value of pnum is %ld\n", *pnum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movq   $0x2,(%rax)
lea    0xea8(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
lea    0xe9d(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe39(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x8(%rsp),%rsi
mov    %rsi,(%rsp)
movq   $0x2,0x8(%rsp)
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%r15
mov    %rsp,%r14
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rsi
lea    0xed8(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rax
mov    (%rax),%rsi
lea    0xee1(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rax
mov    (%rax),%rax
lea    0x10(%rsp),%rsi
mov    %rsi,(%rsp)
add    $0x2,%rax
mov    %rax,0x10(%rsp)
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%rax
mov    (%rax),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Address of num1 is %p\0A\00"
@.str.1 = [26 x i8] c"The value of num1 is %ld\0A\00"
@.str.2 = [23 x i8] c"Address of pnum is %p\0A\00"
@.str.3 = [33 x i8] c"The address value of pnum is %p\0A\00"
@.str.4 = [26 x i8] c"The value of pnum is %ld\0A\00"
@.str.5 = [23 x i8] c"Address of num2 is %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* %6
store i64 0, i64* %7
store i64* null, i64** %8
store i64* %6, i64** %8
%9 = load i64*, i64** %8
store i64 2, i64* %9
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64* %6)
%11 = load i64, i64* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64** %8)
%14 = load i64*, i64** %8
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i64* %14)
%16 = load i64*, i64** %8
%17 = load i64, i64* %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i64 %17)
%19 = load i64, i64* %7
%20 = add nsw i64 %19, 1
store i64 %20, i64* %7
%21 = load i64*, i64** %8
%22 = load i64, i64* %21
%23 = load i64, i64* %7
%24 = add nsw i64 %23, %22
store i64 %24, i64* %7
store i64* %7, i64** %8
%25 = load i64*, i64** %8
%26 = load i64, i64* %25
%27 = add nsw i64 %26, 1
store i64 %27, i64* %25
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i64* %7)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64** %8)
%30 = load i64*, i64** %8
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i64* %30)
%32 = load i64*, i64** %8
%33 = load i64, i64* %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i64 %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Address of num1 is %p\0A\00"
@.str.1 = [26 x i8] c"The value of num1 is %ld\0A\00"
@.str.2 = [23 x i8] c"Address of pnum is %p\0A\00"
@.str.3 = [33 x i8] c"The address value of pnum is %p\0A\00"
@.str.4 = [26 x i8] c"The value of pnum is %ld\0A\00"
@.str.5 = [23 x i8] c"Address of num2 is %p\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64*
%6 = bitcast i64* %3 to i8*
%7 = bitcast i64* %4 to i8*
%8 = bitcast i64** %5 to i8*
store i64* %3, i64** %5
store i64 2, i64* %3
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i64* %3)
%10 = load i64, i64* %3
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64** %5)
%13 = load i64*, i64** %5
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i64* %13)
%15 = load i64*, i64** %5
%16 = load i64, i64* %15
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i64 %16)
%18 = load i64*, i64** %5
%19 = load i64, i64* %18
store i64* %4, i64** %5
%20 = add nsw i64 %19, 2
store i64 %20, i64* %4
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i64* %4)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64** %5)
%23 = load i64*, i64** %5
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i64* %23)
%25 = load i64*, i64** %5
%26 = load i64, i64* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i64 %26)
ret i32 0
}