#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 /*<<< orphan*/ scanf(char *, int *, int *, int *, int *, int *, int *);
int main() {
  int n = 8;
  int t[n];
  printf("Podaj %d liczb calkowitych:\n", n);
  scanf("%d %d %d %d %d %d", &t[0], &t[1], &t[2], &t[3], &t[4], &t[5]);
  printf("Wczytano: %d %d %d %d %d %d\n", t[0], t[1], t[2], t[3], t[4], t[5]);
  printf("Od konca: %d %d %d %d %d %d\n", t[5], t[4], t[3], t[2], t[1], t[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
mov    %rsi,%rdx
add    $0x4,%rdx
mov    %rsi,%rcx
add    $0x8,%rcx
mov    %rsi,%r8
add    $0xc,%r8
mov    %rsi,%r9
add    $0x10,%r9
mov    %rsi,%rax
add    $0x14,%rax
lea    0xe88(%rip),%rdi
sub    $0x10,%rsp
mov    %rax,(%rsp)
call   1040 <scanf@plt>
add    $0x10,%rsp
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%eax
lea    0xe6b(%rip),%rdi
sub    $0x10,%rsp
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
mov    -0x20(%rbp),%rax
mov    0x14(%rax),%esi
mov    0x10(%rax),%edx
mov    0xc(%rax),%ecx
mov    0x8(%rax),%r8d
mov    0x4(%rax),%r9d
mov    (%rax),%eax
lea    0xe58(%rip),%rdi
sub    $0x10,%rsp
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xed5(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x20(%rsp),%r9
lea    0x24(%rsp),%rax
mov    %rax,(%rsp)
lea    0xec2(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x20(%rsp),%r9d
mov    0x24(%rsp),%eax
mov    %eax,(%rsp)
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x24(%rsp),%esi
mov    0x20(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%r9d
mov    %eax,(%rsp)
lea    0xe98(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Podaj %d liczb calkowitych:\0A\00"
@.str.1 = [18 x i8] c"%d %d %d %d %d %d\00"
@.str.2 = [29 x i8] c"Wczytano: %d %d %d %d %d %d\0A\00"
@.str.3 = [29 x i8] c"Od konca: %d %d %d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 8, i32* %1
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i32, i64 %5
store i64 %5, i64* %3
%8 = load i32, i32* %1
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i32, i32* %7, i64 0
%11 = getelementptr inbounds i32, i32* %7, i64 1
%12 = getelementptr inbounds i32, i32* %7, i64 2
%13 = getelementptr inbounds i32, i32* %7, i64 3
%14 = getelementptr inbounds i32, i32* %7, i64 4
%15 = getelementptr inbounds i32, i32* %7, i64 5
%16 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* %10, i32* %11, i32* %12, i32* %13, i32* %14, i32* %15)
%17 = getelementptr inbounds i32, i32* %7, i64 0
%18 = load i32, i32* %17
%19 = getelementptr inbounds i32, i32* %7, i64 1
%20 = load i32, i32* %19
%21 = getelementptr inbounds i32, i32* %7, i64 2
%22 = load i32, i32* %21
%23 = getelementptr inbounds i32, i32* %7, i64 3
%24 = load i32, i32* %23
%25 = getelementptr inbounds i32, i32* %7, i64 4
%26 = load i32, i32* %25
%27 = getelementptr inbounds i32, i32* %7, i64 5
%28 = load i32, i32* %27
%29 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %18, i32 %20, i32 %22, i32 %24, i32 %26, i32 %28)
%30 = getelementptr inbounds i32, i32* %7, i64 5
%31 = load i32, i32* %30
%32 = getelementptr inbounds i32, i32* %7, i64 4
%33 = load i32, i32* %32
%34 = getelementptr inbounds i32, i32* %7, i64 3
%35 = load i32, i32* %34
%36 = getelementptr inbounds i32, i32* %7, i64 2
%37 = load i32, i32* %36
%38 = getelementptr inbounds i32, i32* %7, i64 1
%39 = load i32, i32* %38
%40 = getelementptr inbounds i32, i32* %7, i64 0
%41 = load i32, i32* %40
%42 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %31, i32 %33, i32 %35, i32 %37, i32 %39, i32 %41)
%43 = load i8*, i8** %2
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Podaj %d liczb calkowitych:\0A\00"
@.str.1 = [18 x i8] c"%d %d %d %d %d %d\00"
@.str.2 = [29 x i8] c"Wczytano: %d %d %d %d %d %d\0A\00"
@.str.3 = [29 x i8] c"Od konca: %d %d %d %d %d %d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 1
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 2
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 3
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 4
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 5
%9 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8)
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = load i32, i32* %2
%23 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i32 %22)
ret i32 0
}