#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 empty3();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
void main() {
  short isPositive(short n);
  int empty();
  int empty2();
  int a = 0;
  a = 10;
  a += a -= a *= a;
  printf("The value of a:%d.\n", a);
  a += (a += 5);
  printf("The value of a:%d.\n", a);
  a = (a += 5);
  printf("The value of a:%d.\n", a);
  a += a /= a *= a;
  printf("The value of a:%d.\n", a);
  int c, d, e = 1;
  c = d = e;
  printf("The value of c:%d.\n", c);
  printf("The boolean value of 1==2:%i.\n", (1 == 2));
  printf("The boolean value of 1<=2:%i.\n", (1 <= 2));
  short k = 0;
  short x = isPositive(k);
  printf("The value of x:%i.\n", x);
  printf("The value of empty2():%i.\n", empty2());
  printf("The value of empty():%i.\n", empty());
  printf("The value of empty3():%i.\n", empty3());
  printf("Press enter to continue...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
mov    %ecx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
mov    %ecx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdfa(%rip),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movw   $0x0,-0x12(%rbp)
movswl -0x12(%rbp),%edi
call   1050 <isPositive@plt>
mov    %ax,-0x14(%rbp)
movswl -0x14(%rbp),%esi
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <empty2@plt>
mov    %eax,%esi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <empty@plt>
mov    %eax,%esi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <empty3@plt>
mov    %eax,%esi
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <getchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xe98(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6c(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6d(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <isPositive@plt>
movswl %ax,%esi
lea    0xe7e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <empty2@plt>
lea    0xe7d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <empty@plt>
lea    0xe81(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <empty3@plt>
lea    0xe84(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1070 <getchar@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"The value of a:%d.\0A\00"
@.str.1 = [20 x i8] c"The value of c:%d.\0A\00"
@.str.2 = [31 x i8] c"The boolean value of 1==2:%i.\0A\00"
@.str.3 = [31 x i8] c"The boolean value of 1<=2:%i.\0A\00"
@.str.4 = [20 x i8] c"The value of x:%i.\0A\00"
@.str.5 = [27 x i8] c"The value of empty2():%i.\0A\00"
@.str.6 = [26 x i8] c"The value of empty():%i.\0A\00"
@.str.7 = [27 x i8] c"The value of empty3():%i.\0A\00"
@.str.8 = [27 x i8] c"Press enter to continue...\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i32 0, i32* %1
store i32 10, i32* %1
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = sub nsw i32 %10, %9
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = add nsw i32 %12, %11
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 5
store i32 %17, i32* %1
%18 = load i32, i32* %1
%19 = add nsw i32 %18, %17
store i32 %19, i32* %1
%20 = load i32, i32* %1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 5
store i32 %23, i32* %1
store i32 %23, i32* %1
%24 = load i32, i32* %1
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %1
%27 = load i32, i32* %1
%28 = mul nsw i32 %27, %26
store i32 %28, i32* %1
%29 = load i32, i32* %1
%30 = sdiv i32 %29, %28
store i32 %30, i32* %1
%31 = load i32, i32* %1
%32 = add nsw i32 %31, %30
store i32 %32, i32* %1
%33 = load i32, i32* %1
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %33)
store i32 1, i32* %4
%35 = load i32, i32* %4
store i32 %35, i32* %3
store i32 %35, i32* %2
%36 = load i32, i32* %2
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 0)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 1)
store i16 0, i16* %5
%40 = load i16, i16* %5
%41 = call signext i16 @isPositive(i16 signext %40)
store i16 %41, i16* %6
%42 = load i16, i16* %6
%43 = sext i16 %42 to i32
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %43)
%45 = call i32 (...) @empty2()
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %45)
%47 = call i32 (...) @empty()
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %47)
%49 = call i32 (...) @empty3()
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%52 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"The value of a:%d.\0A\00"
@.str.1 = [20 x i8] c"The value of c:%d.\0A\00"
@.str.2 = [31 x i8] c"The boolean value of 1==2:%i.\0A\00"
@.str.3 = [31 x i8] c"The boolean value of 1<=2:%i.\0A\00"
@.str.4 = [20 x i8] c"The value of x:%i.\0A\00"
@.str.5 = [27 x i8] c"The value of empty2():%i.\0A\00"
@.str.6 = [26 x i8] c"The value of empty():%i.\0A\00"
@.str.7 = [27 x i8] c"The value of empty3():%i.\0A\00"
@.str.8 = [27 x i8] c"Press enter to continue...\00"
define void @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 15)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 1)
%8 = tail call signext i16 @isPositive(i16 signext 0)
%9 = sext i16 %8 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 (...) @empty2()
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = tail call i32 (...) @empty()
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %13)
%15 = tail call i32 (...) @empty3()
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %15)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%18 = tail call i32 (...) @getchar()
ret void
}