#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 *, ...);
void zmienne(int x) {
  int z = 0, y = 0, g = 0;
  printf("\t--test 2\n");
  printf("y=%i x=%i", y, x);
  y = (x += 2);
  printf("\ny= %i x=%i\n", y, x);
  printf("\t--test 3\n");
  printf("z=%i x=%i", z, x);
  z = (x %= 3) + (x %= 4);
  printf("\nz= %i x=%i\n", z, x);
  printf("\t--test 4*\n");
  printf("g=%i x=%i", g, x);
  g = (x *= 2);
  printf("\ng= %i x=%i\n", g, x);
}


x86 assembly (clang, -O0):
<zmienne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x14(%rbp),%edx
mov    %eax,-0x4(%rbp)
add    %eax,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zmienne>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
xor    %esi,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x2(%rbx),%ebp
lea    0xebd(%rip),%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movslq %ebp,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
neg    %eax
add    %eax,%ebx
add    $0x2,%ebx
lea    (%rbx,%rbx,1),%ebp
lea    0xe80(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6f(%rip),%rdi
xor    %esi,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe67(%rip),%rdi
mov    %ebp,%esi
mov    %ebp,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\09--test 2\0A\00"
@.str.1 = [10 x i8] c"y=%i x=%i\00"
@.str.2 = [13 x i8] c"\0Ay= %i x=%i\0A\00"
@.str.3 = [11 x i8] c"\09--test 3\0A\00"
@.str.4 = [10 x i8] c"z=%i x=%i\00"
@.str.5 = [13 x i8] c"\0Az= %i x=%i\0A\00"
@.str.6 = [12 x i8] c"\09--test 4*\0A\00"
@.str.7 = [10 x i8] c"g=%i x=%i\00"
@.str.8 = [13 x i8] c"\0Ag= %i x=%i\0A\00"
define void @zmienne(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 2
store i32 %11, i32* %2
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %16, i32 %17)
%19 = load i32, i32* %2
%20 = srem i32 %19, 3
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = srem i32 %21, 4
store i32 %22, i32* %2
%23 = add nsw i32 %20, %22
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %24, i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%28 = load i32, i32* %5
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 %28, i32 %29)
%31 = load i32, i32* %2
%32 = mul nsw i32 %31, 2
store i32 %32, i32* %2
store i32 %32, i32* %5
%33 = load i32, i32* %5
%34 = load i32, i32* %2
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %33, i32 %34)
ret void
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"y=%i x=%i\00"
@.str.2 = [13 x i8] c"\0Ay= %i x=%i\0A\00"
@.str.4 = [10 x i8] c"z=%i x=%i\00"
@.str.5 = [13 x i8] c"\0Az= %i x=%i\0A\00"
@.str.7 = [10 x i8] c"g=%i x=%i\00"
@.str.8 = [13 x i8] c"\0Ag= %i x=%i\0A\00"
@str = [10 x i8] c"\09--test 2\00"
@str.9 = [10 x i8] c"\09--test 3\00"
@str.10 = [11 x i8] c"\09--test 4*\00"
define void @zmienne(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %0)
%4 = add nsw i32 %0, 2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %4, i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.9, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 0, i32 %4)
%8 = srem i32 %4, 3
%9 = shl nsw i32 %8, 1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %9, i32 %8)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.10, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i32 0, i32 %8)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 %9, i32 %9)
ret void
}