#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*/ getch();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int i;
  int vint[5];
  int *pvint;
  for (i = 0; i < 5; i++, *pvint++) {
    printf("vetor[%d]:", i);
    scanf("%d", &vint[i]);
    pvint = &vint[i];
  }
  printf("Valores apontados pelo ponteiro \n");
  for (i = 0; i < 5; i++) {
    printf("%d\n", *--pvint);
  }
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11a9 <main+0x79>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x20(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe94(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x8(%rbp),%rcx
lea    -0x20(%rbp),%rax
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
jmp    1146 <main+0x16>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    11f6 <main+0xc6>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffc,%rcx
mov    %rcx,-0x28(%rbp)
mov    -0x4(%rax),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11be <main+0x8e>
mov    $0x0,%al
call   1050 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaa(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe2f(%rip),%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%esi
lea    0xe1b(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"vetor[%d]:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [34 x i8] c"Valores apontados pelo ponteiro \0A\00"
@.str.3 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
br label %5
5: ; preds = %18, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %16
store i32* %17, i32** %4
br label %18
18: ; preds = %8
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %4
%23 = load i32, i32* %21
br label %5
24: ; preds = %5
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %26
26: ; preds = %34, %24
%27 = load i32, i32* %2
%28 = icmp slt i32 %27, 5
br i1 %28, label %29, label %37
29: ; preds = %26
%30 = load i32*, i32** %4
%31 = getelementptr inbounds i32, i32* %30, i32 -1
store i32* %31, i32** %4
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %29
%35 = load i32, i32* %2
%36 = add nsw i32 %35, 1
store i32 %36, i32* %2
br label %26
37: ; preds = %26
%38 = call i32 (...) @getch()
%39 = load i32, i32* %1
ret i32 %39
}

LLVM IR (-O2):
@.str = [11 x i8] c"vetor[%d]:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.3 = [4 x i8] c"%d\0A\00"
@str = [33 x i8] c"Valores apontados pelo ponteiro \00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 3)
%13 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4)
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %32)
%34 = call i32 (...) @getch()
ret i32 0
}