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


x86 assembly (clang, -O0):
<set_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x30(%rbp)
movslq -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     116f <set_imatrix+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1030 <set_ivector@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1137 <set_imatrix+0x27>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_imatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movslq %esi,%rbp
cmp    %rdx,%rbp
jg     115c <set_imatrix+0x4c>
mov    %r9d,%r14d
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rdi,%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%r13,%rbp,8),%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <set_ivector@plt>
add    $0x1,%rbp
cmp    %rbx,%rbp
jle    1140 <set_imatrix+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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