#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 /*<<< orphan*/ showPrefixAndPostfixOps();
int main(int argc, char **argv) {
  int a = 10;
  int b = 2;
  printf("\n\nHere are examples of some compound assignment operators...\n");
  a = a + b;
  printf("\na + b  : %d\n", a);
  a = 10;
  a += b;
  printf("a += b  : %d\n", a);
  a = 10;
  a = a - b;
  printf("a - b  : %d\n", a);
  a = 10;
  a -= b;
  printf("a -= b  : %d\n", a);
  a = 10;
  a = a * b;
  printf("a * b  : %d\n", a);
  a = 10;
  a *= b;
  printf("a *= b  : %d\n", a);
  a = 10;
  a = a / b;
  printf("a/b  : %d\n", a);
  a = 10;
  a /= b;
  printf("a /= b  : %d\n", a);
  a = 10;
  a++;
  printf("a++ : %d\n", a);
  a = 10;
  a--;
  printf("a-- : %d\n", a);
  showPrefixAndPostfixOps();
  return (0);
}


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   $0xa,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <showPrefixAndPostfixOps@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf47(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea7(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea1(%rip),%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe94(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0xb,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe86(%rip),%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <showPrefixAndPostfixOps@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"\0A\0AHere are examples of some compound assignment operators...\0A\00"
@.str.1 = [14 x i8] c"\0Aa + b : %d\0A\00"
@.str.2 = [14 x i8] c"a += b : %d\0A\00"
@.str.3 = [13 x i8] c"a - b : %d\0A\00"
@.str.4 = [14 x i8] c"a -= b : %d\0A\00"
@.str.5 = [13 x i8] c"a * b : %d\0A\00"
@.str.6 = [14 x i8] c"a *= b : %d\0A\00"
@.str.7 = [11 x i8] c"a/b : %d\0A\00"
@.str.8 = [14 x i8] c"a /= b : %d\0A\00"
@.str.9 = [10 x i8] c"a++ : %d\0A\00"
@.str.10 = [10 x i8] c"a-- : %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 2, i32* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = add nsw i32 %9, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %12)
store i32 10, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = add nsw i32 %15, %14
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %17)
store i32 10, i32* %6
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %22)
store i32 10, i32* %6
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = sub nsw i32 %25, %24
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %27)
store i32 10, i32* %6
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = mul nsw i32 %29, %30
store i32 %31, i32* %6
%32 = load i32, i32* %6
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %32)
store i32 10, i32* %6
%34 = load i32, i32* %7
%35 = load i32, i32* %6
%36 = mul nsw i32 %35, %34
store i32 %36, i32* %6
%37 = load i32, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %37)
store i32 10, i32* %6
%39 = load i32, i32* %6
%40 = load i32, i32* %7
%41 = sdiv i32 %39, %40
store i32 %41, i32* %6
%42 = load i32, i32* %6
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 %42)
store i32 10, i32* %6
%44 = load i32, i32* %7
%45 = load i32, i32* %6
%46 = sdiv i32 %45, %44
store i32 %46, i32* %6
%47 = load i32, i32* %6
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 %47)
store i32 10, i32* %6
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
%51 = load i32, i32* %6
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %51)
store i32 10, i32* %6
%53 = load i32, i32* %6
%54 = add nsw i32 %53, -1
store i32 %54, i32* %6
%55 = load i32, i32* %6
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 %55)
%57 = call i32 (...) @showPrefixAndPostfixOps()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"\0Aa + b : %d\0A\00"
@.str.2 = [14 x i8] c"a += b : %d\0A\00"
@.str.3 = [13 x i8] c"a - b : %d\0A\00"
@.str.4 = [14 x i8] c"a -= b : %d\0A\00"
@.str.5 = [13 x i8] c"a * b : %d\0A\00"
@.str.6 = [14 x i8] c"a *= b : %d\0A\00"
@.str.7 = [11 x i8] c"a/b : %d\0A\00"
@.str.8 = [14 x i8] c"a /= b : %d\0A\00"
@.str.9 = [10 x i8] c"a++ : %d\0A\00"
@.str.10 = [10 x i8] c"a-- : %d\0A\00"
@str = [61 x i8] c"\0A\0AHere are examples of some compound assignment operators...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 12)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 12)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 8)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 8)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 20)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 20)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i32 5)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32 5)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 11)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i32 9)
%14 = tail call i32 (...) @showPrefixAndPostfixOps()
ret i32 0
}