#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*/ cam16o(int const, int const, int const, int const,
                          int /*<<< orphan*/);
void cam16o_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++)
    cam16o(c, n, a, f, *(d++));
}


x86 assembly (clang, -O0):
<cam16o_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    1174 <cam16o_r+0x64>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %rax,%r8
add    $0x2,%r8
mov    %r8,-0x18(%rbp)
movzwl (%rax),%r8d
call   1030 <cam16o@plt>
mov    -0x1e(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x1e(%rbp)
jmp    1132 <cam16o_r+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cam16o_r>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %r9d,%r9d
jle    1166 <cam16o_r+0x56>
mov    %r8,%r15
mov    %ecx,%r12d
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r13d
xor    %r14d,%r14d
mov    %r9d,0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
movzwl (%r15,%r14,2),%r8d
mov    %r13d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r12d,%ecx
call   1030 <cam16o@plt>
mov    0x4(%rsp),%r9d
add    $0x1,%r14
movzwl %r14w,%eax
cmp    %r9d,%eax
jl     1140 <cam16o_r+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @cam16o_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 = getelementptr inbounds i16, i16* %24, i32 1
store i16* %25, i16** %11
%26 = load i16, i16* %24
%27 = zext i16 %26 to i32
%28 = call i32 @cam16o(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 @cam16o_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 = phi i16* [ %11, %8 ], [ %4, %6 ]
%11 = getelementptr inbounds i16, i16* %10, i64 1
%12 = load i16, i16* %10
%13 = zext i16 %12 to i32
%14 = tail call i32 @cam16o(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
}