#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 ntohs(unsigned short const);
int /*<<< orphan*/ printf(char *, ...);
void lamont_hdump(unsigned char *bp, unsigned int length) {
  static const char asciify[] =
      "................................ "
      "!\"#$%&'()*+,-./"
      "0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`"
      "abcdefghijklmnopqrstuvwxyz{|}~.........................................."
      "........................................................................"
      "...............";
  const unsigned short *sp;
  const unsigned char *ap;
  unsigned int i, j;
  int nshorts, nshorts2;
  int padding;
  printf("\n\t");
  padding = 0;
  sp = (unsigned short *)bp;
  ap = (unsigned char *)bp;
  nshorts = (unsigned int)length / sizeof(unsigned short);
  nshorts2 = (unsigned int)length / sizeof(unsigned short);
  i = 0;
  j = 0;
  while (1) {
    while (--nshorts >= 0) {
      printf(" %04x", ntohs(*sp));
      sp++;
      if ((++i % 8) == 0)
        break;
    }
    if (nshorts < 0) {
      if ((length & 1) && (((i - 1) % 8) != 0)) {
        printf(" %02x  ", *(unsigned char *)sp);
        padding++;
      }
      nshorts = (8 - (nshorts2 - nshorts));
      while (--nshorts >= 0) {
        printf("     ");
      }
      if (!padding)
        printf("     ");
    }
    printf("  ");
    while (--nshorts2 >= 0) {
      printf("%c%c", asciify[*ap], asciify[*(ap + 1)]);
      ap += 2;
      if ((++j % 8) == 0) {
        printf("\n\t");
        break;
      }
    }
    if (nshorts2 < 0) {
      if ((length & 1) && (((j - 1) % 8) != 0)) {
        printf("%c", asciify[*ap]);
      }
      break;
    }
  }
  if ((length & 1) && (((i - 1) % 8) == 0)) {
    printf(" %02x", *(unsigned char *)sp);
    printf("                                       %c", asciify[*ap]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<lamont_hdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xfcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1,%rax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1,%rax
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
jmp    117b <lamont_hdump+0x5b>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jl     11d4 <lamont_hdump+0xb4>
mov    -0x18(%rbp),%rax
movzwl (%rax),%edi
call   1040 <ntohs@plt>
mov    %eax,%esi
lea    0xf62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
and    $0x7,%eax
cmp    $0x0,%eax
jne    11cf <lamont_hdump+0xaf>
jmp    11d4 <lamont_hdump+0xb4>
jmp    117b <lamont_hdump+0x5b>
cmpl   $0x0,-0x2c(%rbp)
jge    126f <lamont_hdump+0x14f>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     121d <lamont_hdump+0xfd>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
and    $0x7,%eax
cmp    $0x0,%eax
je     121d <lamont_hdump+0xfd>
mov    -0x18(%rbp),%rax
movzbl (%rax),%esi
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%ecx
sub    -0x2c(%rbp),%ecx
mov    $0x8,%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jl     1252 <lamont_hdump+0x132>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122d <lamont_hdump+0x10d>
cmpl   $0x0,-0x34(%rbp)
jne    126a <lamont_hdump+0x14a>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126f <lamont_hdump+0x14f>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
cmp    $0x0,%eax
jl     12ff <lamont_hdump+0x1df>
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,%ecx
lea    0xd61(%rip),%rax
movsbl (%rax,%rcx,1),%esi
mov    -0x20(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,%ecx
lea    0xd4c(%rip),%rax
movsbl (%rax,%rcx,1),%edx
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
and    $0x7,%eax
cmp    $0x0,%eax
jne    12fa <lamont_hdump+0x1da>
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ff <lamont_hdump+0x1df>
jmp    127d <lamont_hdump+0x15d>
cmpl   $0x0,-0x30(%rbp)
jge    1351 <lamont_hdump+0x231>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     134c <lamont_hdump+0x22c>
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
and    $0x7,%eax
cmp    $0x0,%eax
je     134c <lamont_hdump+0x22c>
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,%ecx
lea    0xcc6(%rip),%rax
movsbl (%rax,%rcx,1),%esi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1356 <lamont_hdump+0x236>
jmp    1176 <lamont_hdump+0x56>
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     13ae <lamont_hdump+0x28e>
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
and    $0x7,%eax
cmp    $0x0,%eax
jne    13ae <lamont_hdump+0x28e>
mov    -0x18(%rbp),%rax
movzbl (%rax),%esi
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,%ecx
lea    0xc64(%rip),%rax
movsbl (%rax,%rcx,1),%esi
lea    0xd7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lamont_hdump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %esi,%ebx
mov    %rdi,%r13
lea    0xfb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,0x1c(%rsp)
mov    %ebx,%edx
shr    %edx
mov    %r13,%r14
xor    %eax,%eax
xor    %ebp,%ebp
mov    %edx,%r15d
movl   $0x0,0xc(%rsp)
mov    %r13,0x28(%rsp)
mov    %eax,%ecx
mov    %rcx,0x30(%rsp)
lea    (%rdx,%rax,1),%ecx
test   %edx,%edx
mov    $0x0,%eax
cmovs  %edx,%eax
sub    %eax,%ecx
mov    %rcx,0x20(%rsp)
mov    %edx,%ecx
sub    %eax,%ecx
mov    %rcx,0x40(%rsp)
mov    %rdx,0x10(%rsp)
sub    %r15d,%edx
mov    %rdx,0x38(%rsp)
lea    0x7(%rdx),%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
cmp    %ebx,0x40(%rsp)
je     1210 <lamont_hdump+0xe0>
mov    0x28(%rsp),%rax
movzwl (%rax,%rbx,2),%edi
call   1050 <ntohs@plt>
lea    0xf39(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x2,%r13
mov    0x30(%rsp),%rax
add    %ebx,%eax
not    %al
add    $0x1,%rbx
add    $0xffffffff,%r12d
test   $0x7,%al
jne    11b0 <lamont_hdump+0x80>
mov    0x30(%rsp),%rcx
add    %ebx,%ecx
mov    0x10(%rsp),%rax
sub    %ebx,%eax
mov    %rax,0x10(%rsp)
mov    %ecx,%eax
mov    %rax,0x20(%rsp)
jmp    12a0 <lamont_hdump+0x170>
nopl   0x0(%rax)
testb  $0x1,0x1c(%rsp)
je     123f <lamont_hdump+0x10f>
mov    0x20(%rsp),%rax
add    $0xffffffff,%eax
test   $0x7,%al
je     123f <lamont_hdump+0x10f>
mov    0x28(%rsp),%rax
movzbl (%rax,%rbx,2),%esi
lea    0xed7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0x1,0xc(%rsp)
mov    0x38(%rsp),%rcx
sub    %rbx,%rcx
lea    0x7(%rcx),%eax
test   %eax,%eax
jle    1330 <lamont_hdump+0x200>
lea    0xeb9(%rip),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%r12d
test   %r12d,%r12d
jg     1260 <lamont_hdump+0x130>
mov    $0xffffffff,%eax
mov    %rax,0x10(%rsp)
cmpl   $0x0,0xc(%rsp)
jne    12a0 <lamont_hdump+0x170>
movl   $0x0,0xc(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
lea    0xe6e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%r15,%rbp,1),%r12d
test   %r15d,%r15d
mov    $0x0,%ebx
cmovs  %r15d,%ebx
sub    %ebx,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %r15d,%ebx
je     1352 <lamont_hdump+0x222>
movzbl (%r14),%eax
lea    0xd20(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
movzbl 0x1(%r14),%eax
movsbl (%rax,%rcx,1),%edx
lea    0xe24(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x2,%r14
add    $0x1,%ebp
add    $0xffffffff,%r15d
test   $0x7,%bpl
jne    12d0 <lamont_hdump+0x1a0>
lea    0xdee(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,0x28(%rsp)
mov    0x20(%rsp),%rax
mov    0x10(%rsp),%rdx
jmp    1170 <lamont_hdump+0x40>
xchg   %ax,%ax
add    $0x6,%rcx
mov    %ecx,%eax
mov    %rax,0x10(%rsp)
lea    0xdd0(%rip),%rbx
cmpl   $0x0,0xc(%rsp)
jne    12a0 <lamont_hdump+0x170>
jmp    1284 <lamont_hdump+0x154>
testb  $0x1,0x1c(%rsp)
je     13b3 <lamont_hdump+0x283>
add    $0xffffffff,%r12d
test   $0x7,%r12b
je     1377 <lamont_hdump+0x247>
movzbl (%r14),%eax
lea    0xc92(%rip),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    0x20(%rsp),%rax
add    $0xffffffff,%eax
test   $0x7,%al
jne    13b3 <lamont_hdump+0x283>
movzbl 0x0(%r13),%esi
lea    0xd8e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%r14),%eax
lea    0xc5f(%rip),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xd77(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@lamont_hdump.asciify = internal constant [257 x i8] c"................................ !\22#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~.................................................................................................................................\00"
@.str = [3 x i8] c"\0A\09\00"
@.str.1 = [6 x i8] c" %04x\00"
@.str.2 = [8 x i8] c" %02x \00"
@.str.3 = [6 x i8] c" \00"
@.str.4 = [3 x i8] c" \00"
@.str.5 = [5 x i8] c"%c%c\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [6 x i8] c" %02x\00"
@.str.8 = [42 x i8] c" %c\00"
@.str.9 = [2 x i8] c"\0A\00"
define void @lamont_hdump(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i16*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %11
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i16*
store i16* %14, i16** %5
%15 = load i8*, i8** %3
store i8* %15, i8** %6
%16 = load i32, i32* %4
%17 = zext i32 %16 to i64
%18 = udiv i64 %17, 2
%19 = trunc i64 %18 to i32
store i32 %19, i32* %9
%20 = load i32, i32* %4
%21 = zext i32 %20 to i64
%22 = udiv i64 %21, 2
%23 = trunc i64 %22 to i32
store i32 %23, i32* %10
store i32 0, i32* %7
store i32 0, i32* %8
br label %24
24: ; preds = %2, %130
br label %25
25: ; preds = %41, %24
%26 = load i32, i32* %9
%27 = add nsw i32 %26, -1
store i32 %27, i32* %9
%28 = icmp sge i32 %27, 0
br i1 %28, label %29, label %42
29: ; preds = %25
%30 = load i16*, i16** %5
%31 = load i16, i16* %30
%32 = call i32 @ntohs(i16 zeroext %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%34 = load i16*, i16** %5
%35 = getelementptr inbounds i16, i16* %34, i32 1
store i16* %35, i16** %5
%36 = load i32, i32* %7
%37 = add i32 %36, 1
store i32 %37, i32* %7
%38 = urem i32 %37, 8
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %29
br label %42
41: ; preds = %29
br label %25
42: ; preds = %40, %25
%43 = load i32, i32* %9
%44 = icmp slt i32 %43, 0
br i1 %44, label %45, label %79
45: ; preds = %42
%46 = load i32, i32* %4
%47 = and i32 %46, 1
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %62
49: ; preds = %45
%50 = load i32, i32* %7
%51 = sub i32 %50, 1
%52 = urem i32 %51, 8
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %62
54: ; preds = %49
%55 = load i16*, i16** %5
%56 = bitcast i16* %55 to i8*
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %58)
%60 = load i32, i32* %11
%61 = add nsw i32 %60, 1
store i32 %61, i32* %11
br label %62
62: ; preds = %54, %49, %45
%63 = load i32, i32* %10
%64 = load i32, i32* %9
%65 = sub nsw i32 %63, %64
%66 = sub nsw i32 8, %65
store i32 %66, i32* %9
br label %67
67: ; preds = %71, %62
%68 = load i32, i32* %9
%69 = add nsw i32 %68, -1
store i32 %69, i32* %9
%70 = icmp sge i32 %69, 0
br i1 %70, label %71, label %73
71: ; preds = %67
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %67
73: ; preds = %67
%74 = load i32, i32* %11
%75 = icmp ne i32 %74, 0
br i1 %75, label %78, label %76
76: ; preds = %73
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %78
78: ; preds = %76, %73
br label %79
79: ; preds = %78, %42
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %81
81: ; preds = %108, %79
%82 = load i32, i32* %10
%83 = add nsw i32 %82, -1
store i32 %83, i32* %10
%84 = icmp sge i32 %83, 0
br i1 %84, label %85, label %109
85: ; preds = %81
%86 = load i8*, i8** %6
%87 = load i8, i8* %86
%88 = zext i8 %87 to i64
%89 = getelementptr inbounds [257 x i8], [257 x i8]* @lamont_hdump.asciify, i64 0, i64 %88
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = load i8*, i8** %6
%93 = getelementptr inbounds i8, i8* %92, i64 1
%94 = load i8, i8* %93
%95 = zext i8 %94 to i64
%96 = getelementptr inbounds [257 x i8], [257 x i8]* @lamont_hdump.asciify, i64 0, i64 %95
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %91, i32 %98)
%100 = load i8*, i8** %6
%101 = getelementptr inbounds i8, i8* %100, i64 2
store i8* %101, i8** %6
%102 = load i32, i32* %8
%103 = add i32 %102, 1
store i32 %103, i32* %8
%104 = urem i32 %103, 8
%105 = icmp eq i32 %104, 0
br i1 %105, label %106, label %108
106: ; preds = %85
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %109
108: ; preds = %85
br label %81
109: ; preds = %106, %81
%110 = load i32, i32* %10
%111 = icmp slt i32 %110, 0
br i1 %111, label %112, label %130
112: ; preds = %109
%113 = load i32, i32* %4
%114 = and i32 %113, 1
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %129
116: ; preds = %112
%117 = load i32, i32* %8
%118 = sub i32 %117, 1
%119 = urem i32 %118, 8
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %129
121: ; preds = %116
%122 = load i8*, i8** %6
%123 = load i8, i8* %122
%124 = zext i8 %123 to i64
%125 = getelementptr inbounds [257 x i8], [257 x i8]* @lamont_hdump.asciify, i64 0, i64 %124
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %127)
br label %129
129: ; preds = %121, %116, %112
br label %131
130: ; preds = %109
br label %24
131: ; preds = %129
%132 = load i32, i32* %4
%133 = and i32 %132, 1
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %153
135: ; preds = %131
%136 = load i32, i32* %7
%137 = sub i32 %136, 1
%138 = urem i32 %137, 8
%139 = icmp eq i32 %138, 0
br i1 %139, label %140, label %153
140: ; preds = %135
%141 = load i16*, i16** %5
%142 = bitcast i16* %141 to i8*
%143 = load i8, i8* %142
%144 = zext i8 %143 to i32
%145 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %144)
%146 = load i8*, i8** %6
%147 = load i8, i8* %146
%148 = zext i8 %147 to i64
%149 = getelementptr inbounds [257 x i8], [257 x i8]* @lamont_hdump.asciify, i64 0, i64 %148
%150 = load i8, i8* %149
%151 = sext i8 %150 to i32
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i32 %151)
br label %153
153: ; preds = %140, %135, %131
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@lamont_hdump.asciify = internal unnamed_addr constant [257 x i8] c"................................ !\22#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~.................................................................................................................................\00"
@.str = [3 x i8] c"\0A\09\00"
@.str.1 = [6 x i8] c" %04x\00"
@.str.2 = [8 x i8] c" %02x \00"
@.str.3 = [6 x i8] c" \00"
@.str.4 = [3 x i8] c" \00"
@.str.5 = [5 x i8] c"%c%c\00"
@.str.7 = [6 x i8] c" %02x\00"
@.str.8 = [42 x i8] c" %c\00"
define void @lamont_hdump(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i8* %0 to i16*
%5 = lshr i32 %1, 1
%6 = and i32 %1, 1
%7 = icmp eq i32 %6, 0
br label %8
8: ; preds = %92, %2
%9 = phi i16* [ %4, %2 ], [ %62, %92 ]
%10 = phi i8* [ %0, %2 ], [ %88, %92 ]
%11 = phi i32 [ 0, %2 ], [ %61, %92 ]
%12 = phi i32 [ 0, %2 ], [ %89, %92 ]
%13 = phi i32 [ %5, %2 ], [ %63, %92 ]
%14 = phi i32 [ %5, %2 ], [ %73, %92 ]
%15 = phi i32 [ 0, %2 ], [ %64, %92 ]
%16 = add i32 %13, %11
%17 = call i32 @llvm.smin.i32(i32 %13, i32 0)
%18 = sub i32 %16, %17
br label %19
19: ; preds = %25, %8
%20 = phi i16* [ %9, %8 ], [ %29, %25 ]
%21 = phi i32 [ %11, %8 ], [ %30, %25 ]
%22 = phi i32 [ %13, %8 ], [ %23, %25 ]
%23 = add nsw i32 %22, -1
%24 = icmp eq i32 %21, %18
br i1 %24, label %33, label %25
25: ; preds = %19
%26 = load i16, i16* %20
%27 = tail call i32 @ntohs(i16 zeroext %26)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds i16, i16* %20, i64 1
%30 = add i32 %21, 1
%31 = trunc i32 %30 to i3
%32 = icmp eq i3 %31, 0
br i1 %32, label %60, label %19
33: ; preds = %19
br i1 %7, label %44, label %34
34: ; preds = %33
%35 = add i32 %18, 7
%36 = and i32 %35, 7
%37 = icmp eq i32 %36, 0
br i1 %37, label %44, label %38
38: ; preds = %34
%39 = bitcast i16* %20 to i8*
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = add nsw i32 %15, 1
br label %44
44: ; preds = %38, %34, %33
%45 = phi i32 [ %43, %38 ], [ %15, %34 ], [ %15, %33 ]
%46 = sub i32 %22, %14
%47 = add i32 %46, 7
%48 = add i32 %46, 6
%49 = icmp sgt i32 %47, 0
br i1 %49, label %50, label %55
50: ; preds = %44, %50
%51 = phi i32 [ %53, %50 ], [ %48, %44 ]
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%53 = add nsw i32 %51, -1
%54 = icmp sgt i32 %51, 0
br i1 %54, label %50, label %55
55: ; preds = %50, %44
%56 = phi i32 [ %48, %44 ], [ -1, %50 ]
%57 = icmp eq i32 %45, 0
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %60
60: ; preds = %25, %55, %58
%61 = phi i32 [ %18, %55 ], [ %18, %58 ], [ %30, %25 ]
%62 = phi i16* [ %20, %55 ], [ %20, %58 ], [ %29, %25 ]
%63 = phi i32 [ %56, %55 ], [ %56, %58 ], [ %23, %25 ]
%64 = phi i32 [ %45, %55 ], [ 0, %58 ], [ %15, %25 ]
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%66 = add i32 %14, %12
%67 = call i32 @llvm.smin.i32(i32 %14, i32 0)
%68 = sub i32 %66, %67
br label %69
69: ; preds = %75, %60
%70 = phi i8* [ %10, %60 ], [ %88, %75 ]
%71 = phi i32 [ %12, %60 ], [ %89, %75 ]
%72 = phi i32 [ %14, %60 ], [ %73, %75 ]
%73 = add nsw i32 %72, -1
%74 = icmp eq i32 %71, %68
br i1 %74, label %94, label %75
75: ; preds = %69
%76 = load i8, i8* %70
%77 = zext i8 %76 to i64
%78 = getelementptr inbounds [257 x i8], [257 x i8]* @lamont_hdump.asciify, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = getelementptr inbounds i8, i8* %70, i64 1
%82 = load i8, i8* %81
%83 = zext i8 %82 to i64
%84 = getelementptr inbounds [257 x i8], [257 x i8]* @lamont_hdump.asciify, i64 0, i64 %83
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %80, i32 %86)
%88 = getelementptr inbounds i8, i8* %70, i64 2
%89 = add i32 %71, 1
%90 = trunc i32 %89 to i3
%91 = icmp eq i3 %90, 0
br i1 %91, label %92, label %69
92: ; preds = %75
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
94: ; preds = %69
br i1 %7, label %121, label %95
95: ; preds = %94
%96 = add i32 %68, 7
%97 = and i32 %96, 7
%98 = icmp eq i32 %97, 0
br i1 %98, label %106, label %99
99: ; preds = %95
%100 = load i8, i8* %70
%101 = zext i8 %100 to i64
%102 = getelementptr inbounds [257 x i8], [257 x i8]* @lamont_hdump.asciify, i64 0, i64 %101
%103 = load i8, i8* %102
%104 = sext i8 %103 to i32
%105 = tail call i32 @putchar(i32 %104)
br label %106
106: ; preds = %99, %95
%107 = add i32 %61, 7
%108 = and i32 %107, 7
%109 = icmp eq i32 %108, 0
br i1 %109, label %110, label %121
110: ; preds = %106
%111 = bitcast i16* %62 to i8*
%112 = load i8, i8* %111
%113 = zext i8 %112 to i32
%114 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %113)
%115 = load i8, i8* %70
%116 = zext i8 %115 to i64
%117 = getelementptr inbounds [257 x i8], [257 x i8]* @lamont_hdump.asciify, i64 0, i64 %116
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0), i32 %119)
br label %121
121: ; preds = %94, %110, %106
%122 = tail call i32 @putchar(i32 10)
ret void
}