#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[]) {
  int x = 2, y = 3, z = 5;
  int *x_ptr = &x;
  int *y_ptr = &y;
  int *z_ptr = &z;
  printf("x == %d, y == %d, z == %d\n", x, y, z);
  printf("x_ptr == %p\n", x_ptr);
  printf("y_ptr == %p\n", y_ptr);
  printf("z_ptr == %p\n", z_ptr);
  printf("The address of x is %p\n", x_ptr);
  printf("The value stored in %p is %d\n", x_ptr, *x_ptr);
  printf("\nThe value stored in y, %p, is %d\n", y_ptr, y);
  printf("Doing '*y_ptr = x * z'\n");
  *y_ptr = x * z;
  printf("The value stored in y, %p, is %d\n", y_ptr, y);
  printf("\nx == %d\n", x);
  printf("Doing 'x = (*y_ptr) * (*z_ptr)'\n");
  x = (*y_ptr) * (*x_ptr);
  printf("Now x == %d\n", x);
  printf("\nz == %d\n", z);
  printf("Doing 'z = *x_ptr'\n");
  z = *x_ptr;
  printf("Now, z == %d\n", z);
  printf("\nz_ptr == %p, the value there is %d\n", z_ptr, *z_ptr);
  printf("Doing 'z_ptr = y_ptr'\n");
  z_ptr = y_ptr;
  printf("Now, z_ptr == %p, the value there is %d\n", z_ptr, *z_ptr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x5,-0x1c(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%edx
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
mov    -0x38(%rbp),%rax
mov    (%rax),%edx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x38(%rbp),%rax
mov    (%rax),%edx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x2,0x4(%rsp)
movl   $0x3,0xc(%rsp)
movl   $0x5,0x8(%rsp)
lea    0xeb8(%rip),%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
lea    0xc(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%edx
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%edx
lea    0xea7(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf36(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%edx
imul   0x4(%rsp),%edx
mov    %edx,0xc(%rsp)
lea    0xe7e(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%esi
imul   0xc(%rsp),%esi
mov    %esi,0x4(%rsp)
lea    0xe6e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%esi
mov    %esi,0x8(%rsp)
lea    0xe51(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%edx
lea    0xe4d(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%edx
lea    0xe51(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [27 x i8] c"x == %d, y == %d, z == %d\0A\00"
@.str.1 = [13 x i8] c"x_ptr == %p\0A\00"
@.str.2 = [13 x i8] c"y_ptr == %p\0A\00"
@.str.3 = [13 x i8] c"z_ptr == %p\0A\00"
@.str.4 = [24 x i8] c"The address of x is %p\0A\00"
@.str.5 = [30 x i8] c"The value stored in %p is %d\0A\00"
@.str.6 = [35 x i8] c"\0AThe value stored in y, %p, is %d\0A\00"
@.str.7 = [24 x i8] c"Doing '*y_ptr = x * z'\0A\00"
@.str.8 = [34 x i8] c"The value stored in y, %p, is %d\0A\00"
@.str.9 = [10 x i8] c"\0Ax == %d\0A\00"
@.str.10 = [33 x i8] c"Doing 'x = (*y_ptr) * (*z_ptr)'\0A\00"
@.str.11 = [13 x i8] c"Now x == %d\0A\00"
@.str.12 = [10 x i8] c"\0Az == %d\0A\00"
@.str.13 = [20 x i8] c"Doing 'z = *x_ptr'\0A\00"
@.str.14 = [14 x i8] c"Now, z == %d\0A\00"
@.str.15 = [37 x i8] c"\0Az_ptr == %p, the value there is %d\0A\00"
@.str.16 = [23 x i8] c"Doing 'z_ptr = y_ptr'\0A\00"
@.str.17 = [41 x i8] c"Now, z_ptr == %p, the value there is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 2, i32* %5
store i32 3, i32* %6
store i32 5, i32* %7
store i32* %5, i32** %8
store i32* %6, i32** %9
store i32* %7, i32** %10
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
%15 = load i32*, i32** %8
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %15)
%17 = load i32*, i32** %9
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %17)
%19 = load i32*, i32** %10
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32* %19)
%21 = load i32*, i32** %8
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32* %21)
%23 = load i32*, i32** %8
%24 = load i32*, i32** %8
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32* %23, i32 %25)
%27 = load i32*, i32** %9
%28 = load i32, i32* %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32* %27, i32 %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%31 = load i32, i32* %5
%32 = load i32, i32* %7
%33 = mul nsw i32 %31, %32
%34 = load i32*, i32** %9
store i32 %33, i32* %34
%35 = load i32*, i32** %9
%36 = load i32, i32* %6
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i32* %35, i32 %36)
%38 = load i32, i32* %5
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %38)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
%41 = load i32*, i32** %9
%42 = load i32, i32* %41
%43 = load i32*, i32** %8
%44 = load i32, i32* %43
%45 = mul nsw i32 %42, %44
store i32 %45, i32* %5
%46 = load i32, i32* %5
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %7
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %48)
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0))
%51 = load i32*, i32** %8
%52 = load i32, i32* %51
store i32 %52, i32* %7
%53 = load i32, i32* %7
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i32 %53)
%55 = load i32*, i32** %10
%56 = load i32*, i32** %10
%57 = load i32, i32* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0), i32* %55, i32 %57)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0))
%60 = load i32*, i32** %9
store i32* %60, i32** %10
%61 = load i32*, i32** %10
%62 = load i32*, i32** %10
%63 = load i32, i32* %62
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.17, i64 0, i64 0), i32* %61, i32 %63)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"x == %d, y == %d, z == %d\0A\00"
@.str.1 = [13 x i8] c"x_ptr == %p\0A\00"
@.str.2 = [13 x i8] c"y_ptr == %p\0A\00"
@.str.3 = [13 x i8] c"z_ptr == %p\0A\00"
@.str.4 = [24 x i8] c"The address of x is %p\0A\00"
@.str.5 = [30 x i8] c"The value stored in %p is %d\0A\00"
@.str.6 = [35 x i8] c"\0AThe value stored in y, %p, is %d\0A\00"
@.str.8 = [34 x i8] c"The value stored in y, %p, is %d\0A\00"
@.str.9 = [10 x i8] c"\0Ax == %d\0A\00"
@.str.11 = [13 x i8] c"Now x == %d\0A\00"
@.str.12 = [10 x i8] c"\0Az == %d\0A\00"
@.str.14 = [14 x i8] c"Now, z == %d\0A\00"
@.str.15 = [37 x i8] c"\0Az_ptr == %p, the value there is %d\0A\00"
@.str.17 = [41 x i8] c"Now, z_ptr == %p, the value there is %d\0A\00"
@str = [23 x i8] c"Doing '*y_ptr = x * z'\00"
@str.18 = [32 x i8] c"Doing 'x = (*y_ptr) * (*z_ptr)'\00"
@str.19 = [19 x i8] c"Doing 'z = *x_ptr'\00"
@str.20 = [22 x i8] c"Doing 'z_ptr = y_ptr'\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 3, i32* %4
%8 = bitcast i32* %5 to i8*
store i32 5, i32* %5
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 2, i32 3, i32 5)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32* %5)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32* %3, i32 %14)
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32* %4, i32 %16)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%19 = load i32, i32* %3
%20 = load i32, i32* %5
%21 = mul nsw i32 %20, %19
store i32 %21, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i32* %4, i32 %21)
%23 = load i32, i32* %3
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %23)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.18, i64 0, i64 0))
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = mul nsw i32 %27, %26
store i32 %28, i32* %3
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %5
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %30)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.19, i64 0, i64 0))
%33 = load i32, i32* %3
store i32 %33, i32* %5
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i32 %33)
%35 = load i32, i32* %5
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.15, i64 0, i64 0), i32* %5, i32 %35)
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.20, i64 0, i64 0))
%38 = load i32, i32* %4
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.17, i64 0, i64 0), i32* %4, i32 %38)
ret i32 0
}