#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned short);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void arr_uint16_print_t(FILE *pFile, unsigned short int *pUInt,
                        unsigned long int num, unsigned long int stride,
                        char cDelim) {
  unsigned char i;
  for (i = 0; i < num; i++) {
    fprintf(pFile, "%7hu", pUInt[i * stride]);
    putc(cDelim, pFile);
  }
}


x86 assembly (clang, -O0):
<arr_uint16_print_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %al,-0x21(%rbp)
movb   $0x0,-0x22(%rbp)
movzbl -0x22(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    118d <arr_uint16_print_t+0x6d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl -0x22(%rbp),%ecx
imul   -0x20(%rbp),%rcx
lea    0xe98(%rip),%rsi
movzwl (%rax,%rcx,2),%edx
call   1040 <fprintf@plt>
mov    -0x21(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
mov    -0x22(%rbp),%al
add    $0x1,%al
mov    %al,-0x22(%rbp)
jmp    1142 <arr_uint16_print_t+0x22>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_uint16_print_t>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1182 <arr_uint16_print_t+0x62>
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %r13d,%r13d
movsbl %r8b,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rax
imul   %r14,%rax
movzwl (%r15,%rax,2),%edx
mov    %rbx,%rdi
lea    0xe9a(%rip),%rsi
call   1040 <fprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
add    $0x1,%r13d
movzbl %r13b,%r13d
cmp    %r12,%r13
jb     1150 <arr_uint16_print_t+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%7hu\00"
define void @arr_uint16_print_t(i32* %0, i16* %1, i64 %2, i64 %3, i8 signext %4) {
%6 = alloca i32*
%7 = alloca i16*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8
%11 = alloca i8
store i32* %0, i32** %6
store i16* %1, i16** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i8 %4, i8* %10
store i8 0, i8* %11
br label %12
12: ; preds = %30, %5
%13 = load i8, i8* %11
%14 = zext i8 %13 to i64
%15 = load i64, i64* %8
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %33
17: ; preds = %12
%18 = load i32*, i32** %6
%19 = load i16*, i16** %7
%20 = load i8, i8* %11
%21 = zext i8 %20 to i64
%22 = load i64, i64* %9
%23 = mul i64 %21, %22
%24 = getelementptr inbounds i16, i16* %19, i64 %23
%25 = load i16, i16* %24
%26 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 zeroext %25)
%27 = load i8, i8* %10
%28 = load i32*, i32** %6
%29 = call i32 @putc(i8 signext %27, i32* %28)
br label %30
30: ; preds = %17
%31 = load i8, i8* %11
%32 = add i8 %31, 1
store i8 %32, i8* %11
br label %12
33: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%7hu\00"
define void @arr_uint16_print_t(i32* nocapture %0, i16* nocapture %1, i64 %2, i64 %3, i8 signext %4) {
%6 = icmp eq i64 %2, 0
br i1 %6, label %17, label %7
7: ; preds = %5, %7
%8 = phi i64 [ %15, %7 ], [ 0, %5 ]
%9 = mul i64 %8, %3
%10 = getelementptr inbounds i16, i16* %1, i64 %9
%11 = load i16, i16* %10
%12 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 zeroext %11)
%13 = tail call i32 @putc(i8 signext %4, i32* %0)
%14 = add nuw nsw i64 %8, 1
%15 = and i64 %14, 255
%16 = icmp ult i64 %15, %2
br i1 %16, label %7, label %17
17: ; preds = %7, %5
ret void
}