#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_uint8_print_t(FILE *pFile, unsigned char *pUInt, unsigned long int num,
                       unsigned long int stride, char cDelim) {
  unsigned char i;
  for (i = 0; i < num; i++) {
    fprintf(pFile, "%7hu", (unsigned short int)pUInt[i * stride]);
    putc(cDelim, pFile);
  }
}


x86 assembly (clang, -O0):
<arr_uint8_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    1190 <arr_uint8_print_t+0x70>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl -0x22(%rbp),%ecx
imul   -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
lea    0xe94(%rip),%rsi
movzwl %ax,%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_uint8_print_t+0x22>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_uint8_print_t>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1182 <arr_uint8_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
movzbl (%r15,%rax,1),%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_uint8_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_uint8_print_t(i32* %0, i8* %1, i64 %2, i64 %3, i8 signext %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8
%11 = alloca i8
store i32* %0, i32** %6
store i8* %1, i8** %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 = %31, %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 %34
17: ; preds = %12
%18 = load i32*, i32** %6
%19 = load i8*, i8** %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 i8, i8* %19, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i16
%27 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i16 zeroext %26)
%28 = load i8, i8* %10
%29 = load i32*, i32** %6
%30 = call i32 @putc(i8 signext %28, i32* %29)
br label %31
31: ; preds = %17
%32 = load i8, i8* %11
%33 = add i8 %32, 1
store i8 %33, i8* %11
br label %12
34: ; preds = %12
ret void
}

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