#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 */
double runir(double, double);
void genMu(int p, int K, double **Mu, double Lbound, double Ubound) {
  int i, k;
  for (k = 0; k < K; k++) {
    for (i = 0; i < p; i++) {
      Mu[k][i] = runir(Lbound, Ubound);
    }
  }
}


x86 assembly (clang, -O0):
<genMu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1197 <genMu+0x87>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1184 <genMu+0x74>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <runir@plt>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1146 <genMu+0x36>
jmp    1189 <genMu+0x79>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1133 <genMu+0x23>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genMu>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    1175 <genMu+0x65>
mov    %rdx,%r12
mov    %edi,%r14d
mov    %esi,%r15d
mov    %edi,%r13d
xor    %ebx,%ebx
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
jmp    1149 <genMu+0x39>
xchg   %ax,%ax
add    $0x1,%rbx
cmp    %r15,%rbx
je     1175 <genMu+0x65>
test   %r14d,%r14d
jle    1140 <genMu+0x30>
xor    %ebp,%ebp
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <runir@plt>
mov    (%r12,%rbx,8),%rax
movsd  %xmm0,(%rax,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1150 <genMu+0x40>
jmp    1140 <genMu+0x30>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @genMu(i32 %0, i32 %1, double** nocapture %2, double %3, double %4) {
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %25
7: ; preds = %5
%8 = icmp sgt i32 %0, 0
%9 = zext i32 %1 to i64
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %7, %22
%12 = phi i64 [ 0, %7 ], [ %23, %22 ]
br i1 %8, label %13, label %22
13: ; preds = %11
%14 = getelementptr inbounds double*, double** %2, i64 %12
br label %15
15: ; preds = %13, %15
%16 = phi i64 [ 0, %13 ], [ %20, %15 ]
%17 = tail call double @runir(double %3, double %4)
%18 = load double*, double** %14
%19 = getelementptr inbounds double, double* %18, i64 %16
store double %17, double* %19
%20 = add nuw nsw i64 %16, 1
%21 = icmp eq i64 %20, %10
br i1 %21, label %22, label %15
22: ; preds = %15, %11
%23 = add nuw nsw i64 %12, 1
%24 = icmp eq i64 %23, %9
br i1 %24, label %25, label %11
25: ; preds = %22, %5
ret void
}