#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*/ printf(char *, void *, unsigned int, unsigned int,
                          unsigned int, unsigned int, unsigned char *);
void sasutil_dump_block(void *blockAddr, unsigned long len) {
  unsigned int *dumpAddr = (unsigned int *)blockAddr;
  unsigned char *charAddr = (unsigned char *)blockAddr;
  void *tempAddr;
  unsigned char chars[20];
  unsigned char temp;
  unsigned int i, j;
  chars[16] = 0;
  for (i = 0; i < len; i = i + 16) {
    tempAddr = dumpAddr;
    for (j = 0; j < 16; j++) {
      temp = *charAddr++;
      if ((temp < 32) || (temp > 126))
        temp = '.';
      chars[j] = temp;
    };
    printf("%p  %08x %08x %08x %08x <%s>\n", tempAddr, *dumpAddr,
           *(dumpAddr + 1), *(dumpAddr + 2), *(dumpAddr + 3), chars);
    dumpAddr += 4;
  }
}


x86 assembly (clang, -O0):
<sasutil_dump_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movb   $0x0,-0x30(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x10(%rbp),%rax
jae    11fa <sasutil_dump_block+0xea>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x4c(%rbp)
cmpl   $0x10,-0x4c(%rbp)
jae    11ab <sasutil_dump_block+0x9b>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    %al,-0x41(%rbp)
movzbl -0x41(%rbp),%eax
cmp    $0x20,%eax
jl     118f <sasutil_dump_block+0x7f>
movzbl -0x41(%rbp),%eax
cmp    $0x7e,%eax
jle    1193 <sasutil_dump_block+0x83>
movb   $0x2e,-0x41(%rbp)
mov    -0x41(%rbp),%cl
mov    -0x4c(%rbp),%eax
mov    %cl,-0x40(%rbp,%rax,1)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1157 <sasutil_dump_block+0x47>
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%r9d
lea    -0x40(%rbp),%rax
lea    0xe29(%rip),%rdi
mov    %rax,(%rsp)
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
mov    -0x48(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x48(%rbp)
jmp    113b <sasutil_dump_block+0x2b>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sasutil_dump_block>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
movb   $0x0,0x20(%rsp)
test   %rsi,%rsi
je     11aa <sasutil_dump_block+0x9a>
mov    %rsi,%r14
mov    %rdi,%r12
xor    %ebx,%ebx
lea    0x10(%rsp),%r13
lea    0xef1(%rip),%r15
nop
lea    (%r12,%rbx,1),%rsi
movdqu (%r12,%rbx,1),%xmm0
movdqa %xmm0,%xmm1
paddb  0xeaa(%rip),%xmm1
movdqa %xmm1,%xmm2
pminub 0xeae(%rip),%xmm2
pcmpeqb %xmm1,%xmm2
movdqa %xmm2,%xmm1
pandn  %xmm0,%xmm1
pand   0xeaa(%rip),%xmm2
por    %xmm1,%xmm2
movdqa %xmm2,0x10(%rsp)
mov    (%r12,%rbx,1),%edx
mov    0x4(%r12,%rbx,1),%ecx
mov    0x8(%r12,%rbx,1),%r8d
mov    0xc(%r12,%rbx,1),%r9d
mov    %r13,(%rsp)
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x10,%rbx
mov    %ebx,%eax
cmp    %r14,%rax
jb     1140 <sasutil_dump_block+0x30>
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%p %08x %08x %08x %08x <%s>\0A\00"
define void @sasutil_dump_block(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [20 x i8]
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %5
%14 = load i8*, i8** %3
store i8* %14, i8** %6
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 16
store i8 0, i8* %15
store i32 0, i32* %10
br label %16
16: ; preds = %64, %2
%17 = load i32, i32* %10
%18 = zext i32 %17 to i64
%19 = load i64, i64* %4
%20 = icmp ult i64 %18, %19
br i1 %20, label %21, label %67
21: ; preds = %16
%22 = load i32*, i32** %5
%23 = bitcast i32* %22 to i8*
store i8* %23, i8** %7
store i32 0, i32* %11
br label %24
24: ; preds = %44, %21
%25 = load i32, i32* %11
%26 = icmp ult i32 %25, 16
br i1 %26, label %27, label %47
27: ; preds = %24
%28 = load i8*, i8** %6
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %6
%30 = load i8, i8* %28
store i8 %30, i8* %9
%31 = load i8, i8* %9
%32 = zext i8 %31 to i32
%33 = icmp slt i32 %32, 32
br i1 %33, label %38, label %34
34: ; preds = %27
%35 = load i8, i8* %9
%36 = zext i8 %35 to i32
%37 = icmp sgt i32 %36, 126
br i1 %37, label %38, label %39
38: ; preds = %34, %27
store i8 46, i8* %9
br label %39
39: ; preds = %38, %34
%40 = load i8, i8* %9
%41 = load i32, i32* %11
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 %42
store i8 %40, i8* %43
br label %44
44: ; preds = %39
%45 = load i32, i32* %11
%46 = add i32 %45, 1
store i32 %46, i32* %11
br label %24
47: ; preds = %24
%48 = load i8*, i8** %7
%49 = load i32*, i32** %5
%50 = load i32, i32* %49
%51 = load i32*, i32** %5
%52 = getelementptr inbounds i32, i32* %51, i64 1
%53 = load i32, i32* %52
%54 = load i32*, i32** %5
%55 = getelementptr inbounds i32, i32* %54, i64 2
%56 = load i32, i32* %55
%57 = load i32*, i32** %5
%58 = getelementptr inbounds i32, i32* %57, i64 3
%59 = load i32, i32* %58
%60 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%61 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %48, i32 %50, i32 %53, i32 %56, i32 %59, i8* %60)
%62 = load i32*, i32** %5
%63 = getelementptr inbounds i32, i32* %62, i64 4
store i32* %63, i32** %5
br label %64
64: ; preds = %47
%65 = load i32, i32* %10
%66 = add i32 %65, 16
store i32 %66, i32* %10
br label %16
67: ; preds = %16
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%p %08x %08x %08x %08x <%s>\0A\00"
define void @sasutil_dump_block(i8* %0, i64 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 16
store i8 0, i8* %5
%6 = icmp eq i64 %1, 0
br i1 %6, label %31, label %7
7: ; preds = %2
%8 = bitcast i8* %0 to i32*
%9 = bitcast [20 x i8]* %3 to <16 x i8>*
br label %10
10: ; preds = %7, %10
%11 = phi i32 [ %28, %10 ], [ 0, %7 ]
%12 = phi i32* [ %14, %10 ], [ %8, %7 ]
%13 = bitcast i32* %12 to i8*
%14 = getelementptr inbounds i32, i32* %12, i64 4
%15 = bitcast i32* %12 to <16 x i8>*
%16 = load <16 x i8>, <16 x i8>* %15
%17 = add <16 x i8> %16, <i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127, i8 -127>
%18 = icmp ult <16 x i8> %17, <i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95, i8 -95>
%19 = select <16 x i1> %18, <16 x i8> <i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46, i8 46>, <16 x i8> %16
store <16 x i8> %19, <16 x i8>* %9
%20 = load i32, i32* %12
%21 = getelementptr inbounds i32, i32* %12, i64 1
%22 = load i32, i32* %21
%23 = getelementptr inbounds i32, i32* %12, i64 2
%24 = load i32, i32* %23
%25 = getelementptr inbounds i32, i32* %12, i64 3
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %20, i32 %22, i32 %24, i32 %26, i8* %4)
%28 = add i32 %11, 16
%29 = zext i32 %28 to i64
%30 = icmp ult i64 %29, %1
br i1 %30, label %10, label %31
31: ; preds = %10, %2
ret void
}