#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 char uint16_t;
struct TestU16 {
  int dummy;
};

/* Variables and functions */
uint16_t *clingPrint_TestU16(const struct TestU16 *Ptr, size_t *Sz,
                             uint16_t *Buf) {
  for (unsigned I = 0; I < 12; ++I)
    Buf[I] = 'a' + I;
  *Sz = 6;
  return Buf;
}


x86 assembly (clang, -O0):
<clingPrint_TestU16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xc,-0x1c(%rbp)
jae    1141 <clingPrint_TestU16+0x41>
mov    -0x1c(%rbp),%eax
add    $0x61,%eax
mov    %al,%dl
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <clingPrint_TestU16+0x17>
mov    -0x10(%rbp),%rax
movq   $0x6,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clingPrint_TestU16>:
mov    %rdx,%rax
movabs $0x6867666564636261,%rcx
66 67 68
mov    %rcx,(%rdx)
movl   $0x6c6b6a69,0x8(%rdx)
movq   $0x6,(%rsi)
ret

LLVM IR (-O0):
%struct.TestU16 = type { i32 }
define i8* @clingPrint_TestU16(%struct.TestU16* %0, i64* %1, i8* %2) {
%4 = alloca %struct.TestU16*
%5 = alloca i64*
%6 = alloca i8*
%7 = alloca i32
store %struct.TestU16* %0, %struct.TestU16** %4
store i64* %1, i64** %5
store i8* %2, i8** %6
store i32 0, i32* %7
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %7
%10 = icmp ult i32 %9, 12
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %7
%13 = add i32 97, %12
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 %14, i8* %18
br label %19
19: ; preds = %11
%20 = load i32, i32* %7
%21 = add i32 %20, 1
store i32 %21, i32* %7
br label %8
22: ; preds = %8
%23 = load i64*, i64** %5
store i64 6, i64* %23
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
%struct.TestU16 = type { i32 }
define i8* @clingPrint_TestU16(%struct.TestU16* nocapture readnone %0, i64* nocapture writeonly %1, i8* returned writeonly %2) {
store i8 97, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8 98, i8* %4
%5 = getelementptr inbounds i8, i8* %2, i64 2
store i8 99, i8* %5
%6 = getelementptr inbounds i8, i8* %2, i64 3
store i8 100, i8* %6
%7 = getelementptr inbounds i8, i8* %2, i64 4
store i8 101, i8* %7
%8 = getelementptr inbounds i8, i8* %2, i64 5
store i8 102, i8* %8
%9 = getelementptr inbounds i8, i8* %2, i64 6
store i8 103, i8* %9
%10 = getelementptr inbounds i8, i8* %2, i64 7
store i8 104, i8* %10
%11 = getelementptr inbounds i8, i8* %2, i64 8
store i8 105, i8* %11
%12 = getelementptr inbounds i8, i8* %2, i64 9
store i8 106, i8* %12
%13 = getelementptr inbounds i8, i8* %2, i64 10
store i8 107, i8* %13
%14 = getelementptr inbounds i8, i8* %2, i64 11
store i8 108, i8* %14
store i64 6, i64* %1
ret i8* %2
}