#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() {
  int a = 5;
  int i, j;
  i = ((a++) * (a++));
  j = ((++a) * (++a));
  printf("i=%d\n", i);
  printf("j=%d\n", j);
  printf("k=%d\n", ((++a) * (++a)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
imul   %eax,%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1e,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x48,%esi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x6e,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"i=%d\0A\00"
@.str.1 = [6 x i8] c"j=%d\0A\00"
@.str.2 = [6 x i8] c"k=%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 30)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 72)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 110)
ret i32 0
}