#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);
int main(void) {
  int x = 2, y = 8, z = 12;
  int *ptr_x = &x;
  int *ptr_y = &y;
  int *ptr_z = &z;
  z = x * y;
  x *= y;
  y = *ptr_x;
  *ptr_x = x * y;
  ptr_x = ptr_y;
  x = (*ptr_x) * (*ptr_z);
  printf("x: %i\n", x);
  printf("y: %i\n", y);
  printf("z: %i\n", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0xc,-0xc(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
imul   (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x100,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"x: %i\0A\00"
@.str.1 = [7 x i8] c"y: %i\0A\00"
@.str.2 = [7 x i8] c"z: %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32 2, i32* %1
store i32 8, i32* %2
store i32 12, i32* %3
store i32* %1, i32** %4
store i32* %2, i32** %5
store i32* %3, i32** %6
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = mul nsw i32 %11, %10
store i32 %12, i32* %1
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
store i32 %14, i32* %2
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = mul nsw i32 %15, %16
%18 = load i32*, i32** %4
store i32 %17, i32* %18
%19 = load i32*, i32** %5
store i32* %19, i32** %4
%20 = load i32*, i32** %4
%21 = load i32, i32* %20
%22 = load i32*, i32** %6
%23 = load i32, i32* %22
%24 = mul nsw i32 %21, %23
store i32 %24, i32* %1
%25 = load i32, i32* %1
%26 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %2
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = load i32, i32* %3
%30 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"x: %i\0A\00"
@.str.1 = [7 x i8] c"y: %i\0A\00"
@.str.2 = [7 x i8] c"z: %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 256)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 16)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret i32 0
}