#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 */
typedef int /*<<< orphan*/ vector;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int imdireccion(int dimen) {
  int i, j, filas, columnas;
  if (dimen == 1) {
    int vector[] = {-1, -2, -3, -4, -5, -6, -7, -8, -9, -10};
    int *p;
    filas = sizeof(vector) / sizeof(vector[0]);
    printf("\nLas direcciones de las entradas impares del vector, son:\n");
    for (i = 0; i < filas; i++) {
      if (i % 2 != 0)
        printf("&p[%d] = %p\n", i, &vector[i]);
    }
  } else {
    int vector[][3] = {{-1, -2, -3}, {-4, -5, -6}};
    int(*p)[][3];
    filas = sizeof(vector) / sizeof(vector[0]);
    columnas = sizeof(vector[0]) / sizeof(vector[0][0]);
    printf("\nLas direcciones de las entradas impares del vector, son:\n");
    int k = 0;
    for (i = 0; i < filas; i++) {
      for (j = 0; j < columnas; j++) {
        if ((i + j) % 2 != 0)
          printf("&p[%d] = %p\n", k, &vector[i][j]);
        k++;
      }
    }
  }
}


x86 assembly (clang, -O0):
<imdireccion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11be <imdireccion+0x9e>
lea    -0x40(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0xa,-0x14(%rbp)
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b9 <imdireccion+0x99>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11a6 <imdireccion+0x86>
mov    -0xc(%rbp),%esi
movslq -0xc(%rbp),%rax
lea    -0x40(%rbp),%rdx
shl    $0x2,%rax
add    %rax,%rdx
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ab <imdireccion+0x8b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <imdireccion+0x46>
jmp    1299 <imdireccion+0x179>
mov    0xe6b(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe68(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe65(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1294 <imdireccion+0x174>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1281 <imdireccion+0x161>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     126a <imdireccion+0x14a>
mov    -0x6c(%rbp),%esi
movslq -0xc(%rbp),%rax
lea    -0x60(%rbp),%rdx
imul   $0xc,%rax,%rax
add    %rax,%rdx
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    121c <imdireccion+0xfc>
jmp    1286 <imdireccion+0x166>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1209 <imdireccion+0xe9>
jmp    1299 <imdireccion+0x179>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imdireccion>:
push   %rbx
sub    $0x30,%rsp
cmp    $0x1,%edi
jne    11c3 <imdireccion+0xa3>
mov    0xeeb(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rdx
lea    0xedf(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1c(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x24(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x9,%esi
jmp    1222 <imdireccion+0x102>
mov    0xe76(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xe5a(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rdx
lea    0xe56(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.imdireccion.vector = [10 x i32] [i32 -1, i32 -2, i32 -3, i32 -4, i32 -5, i32 -6, i32 -7, i32 -8, i32 -9, i32 -10]
@.str = [59 x i8] c"\0ALas direcciones de las entradas impares del vector, son:\0A\00"
@.str.1 = [13 x i8] c"&p[%d] = %p\0A\00"
@__const.imdireccion.vector.2 = [2 x [3 x i32]] [[3 x i32] [i32 -1, i32 -2, i32 -3], [3 x i32] [i32 -4, i32 -5, i32 -6]]
define i32 @imdireccion(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [10 x i32]
%9 = alloca i32*
%10 = alloca [2 x [3 x i32]]
%11 = alloca [0 x [3 x i32]]*
%12 = alloca i32
store i32 %0, i32* %3
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %37
15: ; preds = %1
%16 = bitcast [10 x i32]* %8 to i8*
store i32 10, i32* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %18
18: ; preds = %33, %15
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %36
22: ; preds = %18
%23 = load i32, i32* %4
%24 = srem i32 %23, 2
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = load i32, i32* %4
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [10 x i32], [10 x i32]* %8, i64 0, i64 %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32* %30)
br label %32
32: ; preds = %26, %22
br label %33
33: ; preds = %32
%34 = load i32, i32* %4
%35 = add nsw i32 %34, 1
store i32 %35, i32* %4
br label %18
36: ; preds = %18
br label %75
37: ; preds = %1
%38 = bitcast [2 x [3 x i32]]* %10 to i8*
store i32 2, i32* %6
store i32 3, i32* %7
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %12
store i32 0, i32* %4
br label %40
40: ; preds = %71, %37
%41 = load i32, i32* %4
%42 = load i32, i32* %6
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %74
44: ; preds = %40
store i32 0, i32* %5
br label %45
45: ; preds = %67, %44
%46 = load i32, i32* %5
%47 = load i32, i32* %7
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %70
49: ; preds = %45
%50 = load i32, i32* %4
%51 = load i32, i32* %5
%52 = add nsw i32 %50, %51
%53 = srem i32 %52, 2
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %64
55: ; preds = %49
%56 = load i32, i32* %12
%57 = load i32, i32* %4
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %10, i64 0, i64 %58
%60 = load i32, i32* %5
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [3 x i32], [3 x i32]* %59, i64 0, i64 %61
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %56, i32* %62)
br label %64
64: ; preds = %55, %49
%65 = load i32, i32* %12
%66 = add nsw i32 %65, 1
store i32 %66, i32* %12
br label %67
67: ; preds = %64
%68 = load i32, i32* %5
%69 = add nsw i32 %68, 1
store i32 %69, i32* %5
br label %45
70: ; preds = %45
br label %71
71: ; preds = %70
%72 = load i32, i32* %4
%73 = add nsw i32 %72, 1
store i32 %73, i32* %4
br label %40
74: ; preds = %40
br label %75
75: ; preds = %74, %36
%76 = load i32, i32* %2
ret i32 %76
}

LLVM IR (-O2):
@__const.imdireccion.vector = [10 x i32] [i32 -1, i32 -2, i32 -3, i32 -4, i32 -5, i32 -6, i32 -7, i32 -8, i32 -9, i32 -10]
@.str.1 = [13 x i8] c"&p[%d] = %p\0A\00"
@__const.imdireccion.vector.2 = [2 x [3 x i32]] [[3 x i32] [i32 -1, i32 -2, i32 -3], [3 x i32] [i32 -4, i32 -5, i32 -6]]
@str.3 = [58 x i8] c"\0ALas direcciones de las entradas impares del vector, son:\00"
define i32 @imdireccion(i32 %0) {
%2 = alloca [10 x i32]
%3 = alloca [2 x [3 x i32]]
%4 = icmp eq i32 %0, 1
br i1 %4, label %5, label %18
5: ; preds = %1
%6 = bitcast [10 x i32]* %2 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.3, i64 0, i64 0))
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1, i32* %8)
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 3, i32* %10)
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 5, i32* %12)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 7, i32* %14)
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 9, i32* %16)
br label %27
18: ; preds = %1
%19 = bitcast [2 x [3 x i32]]* %3 to i8*
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.3, i64 0, i64 0))
%21 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %3, i64 0, i64 0, i64 1
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1, i32* %21)
%23 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %3, i64 0, i64 1, i64 0
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 3, i32* %23)
%25 = getelementptr inbounds [2 x [3 x i32]], [2 x [3 x i32]]* %3, i64 0, i64 1, i64 2
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 5, i32* %25)
br label %27
27: ; preds = %18, %5
ret i32 undef
}