#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 *);
void fun2(int *apuntador, int dim) {
  int i;
  for (i = 0; 2 * i + 1 < dim; i++)
    printf("&arreglo[%d] = %p\n", 2 * i + 1, (apuntador + (2 * i + 1)));
}


x86 assembly (clang, -O0):
<fun2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cmp    -0xc(%rbp),%eax
jge    1171 <fun2+0x61>
mov    -0x10(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fun2+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     1147 <fun2+0x37>
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x1,%ebp
lea    0xed3(%rip),%r15
nopl   (%rax)
mov    %ebp,%eax
lea    (%r14,%rax,4),%rdx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x2,%ebp
cmp    %ebx,%ebp
jl     1130 <fun2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"&arreglo[%d] = %p\0A\00"
define void @fun2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %23, %2
%7 = load i32, i32* %5
%8 = mul nsw i32 2, %7
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %26
12: ; preds = %6
%13 = load i32, i32* %5
%14 = mul nsw i32 2, %13
%15 = add nsw i32 %14, 1
%16 = load i32*, i32** %3
%17 = load i32, i32* %5
%18 = mul nsw i32 2, %17
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %16, i64 %20
%22 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %15, i32* %21)
br label %23
23: ; preds = %12
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %6
26: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"&arreglo[%d] = %p\0A\00"
define void @fun2(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %15
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %13, %4 ], [ 1, %2 ]
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6, i32* %8)
%10 = add nuw i64 %5, 1
%11 = trunc i64 %10 to i32
%12 = shl nuw nsw i32 %11, 1
%13 = or i32 %12, 1
%14 = icmp slt i32 %13, %1
br i1 %14, label %4, label %15
15: ; preds = %4, %2
ret void
}