#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*/ daxpy(double *, double *, long, double);
void bmod(double *a, double *b, double *c, long dimi, long dimj, long dimk,
          long stridea, long strideb, long stridec) {
  long j;
  long k;
  double alpha;
  for (k = 0; k < dimk; k++) {
    for (j = 0; j < dimj; j++) {
      alpha = -b[k + j * strideb];
      daxpy(&c[j * stridec], &a[k * stridea], dimi, alpha);
    }
  }
}


x86 assembly (clang, -O0):
<bmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    11fa <bmod+0xea>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    11e4 <bmod+0xd4>
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    -0x38(%rbp),%rdx
imul   0x18(%rbp),%rdx
add    %rdx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rax
imul   0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x40(%rbp),%rax
imul   0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x20(%rbp),%rdx
movsd  -0x48(%rbp),%xmm0
call   1030 <daxpy@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    115a <bmod+0x4a>
jmp    11e9 <bmod+0xd9>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1144 <bmod+0x34>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmod>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,0x10(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdi,0x18(%rsp)
mov    %r9,0x28(%rsp)
test   %r9,%r9
jle    11ee <bmod+0xde>
mov    %rcx,%r14
mov    0x80(%rsp),%r15
mov    0x78(%rsp),%r12
shl    $0x3,%r15
shl    $0x3,%r12
xor    %eax,%eax
mov    %rax,(%rsp)
movaps 0xe9b(%rip),%xmm1
jmp    118c <bmod+0x7c>
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%rdx
add    $0x1,%rdx
addq   $0x8,0x8(%rsp)
mov    %rdx,%rax
mov    %rdx,(%rsp)
cmp    0x28(%rsp),%rdx
je     11ee <bmod+0xde>
cmpq   $0x0,0x10(%rsp)
jle    1170 <bmod+0x60>
mov    (%rsp),%rax
imul   0x70(%rsp),%rax
mov    0x18(%rsp),%rdx
lea    (%rdx,%rax,8),%rax
mov    %rax,0x30(%rsp)
mov    0x8(%rsp),%r13
mov    0x20(%rsp),%rbp
mov    0x10(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13),%xmm0
xorps  %xmm1,%xmm0
mov    %rbp,%rdi
mov    0x30(%rsp),%rsi
mov    %r14,%rdx
call   1030 <daxpy@plt>
movaps 0xe20(%rip),%xmm1
add    %r15,%rbp
add    %r12,%r13
add    $0xffffffffffffffff,%rbx
jne    11c0 <bmod+0xb0>
jmp    1170 <bmod+0x60>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @bmod(double* %0, double* %1, double* %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8) {
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca double
store double* %0, double** %10
store double* %1, double** %11
store double* %2, double** %12
store i64 %3, i64* %13
store i64 %4, i64* %14
store i64 %5, i64* %15
store i64 %6, i64* %16
store i64 %7, i64* %17
store i64 %8, i64* %18
store i64 0, i64* %20
br label %22
22: ; preds = %58, %9
%23 = load i64, i64* %20
%24 = load i64, i64* %15
%25 = icmp slt i64 %23, %24
br i1 %25, label %26, label %61
26: ; preds = %22
store i64 0, i64* %19
br label %27
27: ; preds = %54, %26
%28 = load i64, i64* %19
%29 = load i64, i64* %14
%30 = icmp slt i64 %28, %29
br i1 %30, label %31, label %57
31: ; preds = %27
%32 = load double*, double** %11
%33 = load i64, i64* %20
%34 = load i64, i64* %19
%35 = load i64, i64* %17
%36 = mul nsw i64 %34, %35
%37 = add nsw i64 %33, %36
%38 = getelementptr inbounds double, double* %32, i64 %37
%39 = load double, double* %38
%40 = fneg double %39
store double %40, double* %21
%41 = load double*, double** %12
%42 = load i64, i64* %19
%43 = load i64, i64* %18
%44 = mul nsw i64 %42, %43
%45 = getelementptr inbounds double, double* %41, i64 %44
%46 = load double*, double** %10
%47 = load i64, i64* %20
%48 = load i64, i64* %16
%49 = mul nsw i64 %47, %48
%50 = getelementptr inbounds double, double* %46, i64 %49
%51 = load i64, i64* %13
%52 = load double, double* %21
%53 = call i32 @daxpy(double* %45, double* %50, i64 %51, double %52)
br label %54
54: ; preds = %31
%55 = load i64, i64* %19
%56 = add nsw i64 %55, 1
store i64 %56, i64* %19
br label %27
57: ; preds = %27
br label %58
58: ; preds = %57
%59 = load i64, i64* %20
%60 = add nsw i64 %59, 1
store i64 %60, i64* %20
br label %22
61: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @bmod(double* %0, double* nocapture %1, double* %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8) {
%10 = icmp sgt i64 %5, 0
br i1 %10, label %11, label %33
11: ; preds = %9
%12 = icmp sgt i64 %4, 0
br label %13
13: ; preds = %11, %30
%14 = phi i64 [ 0, %11 ], [ %31, %30 ]
br i1 %12, label %15, label %30
15: ; preds = %13
%16 = mul nsw i64 %14, %6
%17 = getelementptr inbounds double, double* %0, i64 %16
br label %18
18: ; preds = %15, %18
%19 = phi i64 [ 0, %15 ], [ %28, %18 ]
%20 = mul nsw i64 %19, %7
%21 = add nsw i64 %20, %14
%22 = getelementptr inbounds double, double* %1, i64 %21
%23 = load double, double* %22
%24 = fneg double %23
%25 = mul nsw i64 %19, %8
%26 = getelementptr inbounds double, double* %2, i64 %25
%27 = tail call i32 @daxpy(double* %26, double* %17, i64 %3, double %24)
%28 = add nuw nsw i64 %19, 1
%29 = icmp eq i64 %28, %4
br i1 %29, label %30, label %18
30: ; preds = %18, %13
%31 = add nuw nsw i64 %14, 1
%32 = icmp eq i64 %31, %5
br i1 %32, label %33, label %13
33: ; preds = %30, %9
ret void
}