#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 main() {
  int a, b;
  printf("a = 5, a b = 3 \n");
  a = 5;
  b = 3;
  b = (a += 2);
  printf("po zmianie b wynosi: %d\n", b);
  a = (b %= 3) + (b %= 4);
  printf("po zmianie a wynosi: %d\n", a);
  b = (b %= 3) + (b %= 4) + (a += 2);
  printf("po magicznej zamianie b wynosi: %d\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x5,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x10(%rbp),%edx
mov    %eax,-0x8(%rbp)
add    %eax,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
mov    %edx,-0x8(%rbp)
add    %edx,%eax
mov    -0x4(%rbp),%ecx
add    $0x2,%ecx
mov    %ecx,-0x4(%rbp)
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [25 x i8] c"po zmianie b wynosi: %d\0A\00"
@.str.2 = [25 x i8] c"po zmianie a wynosi: %d\0A\00"
@.str.3 = [36 x i8] c"po magicznej zamianie b wynosi: %d\0A\00"
@str = [16 x i8] c"a = 5, a b = 3 \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 7)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 6)
ret i32 0
}