#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 imparreglos(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 entradas impares del vector, son:\n");
    for (i = 0; i < filas; i++) {
      if (i % 2 != 0)
        printf("p[%d] = %d\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 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] = %d\n", k, vector[i][j]);
        k++;
      }
    }
  }
}


x86 assembly (clang, -O0):
<imparreglos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11b7 <imparreglos+0x97>
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    11b2 <imparreglos+0x92>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     119f <imparreglos+0x7f>
mov    -0xc(%rbp),%esi
movslq -0xc(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edx
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a4 <imparreglos+0x84>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <imparreglos+0x46>
jmp    128e <imparreglos+0x16e>
mov    0xe72(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe6f(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe6c(%rip),%rax
mov    %rax,-0x50(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
lea    0xe5b(%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    1289 <imparreglos+0x169>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1276 <imparreglos+0x156>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     125f <imparreglos+0x13f>
mov    -0x6c(%rbp),%esi
movslq -0xc(%rbp),%rcx
lea    -0x60(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe18(%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    1215 <imparreglos+0xf5>
jmp    127b <imparreglos+0x15b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1202 <imparreglos+0xe2>
jmp    128e <imparreglos+0x16e>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imparreglos>:
push   %rbx
cmp    $0x1,%edi
jne    1198 <imparreglos+0x78>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xec7(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0xfffffffe,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0xfffffffc,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0xfffffffa,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0xfffffff8,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0xfffffff6,%edx
jmp    11e0 <imparreglos+0xc0>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe55(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0xfffffffe,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0xfffffffc,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0xfffffffa,%edx
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [12 x i8] c"p[%d] = %d\0A\00"
@str.3 = [39 x i8] c"\0ALas entradas impares del vector, son:\00"
define i32 @imparreglos(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.3, i64 0, i64 0))
%5 = 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)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 -4)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 -6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 7, 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 9, i32 -10)
br label %15
10: ; preds = %1
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.3, i64 0, i64 0))
%12 = 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)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 3, i32 -4)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 5, i32 -6)
br label %15
15: ; preds = %10, %3
ret i32 undef
}