#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*/ cam16i(int const, int const, int const, int const,
                          int /*<<< orphan*/);
void cam16i_r(const int c, const int n, const int a, const int f,
              unsigned short **d, const int r) {
  unsigned short i;
  for (i = 0; i < r; i++)
    cam16i(c, n, a, f, (*d)++);
}


x86 assembly (clang, -O0):
<cam16i_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
movw   $0x0,-0x1e(%rbp)
movzwl -0x1e(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1175 <cam16i_r+0x65>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    (%r8),%rax
mov    %rax,%r9
add    $0x2,%r9
mov    %r9,(%r8)
mov    %eax,%r8d
call   1030 <cam16i@plt>
mov    -0x1e(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x1e(%rbp)
jmp    1132 <cam16i_r+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cam16i_r>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %r9d,%r9d
jle    116c <cam16i_r+0x5c>
mov    %r8,%rbx
mov    %ecx,%r15d
mov    %edx,%r13d
mov    %esi,%ebp
mov    %edi,%r12d
mov    $0x1,%r14w
mov    %r9d,0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%r8
lea    0x2(%r8),%rax
mov    %rax,(%rbx)
mov    %r12d,%edi
mov    %ebp,%esi
mov    %r13d,%edx
mov    %r15d,%ecx
call   1030 <cam16i@plt>
mov    0x4(%rsp),%r9d
movzwl %r14w,%eax
add    $0x1,%r14d
cmp    %r9d,%eax
jl     1140 <cam16i_r+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @cam16i_r(i32 %0, i32 %1, i32 %2, i32 %3, i16** nocapture %4, i32 %5) {
%7 = icmp sgt i32 %5, 0
br i1 %7, label %8, label %18
8: ; preds = %6, %8
%9 = phi i16 [ %15, %8 ], [ 0, %6 ]
%10 = load i16*, i16** %4
%11 = getelementptr inbounds i16, i16* %10, i64 1
store i16* %11, i16** %4
%12 = ptrtoint i16* %10 to i64
%13 = trunc i64 %12 to i32
%14 = tail call i32 @cam16i(i32 %0, i32 %1, i32 %2, i32 %3, i32 %13)
%15 = add i16 %9, 1
%16 = zext i16 %15 to i32
%17 = icmp slt i32 %16, %5
br i1 %17, label %8, label %18
18: ; preds = %8, %6
ret void
}