#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*/ set_dvector(double *, long, long, double);
void set_dmatrix(double **m, long nrl, long nrh, long ncl, long nch,
                 double cte) {
  int i;
  for (i = nrl; i <= nrh; i++)
    set_dvector(m[i], ncl, nch, cte);
}


x86 assembly (clang, -O0):
<set_dmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1172 <set_dmatrix+0x62>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
movsd  -0x30(%rbp),%xmm0
call   1030 <set_dvector@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1138 <set_dmatrix+0x28>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_dmatrix>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movslq %esi,%rbx
cmp    %rdx,%rbx
jg     115e <set_dmatrix+0x4e>
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r13
mov    %rdi,%r12
movsd  %xmm0,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
mov    (%r12,%rbx,8),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
movsd  0x8(%rsp),%xmm0
call   1030 <set_dvector@plt>
add    $0x1,%rbx
cmp    %r13,%rbx
jle    1140 <set_dmatrix+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @set_dmatrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4, double %5) {
%7 = shl i64 %1, 32
%8 = ashr exact i64 %7, 32
%9 = icmp sgt i64 %8, %2
br i1 %9, label %17, label %10
10: ; preds = %6, %10
%11 = phi i64 [ %15, %10 ], [ %8, %6 ]
%12 = getelementptr inbounds double*, double** %0, i64 %11
%13 = load double*, double** %12
%14 = tail call i32 @set_dvector(double* %13, i64 %3, i64 %4, double %5)
%15 = add i64 %11, 1
%16 = icmp sgt i64 %15, %2
br i1 %16, label %17, label %10
17: ; preds = %10, %6
ret void
}