#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*/ floats_mat_AB(float const *, int, int, float const *, int,
                                 int, float *, int, int);
void floats_mat_ABC(const float *A, int Arows, int Acols, const float *B,
                    int Brows, int Bcols, const float *C, int Crows, int Ccols,
                    float *R, int Rrows, int Rcols) {
  float tmp[Arows * Bcols];
  floats_mat_AB(A, Arows, Acols, B, Brows, Bcols, tmp, Arows, Bcols);
  floats_mat_AB(tmp, Arows, Bcols, C, Crows, Ccols, R, Rrows, Rcols);
}


x86 assembly (clang, -O0):
<floats_mat_ABC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x20(%rbp),%ecx
imul   %ecx,%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%r11
sub    %rcx,%r11
mov    %r11,-0x38(%rbp)
mov    %r11,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0xc(%rbp),%r10d
mov    -0x20(%rbp),%eax
sub    $0x20,%rsp
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <floats_mat_AB@plt>
mov    -0x38(%rbp),%rdi
add    $0x20,%rsp
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    0x10(%rbp),%rcx
mov    0x18(%rbp),%r8d
mov    0x20(%rbp),%r9d
mov    0x28(%rbp),%r11
mov    0x30(%rbp),%r10d
mov    0x38(%rbp),%eax
sub    $0x20,%rsp
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <floats_mat_AB@plt>
add    $0x20,%rsp
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_mat_ABC>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r13d
mov    %esi,%ebx
mov    0x20(%rbp),%r12d
mov    0x38(%rbp),%r15d
mov    %r9d,%eax
imul   %esi,%eax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r14
sub    %rax,%r14
mov    %r14,%rsp
sub    $0x8,%rsp
push   %r13
push   %rbx
push   %r14
call   1030 <floats_mat_AB@plt>
add    $0x18,%rsp
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r13d,%edx
mov    0x10(%rbp),%rcx
mov    0x18(%rbp),%r8d
mov    %r12d,%r9d
push   %r15
mov    0x30(%rbp),%eax
push   %rax
push   0x28(%rbp)
call   1030 <floats_mat_AB@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @floats_mat_ABC(float* %0, i32 %1, i32 %2, float* %3, i32 %4, i32 %5, float* %6, i32 %7, i32 %8, float* %9, i32 %10, i32 %11) {
%13 = alloca float*
%14 = alloca i32
%15 = alloca i32
%16 = alloca float*
%17 = alloca i32
%18 = alloca i32
%19 = alloca float*
%20 = alloca i32
%21 = alloca i32
%22 = alloca float*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i8*
%26 = alloca i64
store float* %0, float** %13
store i32 %1, i32* %14
store i32 %2, i32* %15
store float* %3, float** %16
store i32 %4, i32* %17
store i32 %5, i32* %18
store float* %6, float** %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store float* %9, float** %22
store i32 %10, i32* %23
store i32 %11, i32* %24
%27 = load i32, i32* %14
%28 = load i32, i32* %18
%29 = mul nsw i32 %27, %28
%30 = zext i32 %29 to i64
%31 = call i8* @llvm.stacksave()
store i8* %31, i8** %25
%32 = alloca float, i64 %30
store i64 %30, i64* %26
%33 = load float*, float** %13
%34 = load i32, i32* %14
%35 = load i32, i32* %15
%36 = load float*, float** %16
%37 = load i32, i32* %17
%38 = load i32, i32* %18
%39 = load i32, i32* %14
%40 = load i32, i32* %18
%41 = call i32 @floats_mat_AB(float* %33, i32 %34, i32 %35, float* %36, i32 %37, i32 %38, float* %32, i32 %39, i32 %40)
%42 = load i32, i32* %14
%43 = load i32, i32* %18
%44 = load float*, float** %19
%45 = load i32, i32* %20
%46 = load i32, i32* %21
%47 = load float*, float** %22
%48 = load i32, i32* %23
%49 = load i32, i32* %24
%50 = call i32 @floats_mat_AB(float* %32, i32 %42, i32 %43, float* %44, i32 %45, i32 %46, float* %47, i32 %48, i32 %49)
%51 = load i8*, i8** %25
ret void
}

LLVM IR (-O2):
define void @floats_mat_ABC(float* %0, i32 %1, i32 %2, float* %3, i32 %4, i32 %5, float* %6, i32 %7, i32 %8, float* %9, i32 %10, i32 %11) {
%13 = mul nsw i32 %5, %1
%14 = zext i32 %13 to i64
%15 = alloca float, i64 %14
%16 = call i32 @floats_mat_AB(float* %0, i32 %1, i32 %2, float* %3, i32 %4, i32 %5, float* %15, i32 %1, i32 %5)
%17 = call i32 @floats_mat_AB(float* %15, i32 %1, i32 %5, float* %6, i32 %7, i32 %8, float* %9, i32 %10, i32 %11)
ret void
}