#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*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
int sprintf(char *, char *, int);
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;
  if (num <= 0)
    return;
  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;
      sprintf(&buff[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 = sprintf(buff + 1, "%.2x", a);
  buff[k + 1] = ' ';
  for (i = 0; i < num; i++) {
    c = *p++;
    if (swapb)
      c = swapb_ushort(c);
    bpos += 5;
    sprintf(&buff[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 = sprintf(buff + 1, "%.2x", a);
      buff[k + 1] = ' ';
    }
  }
  if (cpos > cpstart)
    printf("%.76s\n", buff);
}


x86 assembly (clang, -O0):
<dWordHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%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    15ac <dWordHex+0x46c>
lea    -0x80(%rbp),%rdi
mov    $0x20,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
movb   $0x0,-0x30(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1328 <dWordHex+0x1e8>
movl   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12da <dWordHex+0x19a>
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     1208 <dWordHex+0xc8>
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
movzwl -0x22(%rbp),%edx
lea    0xdd0(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x98(%rbp),%eax
add    $0x4,%eax
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
cmpl   $0x0,-0xa0(%rbp)
jle    12c1 <dWordHex+0x181>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    %edx,%eax
jne    12c1 <dWordHex+0x181>
mov    $0xfffffffe,%eax
cmp    -0x10(%rbp),%eax
jne    1294 <dWordHex+0x154>
lea    -0x80(%rbp),%rsi
add    $0x8,%rsi
lea    0xd7b(%rip),%rdi
call   1040 <printf@plt>
jmp    12a4 <dWordHex+0x164>
lea    -0x80(%rbp),%rsi
lea    0xd6d(%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    12c6 <dWordHex+0x186>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    11cc <dWordHex+0x8c>
cmpl   $0x3,-0x98(%rbp)
jle    1323 <dWordHex+0x1e3>
mov    $0xfffffffe,%eax
cmp    -0x10(%rbp),%eax
jne    130e <dWordHex+0x1ce>
lea    -0x80(%rbp),%rsi
add    $0x8,%rsi
lea    0xd01(%rip),%rdi
call   1040 <printf@plt>
jmp    131e <dWordHex+0x1de>
lea    -0x80(%rbp),%rsi
lea    0xcf3(%rip),%rdi
call   1040 <printf@plt>
jmp    1323 <dWordHex+0x1e3>
jmp    15ac <dWordHex+0x46c>
lea    -0x80(%rbp),%rdi
add    $0x1,%rdi
mov    -0x88(%rbp),%edx
lea    0xcd6(%rip),%rsi
call   1060 <sprintf@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    158f <dWordHex+0x44f>
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     139e <dWordHex+0x25e>
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
movzwl -0x22(%rbp),%edx
lea    0xc3a(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x98(%rbp),%eax
add    $0x4,%eax
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
cmpl   $0x0,-0x10(%rbp)
je     1432 <dWordHex+0x2f2>
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    14f3 <dWordHex+0x3b3>
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     1473 <dWordHex+0x333>
movzbl -0x81(%rbp),%eax
cmp    $0x7f,%eax
jl     147a <dWordHex+0x33a>
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     14b7 <dWordHex+0x377>
movzbl -0x82(%rbp),%eax
cmp    $0x7f,%eax
jl     14be <dWordHex+0x37e>
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    1576 <dWordHex+0x436>
lea    -0x80(%rbp),%rsi
lea    0xb0d(%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    -0x88(%rbp),%edx
lea    0xab8(%rip),%rsi
call   1060 <sprintf@plt>
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x20,-0x80(%rbp,%rax,1)
jmp    157b <dWordHex+0x43b>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1362 <dWordHex+0x222>
cmpl   $0x34,-0x94(%rbp)
jle    15ac <dWordHex+0x46c>
lea    -0x80(%rbp),%rsi
lea    0xa71(%rip),%rdi
call   1040 <printf@plt>
add    $0xa0,%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    140f <dWordHex+0x2cf>
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     12f7 <dWordHex+0x1b7>
lea    0x21(%rsp),%rdi
lea    0xe7b(%rip),%rsi
xor    %r14d,%r14d
xor    %edx,%edx
call   1060 <sprintf@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    1231 <dWordHex+0xf1>
nopw   0x0(%rax,%rax,1)
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
lea    0xe0f(%rip),%rsi
mov    %ebx,0xc(%rsp)
mov    %ebx,%edx
call   1060 <sprintf@plt>
cltq
movb   $0x20,0x1(%rax,%r13,1)
mov    $0x3,%r15d
mov    $0x34,%ebx
add    $0x1,%r14
cmp    %r14d,0x18(%rsp)
je     12e2 <dWordHex+0x1a2>
mov    0x10(%rsp),%rax
movzwl (%rax,%r14,2),%eax
cmpl   $0x0,0x8(%rsp)
je     124a <dWordHex+0x10a>
movzwl %ax,%edi
call   1030 <swapb_ushort@plt>
movslq %r15d,%rbp
lea    0x5(,%r13,1),%rdi
add    %rbp,%rdi
movzwl %ax,%r12d
lea    0xd9d(%rip),%rsi
mov    %r12d,%edx
call   1060 <sprintf@plt>
movb   $0x20,0x9(%rbp,%r13,1)
movslq %ebx,%rax
cmpl   $0x0,0x4(%rsp)
je     1290 <dWordHex+0x150>
movb   $0x20,0x20(%rsp,%rax,1)
mov    $0x20,%r12b
jmp    12c2 <dWordHex+0x182>
cs nopw 0x0(%rax,%rax,1)
nop
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    1222 <dWordHex+0xe2>
cmp    $0x35,%ebx
jl     140f <dWordHex+0x2cf>
lea    0xd26(%rip),%rdi
jmp    1405 <dWordHex+0x2c5>
lea    0x28(%rsp),%rbp
mov    0x10(%rsp),%rax
movzwl (%rax),%eax
cmpl   $0x0,0x8(%rsp)
je     1313 <dWordHex+0x1d3>
movzwl %ax,%edi
call   1030 <swapb_ushort@plt>
movzwl %ax,%edx
lea    0xce3(%rip),%rsi
mov    %rbp,%rdi
call   1060 <sprintf@plt>
movb   $0x20,0x2c(%rsp)
cmp    $0x1,%r12d
je     13eb <dWordHex+0x2ab>
add    $0xffffffff,%r12d
mov    $0x8,%r14d
xor    %ebx,%ebx
lea    0xcb9(%rip),%r15
jmp    1361 <dWordHex+0x221>
nopl   0x0(%rax)
add    $0x5,%r14d
add    $0x1,%rbx
cmp    %ebx,%r12d
je     13e1 <dWordHex+0x2a1>
mov    0x10(%rsp),%rax
movzwl 0x2(%rax,%rbx,2),%eax
cmpl   $0x0,0x8(%rsp)
je     137a <dWordHex+0x23a>
movzwl %ax,%edi
call   1030 <swapb_ushort@plt>
movslq %r14d,%rbp
lea    0x5(,%r13,1),%rdi
add    %rbp,%rdi
movzwl %ax,%edx
mov    %r15,%rsi
call   1060 <sprintf@plt>
movb   $0x20,0x9(%rbp,%r13,1)
lea    0x2(%rbx),%eax
test   $0x7,%al
jne    1350 <dWordHex+0x210>
cmpl   $0xfffffffe,0x4(%rsp)
jne    13b5 <dWordHex+0x275>
lea    0xc57(%rip),%rdi
lea    0x28(%rsp),%rsi
jmp    13bf <dWordHex+0x27f>
lea    0xc50(%rip),%rdi
mov    %r13,%rsi
call   1040 <printf@plt>
mov    %r13,%rdi
mov    $0x20,%esi
mov    $0x50,%edx
call   1050 <memset@plt>
mov    $0x3,%r14d
jmp    1354 <dWordHex+0x214>
cmp    $0x4,%r14d
mov    0x4(%rsp),%ebx
jl     140f <dWordHex+0x2cf>
cmp    $0xfffffffe,%ebx
jne    13fe <dWordHex+0x2be>
lea    0x28(%rsp),%rsi
lea    0xc09(%rip),%rdi
jmp    140a <dWordHex+0x2ca>
lea    0xc07(%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
store i16* %0, i16** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%21 = load i16*, i16** %5
store i16* %21, 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
%22 = load i32, i32* %6
%23 = icmp sle i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %4
br label %217
25: ; preds = %4
%26 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%27 = call i32 @memset(i8* %26, i8 signext 32, i32 80)
%28 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 80
store i8 0, i8* %28
%29 = load i32, i32* %7
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %97
31: ; preds = %25
store i32 0, i32* %20
br label %32
32: ; preds = %79, %31
%33 = load i32, i32* %20
%34 = load i32, i32* %6
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %82
36: ; preds = %32
%37 = load i16*, i16** %9
%38 = getelementptr inbounds i16, i16* %37, i32 1
store i16* %38, i16** %9
%39 = load i16, i16* %37
store i16 %39, i16* %10
%40 = load i32, i32* %8
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %36
%43 = load i16, i16* %10
%44 = call zeroext i16 @swapb_ushort(i16 zeroext %43)
store i16 %44, i16* %10
br label %45
45: ; preds = %42, %36
%46 = load i32, i32* %18
%47 = add nsw i32 %46, 5
store i32 %47, i32* %18
%48 = load i32, i32* %18
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %49
%51 = load i16, i16* %10
%52 = zext i16 %51 to i32
%53 = call i32 @sprintf(i8* %50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %18
%55 = add nsw i32 %54, 4
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %56
store i8 32, i8* %57
%58 = load i32, i32* %20
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %78
60: ; preds = %45
%61 = load i32, i32* %20
%62 = add nsw i32 %61, 1
%63 = srem i32 %62, 8
%64 = icmp eq i32 0, %63
br i1 %64, label %65, label %78
65: ; preds = %60
%66 = load i32, i32* %7
%67 = icmp eq i32 -2, %66
br i1 %67, label %68, label %72
68: ; preds = %65
%69 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%70 = getelementptr inbounds i8, i8* %69, i64 8
%71 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %70)
br label %75
72: ; preds = %65
%73 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%74 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %73)
br label %75
75: ; preds = %72, %68
store i32 3, i32* %18
%76 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%77 = call i32 @memset(i8* %76, i8 signext 32, i32 80)
br label %78
78: ; preds = %75, %60, %45
br label %79
79: ; preds = %78
%80 = load i32, i32* %20
%81 = add nsw i32 %80, 1
store i32 %81, i32* %20
br label %32
82: ; preds = %32
%83 = load i32, i32* %18
%84 = icmp sgt i32 %83, 3
br i1 %84, label %85, label %96
85: ; preds = %82
%86 = load i32, i32* %7
%87 = icmp eq i32 -2, %86
br i1 %87, label %88, label %92
88: ; preds = %85
%89 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%90 = getelementptr inbounds i8, i8* %89, i64 8
%91 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %90)
br label %95
92: ; preds = %85
%93 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%94 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %93)
br label %95
95: ; preds = %92, %88
br label %96
96: ; preds = %95, %82
br label %217
97: ; preds = %25
%98 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%99 = getelementptr inbounds i8, i8* %98, i64 1
%100 = load i32, i32* %14
%101 = call i32 @sprintf(i8* %99, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %100)
store i32 %101, i32* %20
%102 = load i32, i32* %20
%103 = add nsw i32 %102, 1
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %104
store i8 32, i8* %105
store i32 0, i32* %19
br label %106
106: ; preds = %208, %97
%107 = load i32, i32* %19
%108 = load i32, i32* %6
%109 = icmp slt i32 %107, %108
br i1 %109, label %110, label %211
110: ; preds = %106
%111 = load i16*, i16** %9
%112 = getelementptr inbounds i16, i16* %111, i32 1
store i16* %112, i16** %9
%113 = load i16, i16* %111
store i16 %113, i16* %10
%114 = load i32, i32* %8
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %119
116: ; preds = %110
%117 = load i16, i16* %10
%118 = call zeroext i16 @swapb_ushort(i16 zeroext %117)
store i16 %118, i16* %10
br label %119
119: ; preds = %116, %110
%120 = load i32, i32* %18
%121 = add nsw i32 %120, 5
store i32 %121, i32* %18
%122 = load i32, i32* %18
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %123
%125 = load i16, i16* %10
%126 = zext i16 %125 to i32
%127 = call i32 @sprintf(i8* %124, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %126)
%128 = load i32, i32* %18
%129 = add nsw i32 %128, 4
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %130
store i8 32, i8* %131
%132 = load i32, i32* %7
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %147
134: ; preds = %119
%135 = load i32, i32* %17
%136 = add nsw i32 %135, 1
store i32 %136, i32* %17
%137 = sext i32 %135 to i64
%138 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %137
store i8 32, i8* %138
%139 = load i32, i32* %17
%140 = add nsw i32 %139, 1
store i32 %140, i32* %17
%141 = sext i32 %139 to i64
%142 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %141
store i8 32, i8* %142
%143 = load i32, i32* %17
%144 = add nsw i32 %143, 1
store i32 %144, i32* %17
%145 = sext i32 %143 to i64
%146 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %145
store i8 32, i8* %146
br label %189
147: ; preds = %119
%148 = load i16, i16* %10
%149 = zext i16 %148 to i32
%150 = ashr i32 %149, 8
%151 = and i32 %150, 255
%152 = trunc i32 %151 to i8
store i8 %152, i8* %12
%153 = load i16, i16* %10
%154 = zext i16 %153 to i32
%155 = and i32 %154, 255
%156 = trunc i32 %155 to i8
store i8 %156, i8* %13
%157 = load i8, i8* %12
%158 = zext i8 %157 to i32
%159 = icmp slt i32 %158, 32
br i1 %159, label %164, label %160
160: ; preds = %147
%161 = load i8, i8* %12
%162 = zext i8 %161 to i32
%163 = icmp sge i32 %162, 127
br i1 %163, label %164, label %165
164: ; preds = %160, %147
store i8 46, i8* %12
br label %165
165: ; preds = %164, %160
%166 = load i8, i8* %12
%167 = load i32, i32* %17
%168 = add nsw i32 %167, 1
store i32 %168, i32* %17
%169 = sext i32 %167 to i64
%170 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %169
store i8 %166, i8* %170
%171 = load i8, i8* %13
%172 = zext i8 %171 to i32
%173 = icmp slt i32 %172, 32
br i1 %173, label %178, label %174
174: ; preds = %165
%175 = load i8, i8* %13
%176 = zext i8 %175 to i32
%177 = icmp sge i32 %176, 127
br i1 %177, label %178, label %179
178: ; preds = %174, %165
store i8 46, i8* %13
br label %179
179: ; preds = %178, %174
%180 = load i8, i8* %13
%181 = load i32, i32* %17
%182 = add nsw i32 %181, 1
store i32 %182, i32* %17
%183 = sext i32 %181 to i64
%184 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %183
store i8 %180, i8* %184
%185 = load i32, i32* %17
%186 = add nsw i32 %185, 1
store i32 %186, i32* %17
%187 = sext i32 %185 to i64
%188 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %187
store i8 32, i8* %188
br label %189
189: ; preds = %179, %134
%190 = load i32, i32* %17
%191 = icmp sgt i32 %190, 75
br i1 %191, label %192, label %207
192: ; preds = %189
%193 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%194 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %193)
store i32 3, i32* %18
store i32 52, i32* %17
%195 = load i32, i32* %14
%196 = add nsw i32 %195, 8
store i32 %196, i32* %14
%197 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%198 = call i32 @memset(i8* %197, i8 signext 32, i32 80)
%199 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%200 = getelementptr inbounds i8, i8* %199, i64 1
%201 = load i32, i32* %14
%202 = call i32 @sprintf(i8* %200, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %201)
store i32 %202, i32* %20
%203 = load i32, i32* %20
%204 = add nsw i32 %203, 1
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 %205
store i8 32, i8* %206
br label %207
207: ; preds = %192, %189
br label %208
208: ; preds = %207
%209 = load i32, i32* %19
%210 = add nsw i32 %209, 1
store i32 %210, i32* %19
br label %106
211: ; preds = %106
%212 = load i32, i32* %17
%213 = icmp sgt i32 %212, 52
br i1 %213, label %214, label %217
214: ; preds = %211
%215 = getelementptr inbounds [82 x i8], [82 x i8]* %11, i64 0, i64 0
%216 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %215)
br label %217
217: ; preds = %24, %96, %214, %211
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 %137, 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 %65
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 @sprintf(i8* %15, i8* dereferenceable(1) 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 %58, label %25
25: ; preds = %19, %53
%26 = phi i32 [ %43, %53 ], [ 1, %19 ]
%27 = phi i32 [ %54, %53 ], [ 8, %19 ]
%28 = phi i16* [ %29, %53 ], [ %0, %19 ]
%29 = getelementptr inbounds i16, i16* %28, 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 %27, 5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %36
%38 = zext i16 %34 to i32
%39 = call i32 @sprintf(i8* %37, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = add nsw i32 %27, 9
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %41
store i8 32, i8* %42
%43 = add nuw nsw i32 %26, 1
%44 = and i32 %43, 7
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %53
46: ; preds = %33
br i1 %14, label %47, label %49
47: ; preds = %46
%48 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %51
49: ; preds = %46
%50 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %51
51: ; preds = %49, %47
%52 = call i32 @memset(i8* %6, i8 signext 32, i32 80)
br label %53
53: ; preds = %33, %51
%54 = phi i32 [ %35, %33 ], [ 3, %51 ]
%55 = icmp eq i32 %43, %1
br i1 %55, label %56, label %25
56: ; preds = %53
%57 = icmp sgt i32 %54, 3
br i1 %57, label %58, label %137
58: ; preds = %19, %56
%59 = icmp eq i32 %2, -2
br i1 %59, label %60, label %63
60: ; preds = %58
%61 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 8
%62 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %61)
br label %137
63: ; preds = %58
%64 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %137
65: ; preds = %8
%66 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 1
%67 = call i32 @sprintf(i8* %66, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 0)
%68 = add nsw i32 %67, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %69
store i8 32, i8* %70
%71 = icmp eq i32 %3, 0
%72 = icmp eq i32 %2, 0
br label %73
73: ; preds = %65, %127
%74 = phi i32 [ 0, %65 ], [ %131, %127 ]
%75 = phi i32 [ 3, %65 ], [ %130, %127 ]
%76 = phi i32 [ 52, %65 ], [ %129, %127 ]
%77 = phi i16* [ %0, %65 ], [ %79, %127 ]
%78 = phi i32 [ 0, %65 ], [ %128, %127 ]
%79 = getelementptr inbounds i16, i16* %77, i64 1
%80 = load i16, i16* %77
br i1 %71, label %83, label %81
81: ; preds = %73
%82 = call zeroext i16 @swapb_ushort(i16 zeroext %80)
br label %83
83: ; preds = %81, %73
%84 = phi i16 [ %82, %81 ], [ %80, %73 ]
%85 = add nsw i32 %75, 5
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %86
%88 = zext i16 %84 to i32
%89 = call i32 @sprintf(i8* %87, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %88)
%90 = add nsw i32 %75, 9
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %91
store i8 32, i8* %92
br i1 %72, label %96, label %93
93: ; preds = %83
%94 = sext i32 %76 to i64
%95 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %94
store i8 32, i8* %95
br label %109
96: ; preds = %83
%97 = lshr i16 %84, 8
%98 = trunc i16 %97 to i8
%99 = trunc i16 %84 to i8
%100 = add i16 %84, -32512
%101 = icmp ult i16 %100, -24320
%102 = select i1 %101, i8 46, i8 %98
%103 = sext i32 %76 to i64
%104 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %103
store i8 %102, i8* %104
%105 = and i16 %84, 255
%106 = add nsw i16 %105, -127
%107 = icmp ult i16 %106, -95
%108 = select i1 %107, i8 46, i8 %99
br label %109
109: ; preds = %96, %93
%110 = phi i8 [ %108, %96 ], [ 32, %93 ]
%111 = add nsw i32 %76, 1
%112 = add nsw i32 %76, 2
%113 = sext i32 %111 to i64
%114 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %113
store i8 %110, i8* %114
%115 = sext i32 %112 to i64
%116 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %115
store i8 32, i8* %116
%117 = add nsw i32 %76, 3
%118 = icmp sgt i32 %76, 72
br i1 %118, label %119, label %127
119: ; preds = %109
%120 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %6)
%121 = add nsw i32 %78, 8
%122 = call i32 @memset(i8* %6, i8 signext 32, i32 80)
%123 = call i32 @sprintf(i8* %66, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %121)
%124 = add nsw i32 %123, 1
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [82 x i8], [82 x i8]* %5, i64 0, i64 %125
store i8 32, i8* %126
br label %127
127: ; preds = %109, %119
%128 = phi i32 [ %121, %119 ], [ %78, %109 ]
%129 = phi i32 [ 52, %119 ], [ %117, %109 ]
%130 = phi i32 [ 3, %119 ], [ %85, %109 ]
%131 = add nuw nsw i32 %74, 1
%132 = icmp eq i32 %131, %1
br i1 %132, label %133, label %73
133: ; preds = %127
%134 = icmp sgt i32 %129, 52
br i1 %134, label %135, label %137
135: ; preds = %133
%136 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %6)
br label %137
137: ; preds = %133, %135, %56, %63, %60, %4
ret void
}