#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*/ imprimir_matriz(int **, int);
int /*<<< orphan*/ leer_matriz(int **, int);
int /*<<< orphan*/ multiplicar_matrices(int **, int **, int **, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int mat_a[100][100], mat_b[100][100], mat_c[100][100];
  int a;
  printf("\tMultiplicación de Matrices.\n\n");
  printf("Programa que multiplica un par de matrices.\n");
  printf("Introduzca el valor de la magnitud de la matriz: ");
  scanf("%d", &a);
  printf("Leyendo la matriz A:\n");
  leer_matriz(mat_a, a);
  printf("Leyendo la matriz B:\n");
  leer_matriz(mat_b, a);
  multiplicar_matrices(mat_a, mat_b, mat_c, a);
  printf("La multiplicación de la Matriz A:\n");
  imprimir_matriz(mat_a, a);
  printf("Por la Matriz B:\n");
  imprimir_matriz(mat_b, a);
  printf("Resulta en la Matriz:\n");
  imprimir_matriz(mat_c, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d4e0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    -0x1d4d4(%rbp),%rsi
call   1070 <scanf@plt>
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
lea    -0x9c50(%rbp),%rdi
mov    -0x1d4d4(%rbp),%esi
call   1030 <leer_matriz@plt>
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
lea    -0x13890(%rbp),%rdi
mov    -0x1d4d4(%rbp),%esi
call   1030 <leer_matriz@plt>
lea    -0x9c50(%rbp),%rdi
lea    -0x13890(%rbp),%rsi
lea    -0x1d4d0(%rbp),%rdx
mov    -0x1d4d4(%rbp),%ecx
call   1060 <multiplicar_matrices@plt>
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
lea    -0x9c50(%rbp),%rdi
mov    -0x1d4d4(%rbp),%esi
call   1050 <imprimir_matriz@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    -0x13890(%rbp),%rdi
mov    -0x1d4d4(%rbp),%esi
call   1050 <imprimir_matriz@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    -0x1d4d0(%rbp),%rdi
mov    -0x1d4d4(%rbp),%esi
call   1050 <imprimir_matriz@plt>
xor    %eax,%eax
add    $0x1d4e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1d4d0,%rsp
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
lea    0x13890(%rsp),%r15
mov    %r15,%rdi
call   1030 <leer_matriz@plt>
lea    0xecd(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
lea    0x9c50(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <leer_matriz@plt>
mov    0xc(%rsp),%ecx
lea    0x10(%rsp),%r14
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1070 <multiplicar_matrices@plt>
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
mov    %r15,%rdi
call   1060 <imprimir_matriz@plt>
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1060 <imprimir_matriz@plt>
lea    0xeaf(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
call   1060 <imprimir_matriz@plt>
xor    %eax,%eax
add    $0x1d4d0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\09Multiplicaci\C3\B3n de Matrices.\0A\0A\00"
@.str.1 = [45 x i8] c"Programa que multiplica un par de matrices.\0A\00"
@.str.2 = [50 x i8] c"Introduzca el valor de la magnitud de la matriz: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [22 x i8] c"Leyendo la matriz A:\0A\00"
@.str.5 = [22 x i8] c"Leyendo la matriz B:\0A\00"
@.str.6 = [36 x i8] c"La multiplicaci\C3\B3n de la Matriz A:\0A\00"
@.str.7 = [18 x i8] c"Por la Matriz B:\0A\00"
@.str.8 = [23 x i8] c"Resulta en la Matriz:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x [100 x i32]]
%7 = alloca [100 x [100 x i32]]
%8 = alloca [100 x [100 x i32]]
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%14 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%15 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%16 = bitcast [100 x i32]* %15 to i32**
%17 = load i32, i32* %9
%18 = call i32 @leer_matriz(i32** %16, i32 %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%20 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %7, i64 0, i64 0
%21 = bitcast [100 x i32]* %20 to i32**
%22 = load i32, i32* %9
%23 = call i32 @leer_matriz(i32** %21, i32 %22)
%24 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%25 = bitcast [100 x i32]* %24 to i32**
%26 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %7, i64 0, i64 0
%27 = bitcast [100 x i32]* %26 to i32**
%28 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %8, i64 0, i64 0
%29 = bitcast [100 x i32]* %28 to i32**
%30 = load i32, i32* %9
%31 = call i32 @multiplicar_matrices(i32** %25, i32** %27, i32** %29, i32 %30)
%32 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
%33 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%34 = bitcast [100 x i32]* %33 to i32**
%35 = load i32, i32* %9
%36 = call i32 @imprimir_matriz(i32** %34, i32 %35)
%37 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%38 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %7, i64 0, i64 0
%39 = bitcast [100 x i32]* %38 to i32**
%40 = load i32, i32* %9
%41 = call i32 @imprimir_matriz(i32** %39, i32 %40)
%42 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
%43 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %8, i64 0, i64 0
%44 = bitcast [100 x i32]* %43 to i32**
%45 = load i32, i32* %9
%46 = call i32 @imprimir_matriz(i32** %44, i32 %45)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [50 x i8] c"Introduzca el valor de la magnitud de la matriz: \00"
@.str.3 = [3 x i8] c"%d\00"
@str = [31 x i8] c"\09Multiplicaci\C3\B3n de Matrices.\0A\00"
@str.9 = [44 x i8] c"Programa que multiplica un par de matrices.\00"
@str.10 = [21 x i8] c"Leyendo la matriz A:\00"
@str.11 = [21 x i8] c"Leyendo la matriz B:\00"
@str.12 = [35 x i8] c"La multiplicaci\C3\B3n de la Matriz A:\00"
@str.13 = [17 x i8] c"Por la Matriz B:\00"
@str.14 = [22 x i8] c"Resulta en la Matriz:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x [100 x i32]]
%4 = alloca [100 x [100 x i32]]
%5 = alloca [100 x [100 x i32]]
%6 = alloca i32
%7 = bitcast [100 x [100 x i32]]* %3 to i8*
%8 = bitcast [100 x [100 x i32]]* %4 to i8*
%9 = bitcast [100 x [100 x i32]]* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.9, i64 0, i64 0))
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.10, i64 0, i64 0))
%16 = bitcast [100 x [100 x i32]]* %3 to i32**
%17 = load i32, i32* %6
%18 = call i32 @leer_matriz(i32** %16, i32 %17)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.11, i64 0, i64 0))
%20 = bitcast [100 x [100 x i32]]* %4 to i32**
%21 = load i32, i32* %6
%22 = call i32 @leer_matriz(i32** %20, i32 %21)
%23 = bitcast [100 x [100 x i32]]* %5 to i32**
%24 = load i32, i32* %6
%25 = call i32 @multiplicar_matrices(i32** %16, i32** %20, i32** %23, i32 %24)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.12, i64 0, i64 0))
%27 = load i32, i32* %6
%28 = call i32 @imprimir_matriz(i32** %16, i32 %27)
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.13, i64 0, i64 0))
%30 = load i32, i32* %6
%31 = call i32 @imprimir_matriz(i32** %20, i32 %30)
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.14, i64 0, i64 0))
%33 = load i32, i32* %6
%34 = call i32 @imprimir_matriz(i32** %23, i32 %33)
ret i32 0
}