#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, int);
int /*<<< orphan*/ wypisz(int *, int);
int main() {
  int tmp, a = 2;
  int tab1[5] = {1, 2, 3, 4, 5};
  int tab2[5] = {1, 2, 3, 4, 5};
  tmp = a;
  tab1[a++] = 0;
  a = tmp;
  tab2[++a] = 0;
  wypisz(tab1, 5);
  wypisz(tab2, 5);
  int y, z, x = 10;
  y = (x += 2);
  z = (x %= 3) + (x %= 4);
  printf("x=%d, y=%d, z=%d\n", x, y, z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cltq
movl   $0x0,-0x20(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cltq
movl   $0x0,-0x40(%rbp,%rax,4)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <wypisz@plt>
lea    -0x40(%rbp),%rdi
mov    $0x5,%esi
call   1040 <wypisz@plt>
movl   $0xa,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4c(%rbp)
mov    %eax,-0x44(%rbp)
mov    -0x4c(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x50(%rbp)
mov    %edx,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    -0x50(%rbp),%edx
mov    %eax,-0x4c(%rbp)
add    %eax,%edx
mov    %edx,-0x48(%rbp)
mov    -0x4c(%rbp),%esi
mov    -0x44(%rbp),%edx
mov    -0x48(%rbp),%ecx
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,(%rsp)
mov    %eax,0x10(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x20(%rsp),%rdi
mov    $0x5,%esi
call   1040 <wypisz@plt>
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <wypisz@plt>
lea    0xe9f(%rip),%rdi
xor    %esi,%esi
mov    $0xc,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@__const.main.tab2 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [18 x i8] c"x=%d, y=%d, z=%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
store i32 0, i32* %5
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 3
store i32 0, i32* %6
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%8 = call i32 @wypisz(i32* %7, i32 5)
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = call i32 @wypisz(i32* %9, i32 5)
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 0, i32 12, i32 0)
ret i32 0
}