#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, int *);
void imprimir_direcciones_impares(int *p, int longitud) {
  for (int i = 1; i < longitud; i = i + 2)
    printf("Dirección de memoria del arreglo[%d]. &p[%d]: %p\n", i, i, p + i);
}


x86 assembly (clang, -O0):
<imprimir_direcciones_impares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <imprimir_direcciones_impares+0x51>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <imprimir_direcciones_impares+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir_direcciones_impares>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     115b <imprimir_direcciones_impares+0x4b>
mov    %esi,%r14d
mov    %rdi,%rbx
add    $0x4,%rbx
mov    $0x1,%ebp
lea    0xece(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <printf@plt>
add    $0x2,%ebp
add    $0x8,%rbx
cmp    %r14d,%ebp
jl     1140 <imprimir_direcciones_impares+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"Direcci\C3\B3n de memoria del arreglo[%d]. &p[%d]: %p\0A\00"
define void @imprimir_direcciones_impares(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 1, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32, i32* %5
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32* %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 2
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"Direcci\C3\B3n de memoria del arreglo[%d]. &p[%d]: %p\0A\00"
define void @imprimir_direcciones_impares(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 1, %2 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = trunc i64 %6 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %8, i32* %7)
%10 = add nuw i64 %6, 2
%11 = trunc i64 %10 to i32
%12 = icmp slt i32 %11, %1
br i1 %12, label %5, label %4
}