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

/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int my_snprintf(char *, int, char *, int);
int /*<<< orphan*/ printf(char *, char *);
unsigned short swapb_ushort(unsigned short);
void dWordHex(const unsigned short *words, int num, int no_ascii, int swapb) {
  const unsigned short *p = words;
  unsigned short c;
  char buff[82];
  unsigned char upp, low;
  int a = 0;
  const int bpstart = 3;
  const int cpstart = 52;
  int cpos = cpstart;
  int bpos = bpstart;
  int i, k, blen;
  if (num <= 0)
    return;
  blen = (int)sizeof(buff);
  memset(buff, ' ', 80);
  buff[80] = '\0';
  if (no_ascii < 0) {
    for (k = 0; k < num; k++) {
      c = *p++;
      if (swapb)
        c = swapb_ushort(c);
      bpos += 5;
      my_snprintf(&buff[bpos], blen - bpos, "%.4x", (unsigned int)c);
      buff[bpos + 4] = ' ';
      if ((k > 0) && (0 == ((k + 1) % 8))) {
        if (-2 == no_ascii)
          printf("%.39s\n", buff + 8);
        else
          printf("%.47s\n", buff);
        bpos = bpstart;
        memset(buff, ' ', 80);
      }
    }
    if (bpos > bpstart) {
      if (-2 == no_ascii)
        printf("%.39s\n", buff + 8);
      else
        printf("%.47s\n", buff);
    }
    return;
  }
  k = my_snprintf(buff + 1, blen - 1, "%.2x", a);
  buff[k + 1] = ' ';
  for (i = 0; i < num; i++) {
    c = *p++;
    if (swapb)
      c = swapb_ushort(c);
    bpos += 5;
    my_snprintf(&buff[bpos], blen - bpos, "%.4x", (unsigned int)c);
    buff[bpos + 4] = ' ';
    if (no_ascii) {
      buff[cpos++] = ' ';
      buff[cpos++] = ' ';
      buff[cpos++] = ' ';
    } else {
      upp = (c >> 8) & 0xff;
      low = c & 0xff;
      if ((upp < 0x20) || (upp >= 0x7f))
        upp = '.';
      buff[cpos++] = upp;
      if ((low < 0x20) || (low >= 0x7f))
        low = '.';
      buff[cpos++] = low;
      buff[cpos++] = ' ';
    }
    if (cpos > (cpstart + 23)) {
      printf("%.76s\n", buff);
      bpos = bpstart;
      cpos = cpstart;
      a += 8;
      memset(buff, ' ', 80);
      k = my_snprintf(buff + 1, blen - 1, "%.2x", a);
      buff[k + 1] = ' ';
    }
  }
  if (cpos > cpstart)
    printf("%.76s\n", buff);
}


x86 assembly (clang, -O0):
<dWordHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0x3,-0x8c(%rbp)
movl   $0x34,-0x90(%rbp)
movl   $0x34,-0x94(%rbp)
movl   $0x3,-0x98(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     11a1 <dWordHex+0x61>
jmp    15e0 <dWordHex+0x4a0>
movl   $0x52,-0xa4(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x20,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
movb   $0x0,-0x30(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    133e <dWordHex+0x1fe>
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12f0 <dWordHex+0x1b0>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%ax
mov    %ax,-0x22(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1212 <dWordHex+0xd2>
movzwl -0x22(%rbp),%edi
call   1030 <swapb_ushort@plt>
mov    %ax,-0x22(%rbp)
mov    -0x98(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x98(%rbp)
movslq -0x98(%rbp),%rax
lea    -0x80(%rbp),%rdi
add    %rax,%rdi
mov    -0xa4(%rbp),%esi
sub    -0x98(%rbp),%esi
movzwl -0x22(%rbp),%ecx
lea    0xdba(%rip),%rdx
call   1060 <my_snprintf@plt>
mov    -0x98(%rbp),%eax
add    $0x4,%eax
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
cmpl   $0x0,-0xa0(%rbp)
jle    12d7 <dWordHex+0x197>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    12d7 <dWordHex+0x197>
mov    $0xfffffffe,%eax
cmp    -0x10(%rbp),%eax
jne    12aa <dWordHex+0x16a>
lea    -0x80(%rbp),%rsi
add    $0x8,%rsi
lea    0xd65(%rip),%rdi
call   1040 <printf@plt>
jmp    12ba <dWordHex+0x17a>
lea    -0x80(%rbp),%rsi
lea    0xd57(%rip),%rdi
call   1040 <printf@plt>
movl   $0x3,-0x98(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x20,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
jmp    12dc <dWordHex+0x19c>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    11d6 <dWordHex+0x96>
cmpl   $0x3,-0x98(%rbp)
jle    1339 <dWordHex+0x1f9>
mov    $0xfffffffe,%eax
cmp    -0x10(%rbp),%eax
jne    1324 <dWordHex+0x1e4>
lea    -0x80(%rbp),%rsi
add    $0x8,%rsi
lea    0xceb(%rip),%rdi
call   1040 <printf@plt>
jmp    1334 <dWordHex+0x1f4>
lea    -0x80(%rbp),%rsi
lea    0xcdd(%rip),%rdi
call   1040 <printf@plt>
jmp    1339 <dWordHex+0x1f9>
jmp    15e0 <dWordHex+0x4a0>
lea    -0x80(%rbp),%rdi
add    $0x1,%rdi
mov    -0xa4(%rbp),%esi
sub    $0x1,%esi
mov    -0x88(%rbp),%ecx
lea    0xcb7(%rip),%rdx
call   1060 <my_snprintf@plt>
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    15c3 <dWordHex+0x483>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%ax
mov    %ax,-0x22(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     13bd <dWordHex+0x27d>
movzwl -0x22(%rbp),%edi
call   1030 <swapb_ushort@plt>
mov    %ax,-0x22(%rbp)
mov    -0x98(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x98(%rbp)
movslq -0x98(%rbp),%rax
lea    -0x80(%rbp),%rdi
add    %rax,%rdi
mov    -0xa4(%rbp),%esi
sub    -0x98(%rbp),%esi
movzwl -0x22(%rbp),%ecx
lea    0xc0f(%rip),%rdx
call   1060 <my_snprintf@plt>
mov    -0x98(%rbp),%eax
add    $0x4,%eax
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
cmpl   $0x0,-0x10(%rbp)
je     145d <dWordHex+0x31d>
mov    -0x94(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x94(%rbp)
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
mov    -0x94(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x94(%rbp)
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
mov    -0x94(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x94(%rbp)
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
jmp    151e <dWordHex+0x3de>
movzwl -0x22(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0x81(%rbp)
movzwl -0x22(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x82(%rbp)
movzbl -0x81(%rbp),%eax
cmp    $0x20,%eax
jl     149e <dWordHex+0x35e>
movzbl -0x81(%rbp),%eax
cmp    $0x7f,%eax
jl     14a5 <dWordHex+0x365>
movb   $0x2e,-0x81(%rbp)
mov    -0x81(%rbp),%cl
mov    -0x94(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x94(%rbp)
cltq
mov    %cl,-0x80(%rbp,%rax,1)
movzbl -0x82(%rbp),%eax
cmp    $0x20,%eax
jl     14e2 <dWordHex+0x3a2>
movzbl -0x82(%rbp),%eax
cmp    $0x7f,%eax
jl     14e9 <dWordHex+0x3a9>
movb   $0x2e,-0x82(%rbp)
mov    -0x82(%rbp),%cl
mov    -0x94(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x94(%rbp)
cltq
mov    %cl,-0x80(%rbp,%rax,1)
mov    -0x94(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x94(%rbp)
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
cmpl   $0x4b,-0x94(%rbp)
jle    15aa <dWordHex+0x46a>
lea    -0x80(%rbp),%rsi
lea    0xae2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x3,-0x98(%rbp)
movl   $0x34,-0x94(%rbp)
mov    -0x88(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x88(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x20,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
lea    -0x80(%rbp),%rdi
add    $0x1,%rdi
mov    -0xa4(%rbp),%esi
sub    $0x1,%esi
mov    -0x88(%rbp),%ecx
lea    0xa84(%rip),%rdx
call   1060 <my_snprintf@plt>
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
jmp    15af <dWordHex+0x46f>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1381 <dWordHex+0x241>
cmpl   $0x34,-0x94(%rbp)
jle    15e0 <dWordHex+0x4a0>
lea    -0x80(%rbp),%rsi
lea    0xa3d(%rip),%rdi
call   1040 <printf@plt>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dWordHex>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %ecx,0x8(%rsp)
mov    %rdi,0x10(%rsp)
test   %esi,%esi
jle    1427 <dWordHex+0x2e7>
mov    %edx,%ebx
mov    %esi,%r12d
lea    0x20(%rsp),%r13
mov    %r13,%rdi
mov    $0x20,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
movb   $0x0,0x70(%rsp)
test   %ebx,%ebx
mov    %ebx,0x4(%rsp)
js     1307 <dWordHex+0x1c7>
lea    0x21(%rsp),%rdi
lea    0xe7b(%rip),%rdx
xor    %r14d,%r14d
mov    $0x51,%esi
xor    %ecx,%ecx
call   1060 <my_snprintf@plt>
cltq
movb   $0x20,0x1(%rax,%r13,1)
mov    %r12d,%eax
mov    %rax,0x18(%rsp)
mov    $0x34,%ebx
mov    $0x3,%r15d
movl   $0x0,0xc(%rsp)
jmp    1236 <dWordHex+0xf6>
nopl   0x0(%rax)
lea    0xe41(%rip),%rdi
mov    %r13,%rsi
call   1040 <printf@plt>
mov    0xc(%rsp),%ebx
add    $0x8,%ebx
mov    %r13,%rdi
mov    $0x20,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
lea    0x21(%rsp),%rdi
mov    $0x51,%esi
lea    0xe0a(%rip),%rdx
mov    %ebx,0xc(%rsp)
mov    %ebx,%ecx
call   1060 <my_snprintf@plt>
cltq
movb   $0x20,0x1(%rax,%r13,1)
mov    $0x3,%r15d
mov    $0x34,%ebx
add    $0x1,%r14
cmp    %r14d,0x18(%rsp)
je     12f2 <dWordHex+0x1b2>
mov    0x10(%rsp),%rax
movzwl (%rax,%r14,2),%eax
cmpl   $0x0,0x8(%rsp)
je     124f <dWordHex+0x10f>
movzwl %ax,%edi
call   1030 <swapb_ushort@plt>
movslq %r15d,%rbp
lea    0x5(,%r13,1),%rdi
add    %rbp,%rdi
mov    $0x4d,%esi
sub    %r15d,%esi
movzwl %ax,%r12d
lea    0xd90(%rip),%rdx
mov    %r12d,%ecx
call   1060 <my_snprintf@plt>
movb   $0x20,0x9(%rbp,%r13,1)
movslq %ebx,%rax
cmpl   $0x0,0x4(%rsp)
je     12a0 <dWordHex+0x160>
movb   $0x20,0x20(%rsp,%rax,1)
mov    $0x20,%r12b
jmp    12d2 <dWordHex+0x192>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12d,%ecx
shr    $0x8,%ecx
lea    -0x7f00(%r12),%edx
ff
movzwl %dx,%edx
cmp    $0xa100,%edx
mov    $0x2e,%edx
cmovb  %edx,%ecx
mov    %cl,0x20(%rsp,%rax,1)
movzbl %r12b,%ecx
add    $0xffffff81,%ecx
cmp    $0xffa1,%cx
cmovb  %edx,%r12d
mov    %r12b,0x1(%rax,%r13,1)
movb   $0x20,0x2(%rax,%r13,1)
cmp    $0x49,%ebx
jge    11d0 <dWordHex+0x90>
add    $0x5,%r15d
add    $0x3,%ebx
jmp    1227 <dWordHex+0xe7>
cmp    $0x35,%ebx
jl     1427 <dWordHex+0x2e7>
lea    0xd16(%rip),%rdi
jmp    141d <dWordHex+0x2dd>
lea    0x28(%rsp),%rbp
mov    0x10(%rsp),%rax
movzwl (%rax),%eax
cmpl   $0x0,0x8(%rsp)
je     1323 <dWordHex+0x1e3>
movzwl %ax,%edi
call   1030 <swapb_ushort@plt>
movzwl %ax,%ecx
lea    0xcd3(%rip),%rdx
mov    %rbp,%rdi
mov    $0x4a,%esi
call   1060 <my_snprintf@plt>
movb   $0x20,0x2c(%rsp)
cmp    $0x1,%r12d
je     1403 <dWordHex+0x2c3>
add    $0xffffffff,%r12d
mov    $0x8,%r15d
xor    %ebx,%ebx
lea    0xca4(%rip),%r14
jmp    1371 <dWordHex+0x231>
xchg   %ax,%ax
add    $0x5,%r15d
add    $0x1,%rbx
cmp    %ebx,%r12d
je     13f9 <dWordHex+0x2b9>
mov    0x10(%rsp),%rax
movzwl 0x2(%rax,%rbx,2),%eax
cmpl   $0x0,0x8(%rsp)
je     138a <dWordHex+0x24a>
movzwl %ax,%edi
call   1030 <swapb_ushort@plt>
movslq %r15d,%rbp
lea    0x5(,%r13,1),%rdi
add    %rbp,%rdi
mov    $0x4d,%esi
sub    %r15d,%esi
movzwl %ax,%ecx
mov    %r14,%rdx
call   1060 <my_snprintf@plt>
movb   $0x20,0x9(%rbp,%r13,1)
lea    0x2(%rbx),%eax
test   $0x7,%al
jne    1360 <dWordHex+0x220>
cmpl   $0xfffffffe,0x4(%rsp)
jne    13cd <dWordHex+0x28d>
lea    0xc3f(%rip),%rdi
lea    0x28(%rsp),%rsi
jmp    13d7 <dWordHex+0x297>
lea    0xc38(%rip),%rdi
mov    %r13,%rsi
call   1040 <printf@plt>
mov    %r13,%rdi
mov    $0x20,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
mov    $0x3,%r15d
jmp    1364 <dWordHex+0x224>
cmp    $0x4,%r15d
mov    0x4(%rsp),%ebx
jl     1427 <dWordHex+0x2e7>
cmp    $0xfffffffe,%ebx
jne    1416 <dWordHex+0x2d6>
lea    0x28(%rsp),%rsi
lea    0xbf1(%rip),%rdi
jmp    1422 <dWordHex+0x2e2>
lea    0xbef(%rip),%rdi
lea    0x20(%rsp),%rsi
call   1040 <printf@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.4x\00"
@.str.1 = [7 x i8] c"%.39s\0A\00"
@.str.2 = [7 x i8] c"%.47s\0A\00"
@.str.3 = [5 x i8] c"%.2x\00"
@.str.4 = [7 x i8] c"%.76s\0A\00"
define void @dWordHex(i16* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i16*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i16*
%10 = alloca i16
%11 = alloca [82 x i8]
%12 = alloca i8
%13 = alloca i8
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i16* %0, i16** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%22 = load i16*, i16** %5
store i16* %22, i16** %9
store i32 0, i32* %14
store i32 3, i32* %15
store i32 52, i32* %16
store i32 52, i32* %17
store i32 3, i32* %18
%23 = load i32, i32* %6
%24 = icmp sle i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %4
br label %228
26: ; preds = %4
store i32 82, i32* %21
%27 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%28 = call i32 @memset(i8* %27, i8 signext 32, i32 80)
%29 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 80
store i8 0, i8* %29
%30 = load i32, i32* %7
%31 = icmp slt i32 %30, 0
br i1 %31, label %32, label %101
32: ; preds = %26
store i32 0, i32* %20
br label %33
33: ; preds = %83, %32
%34 = load i32, i32* %20
%35 = load i32, i32* %6
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %86
37: ; preds = %33
%38 = load i16*, i16** %9
%39 = getelementptr inbounds i16, i16* %38, i32 1
store i16* %39, i16** %9
%40 = load i16, i16* %38
store i16 %40, i16* %10
%41 = load i32, i32* %8
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %37
%44 = load i16, i16* %10
%45 = call zeroext i16 @swapb_ushort(i16 zeroext %44)
store i16 %45, i16* %10
br label %46
46: ; preds = %43, %37
%47 = load i32, i32* %18
%48 = add nsw i32 %47, 5
store i32 %48, i32* %18
%49 = load i32, i32* %18
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %50
%52 = load i32, i32* %21
%53 = load i32, i32* %18
%54 = sub nsw i32 %52, %53
%55 = load i16, i16* %10
%56 = zext i16 %55 to i32
%57 = call i32 @my_snprintf(i8* %51, i32 %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %56)
%58 = load i32, i32* %18
%59 = add nsw i32 %58, 4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %60
store i8 32, i8* %61
%62 = load i32, i32* %20
%63 = icmp sgt i32 %62, 0
br i1 %63, label %64, label %82
64: ; preds = %46
%65 = load i32, i32* %20
%66 = add nsw i32 %65, 1
%67 = srem i32 %66, 8
%68 = icmp eq i32 0, %67
br i1 %68, label %69, label %82
69: ; preds = %64
%70 = load i32, i32* %7
%71 = icmp eq i32 -2, %70
br i1 %71, label %72, label %76
72: ; preds = %69
%73 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%74 = getelementptr inbounds i8, i8* %73, i64 8
%75 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %74)
br label %79
76: ; preds = %69
%77 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%78 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %77)
br label %79
79: ; preds = %76, %72
store i32 3, i32* %18
%80 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%81 = call i32 @memset(i8* %80, i8 signext 32, i32 80)
br label %82
82: ; preds = %79, %64, %46
br label %83
83: ; preds = %82
%84 = load i32, i32* %20
%85 = add nsw i32 %84, 1
store i32 %85, i32* %20
br label %33
86: ; preds = %33
%87 = load i32, i32* %18
%88 = icmp sgt i32 %87, 3
br i1 %88, label %89, label %100
89: ; preds = %86
%90 = load i32, i32* %7
%91 = icmp eq i32 -2, %90
br i1 %91, label %92, label %96
92: ; preds = %89
%93 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%94 = getelementptr inbounds i8, i8* %93, i64 8
%95 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %94)
br label %99
96: ; preds = %89
%97 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%98 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %97)
br label %99
99: ; preds = %96, %92
br label %100
100: ; preds = %99, %86
br label %228
101: ; preds = %26
%102 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%103 = getelementptr inbounds i8, i8* %102, i64 1
%104 = load i32, i32* %21
%105 = sub nsw i32 %104, 1
%106 = load i32, i32* %14
%107 = call i32 @my_snprintf(i8* %103, i32 %105, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %106)
store i32 %107, i32* %20
%108 = load i32, i32* %20
%109 = add nsw i32 %108, 1
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %110
store i8 32, i8* %111
store i32 0, i32* %19
br label %112
112: ; preds = %219, %101
%113 = load i32, i32* %19
%114 = load i32, i32* %6
%115 = icmp slt i32 %113, %114
br i1 %115, label %116, label %222
116: ; preds = %112
%117 = load i16*, i16** %9
%118 = getelementptr inbounds i16, i16* %117, i32 1
store i16* %118, i16** %9
%119 = load i16, i16* %117
store i16 %119, i16* %10
%120 = load i32, i32* %8
%121 = icmp ne i32 %120, 0
br i1 %121, label %122, label %125
122: ; preds = %116
%123 = load i16, i16* %10
%124 = call zeroext i16 @swapb_ushort(i16 zeroext %123)
store i16 %124, i16* %10
br label %125
125: ; preds = %122, %116
%126 = load i32, i32* %18
%127 = add nsw i32 %126, 5
store i32 %127, i32* %18
%128 = load i32, i32* %18
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %129
%131 = load i32, i32* %21
%132 = load i32, i32* %18
%133 = sub nsw i32 %131, %132
%134 = load i16, i16* %10
%135 = zext i16 %134 to i32
%136 = call i32 @my_snprintf(i8* %130, i32 %133, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %135)
%137 = load i32, i32* %18
%138 = add nsw i32 %137, 4
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %139
store i8 32, i8* %140
%141 = load i32, i32* %7
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %156
143: ; preds = %125
%144 = load i32, i32* %17
%145 = add nsw i32 %144, 1
store i32 %145, i32* %17
%146 = sext i32 %144 to i64
%147 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %146
store i8 32, i8* %147
%148 = load i32, i32* %17
%149 = add nsw i32 %148, 1
store i32 %149, i32* %17
%150 = sext i32 %148 to i64
%151 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %150
store i8 32, i8* %151
%152 = load i32, i32* %17
%153 = add nsw i32 %152, 1
store i32 %153, i32* %17
%154 = sext i32 %152 to i64
%155 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %154
store i8 32, i8* %155
br label %198
156: ; preds = %125
%157 = load i16, i16* %10
%158 = zext i16 %157 to i32
%159 = ashr i32 %158, 8
%160 = and i32 %159, 255
%161 = trunc i32 %160 to i8
store i8 %161, i8* %12
%162 = load i16, i16* %10
%163 = zext i16 %162 to i32
%164 = and i32 %163, 255
%165 = trunc i32 %164 to i8
store i8 %165, i8* %13
%166 = load i8, i8* %12
%167 = zext i8 %166 to i32
%168 = icmp slt i32 %167, 32
br i1 %168, label %173, label %169
169: ; preds = %156
%170 = load i8, i8* %12
%171 = zext i8 %170 to i32
%172 = icmp sge i32 %171, 127
br i1 %172, label %173, label %174
173: ; preds = %169, %156
store i8 46, i8* %12
br label %174
174: ; preds = %173, %169
%175 = load i8, i8* %12
%176 = load i32, i32* %17
%177 = add nsw i32 %176, 1
store i32 %177, i32* %17
%178 = sext i32 %176 to i64
%179 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %178
store i8 %175, i8* %179
%180 = load i8, i8* %13
%181 = zext i8 %180 to i32
%182 = icmp slt i32 %181, 32
br i1 %182, label %187, label %183
183: ; preds = %174
%184 = load i8, i8* %13
%185 = zext i8 %184 to i32
%186 = icmp sge i32 %185, 127
br i1 %186, label %187, label %188
187: ; preds = %183, %174
store i8 46, i8* %13
br label %188
188: ; preds = %187, %183
%189 = load i8, i8* %13
%190 = load i32, i32* %17
%191 = add nsw i32 %190, 1
store i32 %191, i32* %17
%192 = sext i32 %190 to i64
%193 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %192
store i8 %189, i8* %193
%194 = load i32, i32* %17
%195 = add nsw i32 %194, 1
store i32 %195, i32* %17
%196 = sext i32 %194 to i64
%197 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %196
store i8 32, i8* %197
br label %198
198: ; preds = %188, %143
%199 = load i32, i32* %17
%200 = icmp sgt i32 %199, 75
br i1 %200, label %201, label %218
201: ; preds = %198
%202 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%203 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %202)
store i32 3, i32* %18
store i32 52, i32* %17
%204 = load i32, i32* %14
%205 = add nsw i32 %204, 8
store i32 %205, i32* %14
%206 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%207 = call i32 @memset(i8* %206, i8 signext 32, i32 80)
%208 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%209 = getelementptr inbounds i8, i8* %208, i64 1
%210 = load i32, i32* %21
%211 = sub nsw i32 %210, 1
%212 = load i32, i32* %14
%213 = call i32 @my_snprintf(i8* %209, i32 %211, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %212)
store i32 %213, i32* %20
%214 = load i32, i32* %20
%215 = add nsw i32 %214, 1
%216 = sext i32 %215 to i64
%217 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %216
store i8 32, i8* %217
br label %218
218: ; preds = %201, %198
br label %219
219: ; preds = %218
%220 = load i32, i32* %19
%221 = add nsw i32 %220, 1
store i32 %221, i32* %19
br label %112
222: ; preds = %112
%223 = load i32, i32* %17
%224 = icmp sgt i32 %223, 52
br i1 %224, label %225, label %228
225: ; preds = %222
%226 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%227 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %226)
br label %228
228: ; preds = %25, %100, %225, %222
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.4x\00"
@.str.1 = [7 x i8] c"%.39s\0A\00"
@.str.2 = [7 x i8] c"%.47s\0A\00"
@.str.3 = [5 x i8] c"%.2x\00"
@.str.4 = [7 x i8] c"%.76s\0A\00"
define void @dWordHex(i16* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [82 x i8]
%6 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 0
%7 = icmp slt i32 %1, 1
br i1 %7, label %139, label %8
8: ; preds = %4
%9 = call i32 @memset(i8* %6, i8 signext 32, i32 80)
%10 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 80
store i8 0, i8* %10
%11 = icmp slt i32 %2, 0
br i1 %11, label %12, label %66
12: ; preds = %8
%13 = icmp eq i32 %3, 0
%14 = icmp eq i32 %2, -2
%15 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 8
%16 = load i16, i16* %0
br i1 %13, label %19, label %17
17: ; preds = %12
%18 = call zeroext i16 @swapb_ushort(i16 zeroext %16)
br label %19
19: ; preds = %12, %17
%20 = phi i16 [ %18, %17 ], [ %16, %12 ]
%21 = zext i16 %20 to i32
%22 = call i32 @my_snprintf(i8* %15, i32 74, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 12
store i8 32, i8* %23
%24 = icmp eq i32 %1, 1
br i1 %24, label %59, label %25
25: ; preds = %19, %54
%26 = phi i16* [ %29, %54 ], [ %0, %19 ]
%27 = phi i32 [ %44, %54 ], [ 1, %19 ]
%28 = phi i32 [ %55, %54 ], [ 8, %19 ]
%29 = getelementptr inbounds i16, i16* %26, i64 1
%30 = load i16, i16* %29
br i1 %13, label %33, label %31
31: ; preds = %25
%32 = call zeroext i16 @swapb_ushort(i16 zeroext %30)
br label %33
33: ; preds = %25, %31
%34 = phi i16 [ %32, %31 ], [ %30, %25 ]
%35 = add nsw i32 %28, 5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %36
%38 = sub i32 77, %28
%39 = zext i16 %34 to i32
%40 = call i32 @my_snprintf(i8* %37, i32 %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %39)
%41 = add nsw i32 %28, 9
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %42
store i8 32, i8* %43
%44 = add nuw nsw i32 %27, 1
%45 = and i32 %44, 7
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %54
47: ; preds = %33
br i1 %14, label %48, label %50
48: ; preds = %47
%49 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %52
50: ; preds = %47
%51 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %52
52: ; preds = %50, %48
%53 = call i32 @memset(i8* %6, i8 signext 32, i32 80)
br label %54
54: ; preds = %33, %52
%55 = phi i32 [ %35, %33 ], [ 3, %52 ]
%56 = icmp eq i32 %44, %1
br i1 %56, label %57, label %25
57: ; preds = %54
%58 = icmp sgt i32 %55, 3
br i1 %58, label %59, label %139
59: ; preds = %19, %57
%60 = icmp eq i32 %2, -2
br i1 %60, label %61, label %64
61: ; preds = %59
%62 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 8
%63 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %62)
br label %139
64: ; preds = %59
%65 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %139
66: ; preds = %8
%67 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 1
%68 = call i32 @my_snprintf(i8* %67, i32 81, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
%69 = add nsw i32 %68, 1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %70
store i8 32, i8* %71
%72 = icmp eq i32 %3, 0
%73 = icmp eq i32 %2, 0
br label %74
74: ; preds = %66, %129
%75 = phi i16* [ %0, %66 ], [ %80, %129 ]
%76 = phi i32 [ 0, %66 ], [ %133, %129 ]
%77 = phi i32 [ 3, %66 ], [ %132, %129 ]
%78 = phi i32 [ 52, %66 ], [ %131, %129 ]
%79 = phi i32 [ 0, %66 ], [ %130, %129 ]
%80 = getelementptr inbounds i16, i16* %75, i64 1
%81 = load i16, i16* %75
br i1 %72, label %84, label %82
82: ; preds = %74
%83 = call zeroext i16 @swapb_ushort(i16 zeroext %81)
br label %84
84: ; preds = %82, %74
%85 = phi i16 [ %83, %82 ], [ %81, %74 ]
%86 = add nsw i32 %77, 5
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %87
%89 = sub i32 77, %77
%90 = zext i16 %85 to i32
%91 = call i32 @my_snprintf(i8* %88, i32 %89, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %90)
%92 = add nsw i32 %77, 9
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %93
store i8 32, i8* %94
br i1 %73, label %98, label %95
95: ; preds = %84
%96 = sext i32 %78 to i64
%97 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %96
store i8 32, i8* %97
br label %111
98: ; preds = %84
%99 = lshr i16 %85, 8
%100 = trunc i16 %99 to i8
%101 = trunc i16 %85 to i8
%102 = add i16 %85, -32512
%103 = icmp ult i16 %102, -24320
%104 = select i1 %103, i8 46, i8 %100
%105 = sext i32 %78 to i64
%106 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %105
store i8 %104, i8* %106
%107 = and i16 %85, 255
%108 = add nsw i16 %107, -127
%109 = icmp ult i16 %108, -95
%110 = select i1 %109, i8 46, i8 %101
br label %111
111: ; preds = %98, %95
%112 = phi i8 [ %110, %98 ], [ 32, %95 ]
%113 = add nsw i32 %78, 1
%114 = add nsw i32 %78, 2
%115 = sext i32 %113 to i64
%116 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %115
store i8 %112, i8* %116
%117 = sext i32 %114 to i64
%118 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %117
store i8 32, i8* %118
%119 = add nsw i32 %78, 3
%120 = icmp sgt i32 %78, 72
br i1 %120, label %121, label %129
121: ; preds = %111
%122 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%123 = add nsw i32 %79, 8
%124 = call i32 @memset(i8* %6, i8 signext 32, i32 80)
%125 = call i32 @my_snprintf(i8* %67, i32 81, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %123)
%126 = add nsw i32 %125, 1
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %127
store i8 32, i8* %128
br label %129
129: ; preds = %111, %121
%130 = phi i32 [ %123, %121 ], [ %79, %111 ]
%131 = phi i32 [ 52, %121 ], [ %119, %111 ]
%132 = phi i32 [ 3, %121 ], [ %86, %111 ]
%133 = add nuw nsw i32 %76, 1
%134 = icmp eq i32 %133, %1
br i1 %134, label %135, label %74
135: ; preds = %129
%136 = icmp sgt i32 %131, 52
br i1 %136, label %137, label %139
137: ; preds = %135
%138 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %6)
br label %139
139: ; preds = %135, %137, %57, %64, %61, %4
ret void
}