#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);
void testAssignment() {
  int a = 2;
  a *= 5;
  printf("2 *= 5  %d\n", a);
  a = 20;
  a /= 5;
  printf("20 /= 5  %d\n", a);
  a = 17;
  a %= 5;
  printf("17 %%= 5  %d\n", a);
  a = 17;
  a += 5;
  printf("17 += 5  %d\n", a);
  a = 17;
  a -= 5;
  printf("17 -= 5  %d\n", a);
  a = 17;
  a <<= 1;
  printf("17<<= 1  %d\n", a);
  a = 17;
  a >>= 1;
  printf("17>>= 1  %d\n", a);
  a = 17;
  a &= 1;
  printf("17&= 1  %d\n", a);
  a = 17;
  a ^= 1;
  printf("17^= 1  %d\n", a);
  a = 16;
  a ^= 1;
  printf("16|= 1  %d\n", a);
}


x86 assembly (clang, -O0):
<testAssignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x14,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
movl   $0x11,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
movl   $0x10,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAssignment>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x16,%esi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x22,%esi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x11,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"2 *= 5 %d\0A\00"
@.str.1 = [13 x i8] c"20 /= 5 %d\0A\00"
@.str.2 = [14 x i8] c"17 %%= 5 %d\0A\00"
@.str.3 = [13 x i8] c"17 += 5 %d\0A\00"
@.str.4 = [13 x i8] c"17 -= 5 %d\0A\00"
@.str.5 = [13 x i8] c"17<<= 1 %d\0A\00"
@.str.6 = [13 x i8] c"17>>= 1 %d\0A\00"
@.str.7 = [12 x i8] c"17&= 1 %d\0A\00"
@.str.8 = [12 x i8] c"17^= 1 %d\0A\00"
@.str.9 = [12 x i8] c"16|= 1 %d\0A\00"
define void @testAssignment() {
%1 = alloca i32
store i32 2, i32* %1
%2 = load i32, i32* %1
%3 = mul nsw i32 %2, 5
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 20, i32* %1
%6 = load i32, i32* %1
%7 = sdiv i32 %6, 5
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i32 17, i32* %1
%10 = load i32, i32* %1
%11 = srem i32 %10, 5
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %12)
store i32 17, i32* %1
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 5
store i32 %15, i32* %1
%16 = load i32, i32* %1
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %16)
store i32 17, i32* %1
%18 = load i32, i32* %1
%19 = sub nsw i32 %18, 5
store i32 %19, i32* %1
%20 = load i32, i32* %1
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %20)
store i32 17, i32* %1
%22 = load i32, i32* %1
%23 = shl i32 %22, 1
store i32 %23, i32* %1
%24 = load i32, i32* %1
%25 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %24)
store i32 17, i32* %1
%26 = load i32, i32* %1
%27 = ashr i32 %26, 1
store i32 %27, i32* %1
%28 = load i32, i32* %1
%29 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %28)
store i32 17, i32* %1
%30 = load i32, i32* %1
%31 = and i32 %30, 1
store i32 %31, i32* %1
%32 = load i32, i32* %1
%33 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %32)
store i32 17, i32* %1
%34 = load i32, i32* %1
%35 = xor i32 %34, 1
store i32 %35, i32* %1
%36 = load i32, i32* %1
%37 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 %36)
store i32 16, i32* %1
%38 = load i32, i32* %1
%39 = xor i32 %38, 1
store i32 %39, i32* %1
%40 = load i32, i32* %1
%41 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 %40)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"2 *= 5 %d\0A\00"
@.str.1 = [13 x i8] c"20 /= 5 %d\0A\00"
@.str.2 = [14 x i8] c"17 %%= 5 %d\0A\00"
@.str.3 = [13 x i8] c"17 += 5 %d\0A\00"
@.str.4 = [13 x i8] c"17 -= 5 %d\0A\00"
@.str.5 = [13 x i8] c"17<<= 1 %d\0A\00"
@.str.6 = [13 x i8] c"17>>= 1 %d\0A\00"
@.str.7 = [12 x i8] c"17&= 1 %d\0A\00"
@.str.8 = [12 x i8] c"17^= 1 %d\0A\00"
@.str.9 = [12 x i8] c"16|= 1 %d\0A\00"
define void @testAssignment() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 22)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 12)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 34)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 8)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 1)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i32 16)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 17)
ret void
}