#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 */
typedef int /*<<< orphan*/ ushort;

/* Variables and functions */
int /*<<< orphan*/ convert_usvector_dvector(int /*<<< orphan*/ *, long, long,
                                            double *);
void convert_usmatrix_dmatrix(ushort **X, long nrl, long nrh, long ncl,
                              long nch, double **Y) {
  long i;
  for (i = nrl; i <= nrh; i++)
    convert_usvector_dvector(X[i], ncl, nch, Y[i]);
}


x86 assembly (clang, -O0):
<convert_usmatrix_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)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     117c <convert_usmatrix_dmatrix+0x6c>
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
call   1030 <convert_usvector_dvector@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1138 <convert_usmatrix_dmatrix+0x28>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_usmatrix_dmatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %rdx,%rsi
jg     115d <convert_usmatrix_dmatrix+0x4d>
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0x1,%r13
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%rbp,%rbx,8),%rdi
mov    (%r14,%rbx,8),%rcx
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <convert_usvector_dvector@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1140 <convert_usmatrix_dmatrix+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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