#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 a = 3;
  int b = 10;
  int c, *pa, *pb, *pc;
  pa = &a;
  *pa = *pa * 2;
  pb = &b;
  c = 3 * (*pb - *pa);
  pc = pb;
  pa = pb;
  pb = pc;
  printf("a %d\n", a);
  printf("b %d\n", b);
  printf("c %d\n", c);
  printf("*a %d\n", *pa);
  printf("*b %d\n", *pb);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x3,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeef(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"a %d\0A\00"
@.str.1 = [6 x i8] c"b %d\0A\00"
@.str.2 = [6 x i8] c"c %d\0A\00"
@.str.3 = [7 x i8] c"*a %d\0A\00"
@.str.4 = [7 x i8] c"*b %d\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 3, i32* %1
store i32 10, i32* %2
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 2
%10 = load i32*, i32** %4
store i32 %9, i32* %10
store i32* %2, i32** %5
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
%16 = mul nsw i32 3, %15
store i32 %16, i32* %3
%17 = load i32*, i32** %5
store i32* %17, i32** %6
%18 = load i32*, i32** %5
store i32* %18, i32** %4
%19 = load i32*, i32** %6
store i32* %19, i32** %5
%20 = load i32, i32* %1
%21 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %3
%25 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = load i32*, i32** %4
%27 = load i32, i32* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = load i32*, i32** %5
%30 = load i32, i32* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"a %d\0A\00"
@.str.1 = [6 x i8] c"b %d\0A\00"
@.str.2 = [6 x i8] c"c %d\0A\00"
@.str.3 = [7 x i8] c"*a %d\0A\00"
@.str.4 = [7 x i8] c"*b %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 10)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 12)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 10)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 10)
ret i32 0
}