#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*/ recmult(double *, double *, double *, int, int, int, int,
                           int, int);
void rmult(double *A, double *B, double *C, int m, int n, int p) {
  int strA, strB, strC;
  int N;
  register int i;
  strA = m;
  strB = n;
  strC = p;
  N = m * p;
  for (i = 0; i < N; ++i) {
    C[i] = 0.;
  }
  recmult(A, B, C, m, n, p, strA, strB, strC);
}


x86 assembly (clang, -O0):
<rmult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
imul   -0x24(%rbp),%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    117c <rmult+0x6c>
mov    -0x18(%rbp),%rax
movslq -0x38(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1152 <rmult+0x42>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
mov    -0x28(%rbp),%r11d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <recmult@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmult>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%ebx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbp
mov    %r9d,%eax
imul   %ecx,%eax
test   %eax,%eax
jle    1157 <rmult+0x37>
mov    %eax,%edx
shl    $0x3,%rdx
mov    %r12,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %r15d,%ecx
mov    %r14d,%r8d
mov    %ebx,%r9d
push   %rbx
push   %r14
push   %r15
call   1030 <recmult@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @rmult(double* %0, double* %1, double* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store double* %0, double** %7
store double* %1, double** %8
store double* %2, double** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%18 = load i32, i32* %10
store i32 %18, i32* %13
%19 = load i32, i32* %11
store i32 %19, i32* %14
%20 = load i32, i32* %12
store i32 %20, i32* %15
%21 = load i32, i32* %10
%22 = load i32, i32* %12
%23 = mul nsw i32 %21, %22
store i32 %23, i32* %16
store i32 0, i32* %17
br label %24
24: ; preds = %33, %6
%25 = load i32, i32* %17
%26 = load i32, i32* %16
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %36
28: ; preds = %24
%29 = load double*, double** %9
%30 = load i32, i32* %17
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds double, double* %29, i64 %31
store double 0.000000e+00, double* %32
br label %33
33: ; preds = %28
%34 = load i32, i32* %17
%35 = add nsw i32 %34, 1
store i32 %35, i32* %17
br label %24
36: ; preds = %24
%37 = load double*, double** %7
%38 = load double*, double** %8
%39 = load double*, double** %9
%40 = load i32, i32* %10
%41 = load i32, i32* %11
%42 = load i32, i32* %12
%43 = load i32, i32* %13
%44 = load i32, i32* %14
%45 = load i32, i32* %15
%46 = call i32 @recmult(double* %37, double* %38, double* %39, i32 %40, i32 %41, i32 %42, i32 %43, i32 %44, i32 %45)
ret void
}

LLVM IR (-O2):
define void @rmult(double* %0, double* %1, double* %2, i32 %3, i32 %4, i32 %5) {
%7 = mul i32 %5, %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = bitcast double* %2 to i8*
%11 = zext i32 %7 to i64
%12 = shl nuw nsw i64 %11, 3
br label %13
13: ; preds = %9, %6
%14 = tail call i32 @recmult(double* %0, double* %1, double* %2, i32 %3, i32 %4, i32 %5, i32 %3, i32 %4, i32 %5)
ret void
}