#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);
int /*<<< orphan*/ free(float *);
scalar_t__ malloc(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 = (float *)malloc(sizeof(float) * 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);
  free(tmp);
}


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)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
movslq -0x20(%rbp),%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%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    -0x28(%rbp),%r11
mov    -0xc(%rbp),%r10d
mov    -0x20(%rbp),%eax
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1050 <floats_mat_AB@plt>
mov    -0x28(%rbp),%rdi
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
mov    %r11,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1050 <floats_mat_AB@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floats_mat_ABC>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,%ebx
mov    %r8d,0xc(%rsp)
mov    %rcx,%r15
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,%r14
mov    0x70(%rsp),%rax
mov    %rax,0x20(%rsp)
mov    0x78(%rsp),%eax
mov    %eax,0x14(%rsp)
mov    0x80(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x88(%rsp),%rax
mov    %rax,0x30(%rsp)
mov    0x90(%rsp),%eax
mov    %rax,0x28(%rsp)
mov    0x98(%rsp),%eax
mov    %rax,0x18(%rsp)
mov    %esi,%edi
imul   %r9d,%edi
shl    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%r13
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15,%rcx
mov    0x14(%rsp),%r8d
mov    %ebx,%r9d
push   %rbx
push   %rbp
push   %rax
call   1050 <floats_mat_AB@plt>
add    $0x18,%rsp
mov    %r13,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    0x28(%rsp),%rcx
mov    0x1c(%rsp),%r8d
mov    0x18(%rsp),%r9d
push   0x20(%rsp)
push   0x38(%rsp)
push   0x48(%rsp)
call   1050 <floats_mat_AB@plt>
add    $0x20,%rsp
mov    %r13,%rdi
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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 float*
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
%26 = load i32, i32* %14
%27 = sext i32 %26 to i64
%28 = mul i64 4, %27
%29 = load i32, i32* %18
%30 = sext i32 %29 to i64
%31 = mul i64 %28, %30
%32 = trunc i64 %31 to i32
%33 = call i64 @malloc(i32 %32)
%34 = inttoptr i64 %33 to float*
store float* %34, float** %25
%35 = load float*, float** %13
%36 = load i32, i32* %14
%37 = load i32, i32* %15
%38 = load float*, float** %16
%39 = load i32, i32* %17
%40 = load i32, i32* %18
%41 = load float*, float** %25
%42 = load i32, i32* %14
%43 = load i32, i32* %18
%44 = call i32 @floats_mat_AB(float* %35, i32 %36, i32 %37, float* %38, i32 %39, i32 %40, float* %41, i32 %42, i32 %43)
%45 = load float*, float** %25
%46 = load i32, i32* %14
%47 = load i32, i32* %18
%48 = load float*, float** %19
%49 = load i32, i32* %20
%50 = load i32, i32* %21
%51 = load float*, float** %22
%52 = load i32, i32* %23
%53 = load i32, i32* %24
%54 = call i32 @floats_mat_AB(float* %45, i32 %46, i32 %47, float* %48, i32 %49, i32 %50, float* %51, i32 %52, i32 %53)
%55 = load float*, float** %25
%56 = call i32 @free(float* %55)
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 = shl i32 %1, 2
%14 = mul i32 %13, %5
%15 = tail call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to float*
%17 = tail call i32 @floats_mat_AB(float* %0, i32 %1, i32 %2, float* %3, i32 %4, i32 %5, float* %16, i32 %1, i32 %5)
%18 = tail call i32 @floats_mat_AB(float* %16, i32 %1, i32 %5, float* %6, i32 %7, i32 %8, float* %9, i32 %10, i32 %11)
%19 = tail call i32 @free(float* %16)
ret void
}