#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*/ petla_for_i_plus_plus(int *, int);
int /*<<< orphan*/ petla_for_plus_plus_i(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ zmienne(int);
int main() {
  int tab[5] = {1, 2, 3, 4, 5};
  printf("Roznica w dzialaniu i++ / ++i :\n");
  petla_for_i_plus_plus(tab, 5);
  printf("\n");
  petla_for_plus_plus_i(tab, 5);
  printf("\n\nRoznica w przypisywaniu wartosci zmiennym : \n");
  zmienne(5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xea5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1060 <petla_for_i_plus_plus@plt>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <petla_for_plus_plus_i@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1050 <zmienne@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xeb5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1070 <petla_for_i_plus_plus@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <petla_for_plus_plus_i@plt>
lea    0xe90(%rip),%rdi
call   1040 <puts@plt>
mov    $0x5,%edi
call   1060 <zmienne@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.tab = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [33 x i8] c"Roznica w dzialaniu i++ / ++i :\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [48 x i8] c"\0A\0ARoznica w przypisywaniu wartosci zmiennym : \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = call i32 @petla_for_i_plus_plus(i32* %5, i32 5)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = call i32 @petla_for_plus_plus_i(i32* %8, i32 5)
%10 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @zmienne(i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.tab = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@str = [32 x i8] c"Roznica w dzialaniu i++ / ++i :\00"
@str.3 = [47 x i8] c"\0A\0ARoznica w przypisywaniu wartosci zmiennym : \00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @petla_for_i_plus_plus(i32* %4, i32 5)
%6 = call i32 @putchar(i32 10)
%7 = call i32 @petla_for_plus_plus_i(i32* %4, i32 5)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.3, i64 0, i64 0))
%9 = call i32 @zmienne(i32 5)
ret i32 0
}