#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*/ multiplicarMatrices(int, double *, double *, double *, int,
                                       int);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  double matrixA[12] = {1.0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
  double matrixB[6] = {11, 21, 42, 32, 13, 83};
  double matrixC[8] = {0, 0, 0, 0, 0, 0, 0, 0};
  int filasA = 4;
  int columnasB = 2;
  int columnasA = 3;
  multiplicarMatrices(filasA, matrixB, matrixC, matrixA, columnasB, columnasA);
  int i = 0;
  for (i = 0; i < 8; i++) {
    printf("%f, ", matrixC[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xecc(%rip),%rsi
mov    $0x60,%edx
call   1050 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xe87(%rip),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xe57(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xe3f(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  0xe2a(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
movl   $0x4,-0xe4(%rbp)
movl   $0x2,-0xe8(%rbp)
movl   $0x3,-0xec(%rbp)
mov    -0xe4(%rbp),%edi
lea    -0xa0(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    -0x70(%rbp),%rcx
mov    -0xe8(%rbp),%r8d
mov    -0xec(%rbp),%r9d
call   1060 <multiplicarMatrices@plt>
movl   $0x0,-0xf0(%rbp)
movl   $0x0,-0xf0(%rbp)
cmpl   $0x8,-0xf0(%rbp)
jge    1288 <main+0x148>
movslq -0xf0(%rbp),%rax
movsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
mov    -0xf0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf0(%rbp)
jmp    124b <main+0x10b>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
movaps 0xf51(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf32(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xf13(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xef4(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xeb6(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe7a(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe7e(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe82(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x40(%rsp),%rsi
mov    %rsp,%rdx
lea    0x70(%rsp),%rcx
mov    $0x4,%edi
mov    $0x2,%r8d
mov    $0x3,%r9d
call   1040 <multiplicarMatrices@plt>
movsd  (%rsp),%xmm0
lea    0xea8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x30(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.matrixA = [12 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 9.000000e+00, double 1.000000e+01, double 1.100000e+01, double 1.200000e+01]
@.str = [5 x i8] c"%f, \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [12 x double]
%7 = alloca [6 x double]
%8 = alloca [8 x double]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = bitcast [12 x double]* %6 to i8*
%14 = bitcast [6 x double]* %7 to i8*
%15 = bitcast i8* %14 to [6 x double]*
%16 = getelementptr inbounds [6 x double], [6 x double]* %15, i32 0, i32 0
store double 1.100000e+01, double* %16
%17 = getelementptr inbounds [6 x double], [6 x double]* %15, i32 0, i32 1
store double 2.100000e+01, double* %17
%18 = getelementptr inbounds [6 x double], [6 x double]* %15, i32 0, i32 2
store double 4.200000e+01, double* %18
%19 = getelementptr inbounds [6 x double], [6 x double]* %15, i32 0, i32 3
store double 3.200000e+01, double* %19
%20 = getelementptr inbounds [6 x double], [6 x double]* %15, i32 0, i32 4
store double 1.300000e+01, double* %20
%21 = getelementptr inbounds [6 x double], [6 x double]* %15, i32 0, i32 5
store double 8.300000e+01, double* %21
%22 = bitcast [8 x double]* %8 to i8*
store i32 4, i32* %9
store i32 2, i32* %10
store i32 3, i32* %11
%23 = load i32, i32* %9
%24 = getelementptr inbounds [6 x double], [6 x double]* %7, i64 0, i64 0
%25 = getelementptr inbounds [8 x double], [8 x double]* %8, i64 0, i64 0
%26 = getelementptr inbounds [12 x double], [12 x double]* %6, i64 0, i64 0
%27 = load i32, i32* %10
%28 = load i32, i32* %11
%29 = call i32 @multiplicarMatrices(i32 %23, double* %24, double* %25, double* %26, i32 %27, i32 %28)
store i32 0, i32* %12
store i32 0, i32* %12
br label %30
30: ; preds = %39, %2
%31 = load i32, i32* %12
%32 = icmp slt i32 %31, 8
br i1 %32, label %33, label %42
33: ; preds = %30
%34 = load i32, i32* %12
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [8 x double], [8 x double]* %8, i64 0, i64 %35
%37 = load double, double* %36
%38 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %37)
br label %39
39: ; preds = %33
%40 = load i32, i32* %12
%41 = add nsw i32 %40, 1
store i32 %41, i32* %12
br label %30
42: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@__const.main.matrixA = [12 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 9.000000e+00, double 1.000000e+01, double 1.100000e+01, double 1.200000e+01]
@.str = [5 x i8] c"%f, \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x double]
%4 = alloca [6 x double]
%5 = alloca [8 x double]
%6 = bitcast [12 x double]* %3 to i8*
%7 = bitcast [6 x double]* %4 to i8*
%8 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 0
%9 = bitcast [6 x double]* %4 to <2 x double>*
store <2 x double> <double 1.100000e+01, double 2.100000e+01>, <2 x double>* %9
%10 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 2
%11 = bitcast double* %10 to <2 x double>*
store <2 x double> <double 4.200000e+01, double 3.200000e+01>, <2 x double>* %11
%12 = getelementptr inbounds [6 x double], [6 x double]* %4, i64 0, i64 4
%13 = bitcast double* %12 to <2 x double>*
store <2 x double> <double 1.300000e+01, double 8.300000e+01>, <2 x double>* %13
%14 = bitcast [8 x double]* %5 to i8*
%15 = getelementptr inbounds [8 x double], [8 x double]* %5, i64 0, i64 0
%16 = getelementptr inbounds [12 x double], [12 x double]* %3, i64 0, i64 0
%17 = call i32 @multiplicarMatrices(i32 4, double* %8, double* %15, double* %16, i32 2, i32 3)
%18 = load double, double* %15
%19 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %18)
%20 = getelementptr inbounds [8 x double], [8 x double]* %5, i64 0, i64 1
%21 = load double, double* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %21)
%23 = getelementptr inbounds [8 x double], [8 x double]* %5, i64 0, i64 2
%24 = load double, double* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %24)
%26 = getelementptr inbounds [8 x double], [8 x double]* %5, i64 0, i64 3
%27 = load double, double* %26
%28 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %27)
%29 = getelementptr inbounds [8 x double], [8 x double]* %5, i64 0, i64 4
%30 = load double, double* %29
%31 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %30)
%32 = getelementptr inbounds [8 x double], [8 x double]* %5, i64 0, i64 5
%33 = load double, double* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %33)
%35 = getelementptr inbounds [8 x double], [8 x double]* %5, i64 0, i64 6
%36 = load double, double* %35
%37 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %36)
%38 = getelementptr inbounds [8 x double], [8 x double]* %5, i64 0, i64 7
%39 = load double, double* %38
%40 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %39)
ret i32 0
}