#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*/ modificar(int *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int count, a[3];
  printf("\nDesde main, antes de llamar a a la funcion\n");
  for (count = 0; count < 3; count++) {
    a[count] = count + 1;
    printf("a[%d] = %d\n", count, a[count]);
  }
  modificar(a);
  printf("\nDesde main, despues de llamar a a la funcion\n");
  for (count = 0; count < 3; count++)
    printf("a[%d] = %d\n", count, a[count]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1183 <main+0x63>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
lea    -0x14(%rbp),%rdi
call   1040 <modificar@plt>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11d2 <main+0xb2>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%edx
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a1 <main+0x81>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,0x4(%rsp)
lea    0xeb0(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x2,0x8(%rsp)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x3,0xc(%rsp)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1050 <modificar@plt>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%edx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [12 x i8] c"a[%d] = %d\0A\00"
@str = [44 x i8] c"\0ADesde main, antes de llamar a a la funcion\00"
@str.3 = [46 x i8] c"\0ADesde main, despues de llamar a a la funcion\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32 1, i32* %4
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1)
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
store i32 2, i32* %6
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2)
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
store i32 3, i32* %8
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 3)
%10 = call i32 @modificar(i32* %4)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.3, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %12)
%14 = load i32, i32* %6
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %14)
%16 = load i32, i32* %8
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 %16)
ret i32 0
}