#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 main(void) {
  int vector[4];
  vector[0] = 1;
  vector[1] = 2;
  vector[2] = 3;
  vector[3] = 4;
  vector[4] = 5;
  int *punt1;
  int *punt2;
  punt1 = &vector[0];
  punt2 = &vector[2];
  printf("punt1 apunta a: %d\n", *punt1);
  punt1++;
  printf("le sumo 1 ahora,punt1 apunta a: %d\n", *punt1);
  punt1++;
  printf("le sumo 1 ahora,punt1 apunta a: %d\n", *punt1);
  punt1++;
  printf("le sumo 1 ahora,punt1 apunta a: %d\n", *punt1);
  printf("punt2 apunta a: %d\n", *punt2);
  punt2--;
  printf("le resto 1 ahora,punt2 apunta a: %d\n", *punt2);
  punt2--;
  printf("le resto 1 ahora,punt2 apunta a: %d\n", *punt2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xe43(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"punt1 apunta a: %d\0A\00"
@.str.1 = [36 x i8] c"le sumo 1 ahora,punt1 apunta a: %d\0A\00"
@.str.2 = [20 x i8] c"punt2 apunta a: %d\0A\00"
@.str.3 = [37 x i8] c"le resto 1 ahora,punt2 apunta a: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 2)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}