#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*/ convert_dvector_ivector(double *, long, long, int *);
void convert_dmatrix_imatrix(double **X, long nrl, long nrh, long ncl, long nch,
                             int **Y) {
  long i;
  for (i = nrl; i <= nrh; i++)
    convert_dvector_ivector(X[i], ncl, nch, Y[i]);
}


x86 assembly (clang, -O0):
<convert_dmatrix_imatrix>:
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_dmatrix_imatrix+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_dvector_ivector@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1138 <convert_dmatrix_imatrix+0x28>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_dmatrix_imatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %rdx,%rsi
jg     115d <convert_dmatrix_imatrix+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_dvector_ivector@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1140 <convert_dmatrix_imatrix+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @convert_dmatrix_imatrix(double** %0, i64 %1, i64 %2, i64 %3, i64 %4, i32** %5) {
%7 = alloca double**
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32**
%13 = alloca i64
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 i32** %5, i32*** %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 double**, double*** %7
%21 = load i64, i64* %13
%22 = getelementptr inbounds double*, double** %20, i64 %21
%23 = load double*, double** %22
%24 = load i64, i64* %10
%25 = load i64, i64* %11
%26 = load i32**, i32*** %12
%27 = load i64, i64* %13
%28 = getelementptr inbounds i32*, i32** %26, i64 %27
%29 = load i32*, i32** %28
%30 = call i32 @convert_dvector_ivector(double* %23, i64 %24, i64 %25, i32* %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_dmatrix_imatrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4, i32** 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 double*, double** %0, i64 %9
%11 = load double*, double** %10
%12 = getelementptr inbounds i32*, i32** %5, i64 %9
%13 = load i32*, i32** %12
%14 = tail call i32 @convert_dvector_ivector(double* %11, i64 %3, i64 %4, i32* %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
}