#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a = 0;
  printf("a = 0; a = %d\n", a);
  a++;
  printf("a++; a = %d\n", a);
  ++a;
  printf("++a; a = %d\n", a);
  printf("a++ = %d\n", a++);
  printf("a = %d\n", a);
  printf("++a = %d\n", ++a);
  printf("a = %d\n", a);
  int b = a++;
  printf("a = %d\n", a);
  printf("b = %d\n", b);
  int c = ++a;
  printf("a = %d\n", a);
  printf("c = %d\n", c);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe63(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dcd(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xebb(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    0x2e19(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"a = 0; a = %d\0A\00"
@.str.1 = [13 x i8] c"a++; a = %d\0A\00"
@.str.2 = [13 x i8] c"++a; a = %d\0A\00"
@.str.3 = [10 x i8] c"a++ = %d\0A\00"
@.str.4 = [8 x i8] c"a = %d\0A\00"
@.str.5 = [10 x i8] c"++a = %d\0A\00"
@.str.6 = [8 x i8] c"b = %d\0A\00"
@.str.7 = [8 x i8] c"c = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 2)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 3)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 4)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 4)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 5)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 4)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 6)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 6)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}