main() {
  int arreglo[10];
  int i, j, dim2, row, col;
  int dim1 = sizeof(arreglo) / sizeof(arreglo[0]);
  int arreglo2[7][3];
  for (i = 0; i < dim1; i++)
    arreglo[i] = i + 8;
  printf("Entradas del arreglo dimensión 1\n");
  fun1(arreglo, dim1);
  printf("Dirección de memoria del arreglo dimensión 1\n");
  fun2(arreglo, dim1);
  row = sizeof(arreglo2) / sizeof(arreglo2[0]);
  col = sizeof(arreglo2[0]) / sizeof(arreglo2[0][0]);
  dim2 = row * col;
  for (i = 0; i < row; i++) {
    for (j = 0; j < col; j++)
      arreglo2[i][j] = -(j + i + 1);
  }
  printf("Entradas del arreglo dimensión 2\n");
  fun1(arreglo2, dim2);
  printf("Dirección de memoria del arreglo dimensión 2\n");
  fun2(arreglo2, dim2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x48(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    1178 <main+0x48>
mov    -0x34(%rbp),%ecx
add    $0x8,%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1150 <main+0x20>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x48(%rbp),%esi
mov    $0x0,%al
call   1050 <fun1@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x48(%rbp),%esi
mov    $0x0,%al
call   1030 <fun2@plt>
movl   $0x7,-0x40(%rbp)
movl   $0x3,-0x44(%rbp)
mov    -0x40(%rbp),%eax
imul   -0x44(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x40(%rbp),%eax
jge    1235 <main+0x105>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    1222 <main+0xf2>
mov    -0x38(%rbp),%eax
add    -0x34(%rbp),%eax
add    $0x1,%eax
xor    %edx,%edx
sub    %eax,%edx
movslq -0x34(%rbp),%rcx
lea    -0xa0(%rbp),%rax
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0x38(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11e2 <main+0xb2>
jmp    1227 <main+0xf7>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11cf <main+0x9f>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    $0x0,%al
call   1050 <fun1@plt>
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    $0x0,%al
call   1030 <fun2@plt>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x1100000010,%rax
mov    %rax,0x20(%rsp)
lea    0xf0b(%rip),%rdi
call   1040 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <fun1@plt>
lea    0xf0f(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <fun2@plt>
movaps 0xe82(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe86(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe8a(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe8e(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe92(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movl   $0xfffffff7,0x80(%rsp)
f7 ff ff ff
lea    0xedc(%rip),%rdi
call   1040 <puts@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x15,%esi
xor    %eax,%eax
call   1050 <fun1@plt>
lea    0xede(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    $0x15,%esi
xor    %eax,%eax
call   1030 <fun2@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Entradas del arreglo dimensi\C3\B3n 1\0A\00"
@.str.1 = [48 x i8] c"Direcci\C3\B3n de memoria del arreglo dimensi\C3\B3n 1\0A\00"
@.str.2 = [35 x i8] c"Entradas del arreglo dimensi\C3\B3n 2\0A\00"
@.str.3 = [48 x i8] c"Direcci\C3\B3n de memoria del arreglo dimensi\C3\B3n 2\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [7 x [3 x i32]]
store i32 0, i32* %1
store i32 10, i32* %8
store i32 0, i32* %3
br label %10
10: ; preds = %20, %0
%11 = load i32, i32* %3
%12 = load i32, i32* %8
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 8
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %18
store i32 %16, i32* %19
br label %20
20: ; preds = %14
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %10
23: ; preds = %10
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%26 = load i32, i32* %8
%27 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @fun1 to i32 (i32*, i32, ...)*)(i32* %25, i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%30 = load i32, i32* %8
%31 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @fun2 to i32 (i32*, i32, ...)*)(i32* %29, i32 %30)
store i32 7, i32* %6
store i32 3, i32* %7
%32 = load i32, i32* %6
%33 = load i32, i32* %7
%34 = mul nsw i32 %32, %33
store i32 %34, i32* %5
store i32 0, i32* %3
br label %35
35: ; preds = %60, %23
%36 = load i32, i32* %3
%37 = load i32, i32* %6
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %63
39: ; preds = %35
store i32 0, i32* %4
br label %40
40: ; preds = %56, %39
%41 = load i32, i32* %4
%42 = load i32, i32* %7
%43 = icmp slt i32 %41, %42
br i1 %43, label %44, label %59
44: ; preds = %40
%45 = load i32, i32* %4
%46 = load i32, i32* %3
%47 = add nsw i32 %45, %46
%48 = add nsw i32 %47, 1
%49 = sub nsw i32 0, %48
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %9, i64 0, i64 %51
%53 = load i32, i32* %4
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [3 x i32], [3 x i32]* %52, i64 0, i64 %54
store i32 %49, i32* %55
br label %56
56: ; preds = %44
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 1
store i32 %58, i32* %4
br label %40
59: ; preds = %40
br label %60
60: ; preds = %59
%61 = load i32, i32* %3
%62 = add nsw i32 %61, 1
store i32 %62, i32* %3
br label %35
63: ; preds = %35
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%65 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %9, i64 0, i64 0
%66 = load i32, i32* %5
%67 = call i32 ([3 x i32]*, i32, ...) bitcast (i32 (...)* @fun1 to i32 ([3 x i32]*, i32, ...)*)([3 x i32]* %65, i32 %66)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
%69 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %9, i64 0, i64 0
%70 = load i32, i32* %5
%71 = call i32 ([3 x i32]*, i32, ...) bitcast (i32 (...)* @fun2 to i32 ([3 x i32]*, i32, ...)*)([3 x i32]* %69, i32 %70)
%72 = load i32, i32* %1
ret i32 %72
}

LLVM IR (-O2):
@str = [34 x i8] c"Entradas del arreglo dimensi\C3\B3n 1\00"
@str.4 = [47 x i8] c"Direcci\C3\B3n de memoria del arreglo dimensi\C3\B3n 1\00"
@str.5 = [34 x i8] c"Entradas del arreglo dimensi\C3\B3n 2\00"
@str.6 = [47 x i8] c"Direcci\C3\B3n de memoria del arreglo dimensi\C3\B3n 2\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [7 x [3 x i32]]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [7 x [3 x i32]]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = bitcast [10 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 8, i32 9, i32 10, i32 11>, <4 x i32>* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 12, i32 13, i32 14, i32 15>, <4 x i32>* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
store i32 16, i32* %9
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
store i32 17, i32* %10
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%12 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @fun1 to i32 (i32*, i32, ...)*)(i32* %5, i32 10)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.4, i64 0, i64 0))
%14 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @fun2 to i32 (i32*, i32, ...)*)(i32* %5, i32 10)
%15 = bitcast [7 x [3 x i32]]* %2 to <4 x i32>*
store <4 x i32> <i32 -1, i32 -2, i32 -3, i32 -2>, <4 x i32>* %15
%16 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %2, i64 0, i64 1, i64 1
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 -3, i32 -4, i32 -3, i32 -4>, <4 x i32>* %17
%18 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %2, i64 0, i64 2, i64 2
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 -5, i32 -4, i32 -5, i32 -6>, <4 x i32>* %19
%20 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %2, i64 0, i64 4, i64 0
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 -5, i32 -6, i32 -7, i32 -6>, <4 x i32>* %21
%22 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %2, i64 0, i64 5, i64 1
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 -7, i32 -8, i32 -7, i32 -8>, <4 x i32>* %23
%24 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %2, i64 0, i64 6, i64 2
store i32 -9, i32* %24
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0))
%26 = getelementptr inbounds [7 x [3 x i32]], [7 x [3 x i32]]* %2, i64 0, i64 0
%27 = call i32 ([3 x i32]*, i32, ...) bitcast (i32 (...)* @fun1 to i32 ([3 x i32]*, i32, ...)*)([3 x i32]* %26, i32 21)
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.6, i64 0, i64 0))
%29 = call i32 ([3 x i32]*, i32, ...) bitcast (i32 (...)* @fun2 to i32 ([3 x i32]*, i32, ...)*)([3 x i32]* %26, i32 21)
ret i32 0
}