#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, int);
int main(void) {
  int x = 6;
  int t;
  t = (x << 2) + x;
  printf("%d * %d = %d\n", x, 5, t);
  t = (x << 3) + x;
  printf("%d * %d = %d\n", x, 9, t);
  t = (x << 5) - (x << 1);
  printf("%d * %d = %d\n", x, 30, t);
  t = (x << 3) - (x << 6);
  printf("%d * %d = %d\n", x, -56, t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xec1(%rip),%rdi
mov    $0x5,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xe9e(%rip),%rdi
mov    $0x9,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xe76(%rip),%rdi
mov    $0x1e,%edx
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    -0x8(%rbp),%ecx
shl    $0x6,%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xe4e(%rip),%rdi
mov    $0xffffffc8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x5,%edx
mov    $0x1e,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x9,%edx
mov    $0x36,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1e,%edx
mov    $0xb4,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0xffffffc8,%edx
mov    $0xfffffeb0,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d * %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 6, i32 5, i32 30)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 6, i32 9, i32 54)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 6, i32 30, i32 180)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 6, i32 -56, i32 -336)
ret i32 0
}