#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*/ log_redirect(int, char *, ...);
void dump2_log(const void *dump_1, const void *dump_2, const unsigned int lng) {
  unsigned int i, j;
  unsigned int nbr_line;
  nbr_line = (lng + 0x08 - 1) / 0x08;
  for (i = 0; (i < nbr_line); i++) {
    log_redirect((1 << 3), "%04X ", i * 0x08);
    for (j = 0; j < 0x08; j++) {
      if (i * 0x08 + j < lng) {
        unsigned char car = *((const unsigned char *)dump_1 + i * 0x08 + j);
        log_redirect((1 << 3), "%02x", car);
      } else
        log_redirect((1 << 3), "  ");
      if (j % 4 == (4 - 1))
        log_redirect((1 << 3), " ");
    }
    log_redirect((1 << 3), "  ");
    for (j = 0; j < 0x08; j++) {
      if (i * 0x08 + j < lng) {
        unsigned char car = *((const unsigned char *)dump_1 + i * 0x08 + j);
        if ((car < 32) || (car >= 127))
          log_redirect((1 << 3), ".");
        else
          log_redirect((1 << 3), "%c", car);
      } else
        log_redirect((1 << 3), " ");
    }
    log_redirect((1 << 3), "  ");
    for (j = 0; j < 0x08; j++) {
      if (i * 0x08 + j < lng) {
        unsigned char car = *((const unsigned char *)dump_2 + i * 0x08 + j);
        log_redirect((1 << 3), "%02x", car);
      } else
        log_redirect((1 << 3), "  ");
      if (j % 4 == (4 - 1))
        log_redirect((1 << 3), " ");
    }
    log_redirect((1 << 3), "  ");
    for (j = 0; j < 0x08; j++) {
      if (i * 0x08 + j < lng) {
        unsigned char car = *((const unsigned char *)dump_2 + i * 0x08 + j);
        if ((car < 32) || (car >= 127))
          log_redirect((1 << 3), ".");
        else
          log_redirect((1 << 3), "%c", car);
      } else
        log_redirect((1 << 3), " ");
    }
    log_redirect((1 << 3), "\n");
  }
}


x86 assembly (clang, -O0):
<dump2_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x8,%eax
sub    $0x1,%eax
shr    $0x3,%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    1454 <dump2_log+0x344>
mov    -0x18(%rbp),%edx
shl    $0x3,%edx
mov    $0x8,%edi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jae    11fd <dump2_log+0xed>
mov    -0x18(%rbp),%eax
shl    $0x3,%eax
add    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    11b5 <dump2_log+0xa5>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%edx
mov    $0x8,%edi
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    11c8 <dump2_log+0xb8>
mov    $0x8,%edi
lea    0xe4a(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
mov    -0x1c(%rbp),%eax
and    $0x3,%eax
cmp    $0x3,%eax
jne    11ea <dump2_log+0xda>
mov    $0x8,%edi
lea    0xe29(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    11ef <dump2_log+0xdf>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1165 <dump2_log+0x55>
mov    $0x8,%edi
lea    0xe02(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jae    12bf <dump2_log+0x1af>
mov    -0x18(%rbp),%eax
shl    $0x3,%eax
add    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1299 <dump2_log+0x189>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x22(%rbp)
movzbl -0x22(%rbp),%eax
cmp    $0x20,%eax
jl     1265 <dump2_log+0x155>
movzbl -0x22(%rbp),%eax
cmp    $0x7f,%eax
jl     127d <dump2_log+0x16d>
mov    $0x8,%edi
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    1294 <dump2_log+0x184>
movzbl -0x22(%rbp),%edx
mov    $0x8,%edi
lea    0xd83(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    12ac <dump2_log+0x19c>
mov    $0x8,%edi
lea    0xd67(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    12b1 <dump2_log+0x1a1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1217 <dump2_log+0x107>
mov    $0x8,%edi
lea    0xd40(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jae    1371 <dump2_log+0x261>
mov    -0x18(%rbp),%eax
shl    $0x3,%eax
add    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1329 <dump2_log+0x219>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x23(%rbp)
movzbl -0x23(%rbp),%edx
mov    $0x8,%edi
lea    0xce9(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    133c <dump2_log+0x22c>
mov    $0x8,%edi
lea    0xcd6(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
mov    -0x1c(%rbp),%eax
and    $0x3,%eax
cmp    $0x3,%eax
jne    135e <dump2_log+0x24e>
mov    $0x8,%edi
lea    0xcb5(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    1363 <dump2_log+0x253>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12d9 <dump2_log+0x1c9>
mov    $0x8,%edi
lea    0xc8e(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jae    1433 <dump2_log+0x323>
mov    -0x18(%rbp),%eax
shl    $0x3,%eax
add    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    140d <dump2_log+0x2fd>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x24(%rbp)
movzbl -0x24(%rbp),%eax
cmp    $0x20,%eax
jl     13d9 <dump2_log+0x2c9>
movzbl -0x24(%rbp),%eax
cmp    $0x7f,%eax
jl     13f1 <dump2_log+0x2e1>
mov    $0x8,%edi
lea    0xc29(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    1408 <dump2_log+0x2f8>
movzbl -0x24(%rbp),%edx
mov    $0x8,%edi
lea    0xc0f(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    1420 <dump2_log+0x310>
mov    $0x8,%edi
lea    0xbf3(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
jmp    1425 <dump2_log+0x315>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    138b <dump2_log+0x27b>
mov    $0x8,%edi
lea    0xbd4(%rip),%rsi
mov    $0x0,%al
call   1030 <log_redirect@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1139 <dump2_log+0x29>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump2_log>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0x7(%rdx),%eax
mov    %rax,0x8(%rsp)
cmp    $0x8,%eax
jae    113a <dump2_log+0x2a>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x8(%rsp),%rax
shr    $0x3,%eax
mov    %rax,0x8(%rsp)
mov    %edx,%r15d
lea    0xeb5(%rip),%r13
xor    %r12d,%r12d
xor    %eax,%eax
jmp    118f <dump2_log+0x7f>
xchg   %ax,%ax
mov    $0x8,%edi
lea    0xea7(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
mov    0x10(%rsp),%rax
add    $0x1,%rax
add    $0x8,%rbx
add    $0x8,%r12
add    $0x8,%r14
cmp    0x8(%rsp),%rax
je     112b <dump2_log+0x1b>
mov    %rax,0x10(%rsp)
lea    0x0(,%rax,8),%edx
mov    $0x8,%edi
lea    0xe59(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
xor    %ebp,%ebp
jmp    11ca <dump2_log+0xba>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbp
cmp    $0x8,%rbp
je     1220 <dump2_log+0x110>
lea    (%r12,%rbp,1),%rax
cmp    %r15,%rax
jae    11f0 <dump2_log+0xe0>
movzbl (%rbx,%rbp,1),%edx
mov    $0x8,%edi
lea    0xe23(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
jmp    1203 <dump2_log+0xf3>
nopl   0x0(%rax)
mov    $0x8,%edi
lea    0xe0f(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
mov    %ebp,%eax
not    %eax
test   $0x3,%al
jne    11c0 <dump2_log+0xb0>
mov    $0x8,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
jmp    11c0 <dump2_log+0xb0>
nopl   0x0(%rax)
mov    $0x8,%edi
lea    0xddf(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
xor    %ebp,%ebp
jmp    1259 <dump2_log+0x149>
nopw   0x0(%rax,%rax,1)
mov    $0x8,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
add    $0x1,%rbp
cmp    $0x8,%rbp
je     1290 <dump2_log+0x180>
lea    (%r12,%rbp,1),%rax
cmp    %r15,%rax
jae    1240 <dump2_log+0x130>
movzbl (%rbx,%rbp,1),%edx
lea    -0x7f(%rdx),%eax
mov    $0x8,%edi
cmp    $0xa0,%al
ja     1280 <dump2_log+0x170>
lea    0xd95(%rip),%rsi
jmp    1248 <dump2_log+0x138>
nopl   0x0(%rax,%rax,1)
lea    0xd89(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
jmp    124f <dump2_log+0x13f>
mov    $0x8,%edi
lea    0xd6f(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
xor    %ebp,%ebp
jmp    12ba <dump2_log+0x1aa>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    $0x8,%rbp
je     1310 <dump2_log+0x200>
lea    (%r12,%rbp,1),%rax
cmp    %r15,%rax
jae    12e0 <dump2_log+0x1d0>
movzbl (%r14,%rbp,1),%edx
mov    $0x8,%edi
lea    0xd32(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
jmp    12f3 <dump2_log+0x1e3>
nopl   (%rax)
mov    $0x8,%edi
lea    0xd1f(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
mov    %ebp,%eax
not    %eax
test   $0x3,%al
jne    12b0 <dump2_log+0x1a0>
mov    $0x8,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
jmp    12b0 <dump2_log+0x1a0>
nopl   0x0(%rax)
mov    $0x8,%edi
lea    0xcef(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
xor    %ebp,%ebp
jmp    134d <dump2_log+0x23d>
nopw   0x0(%rax,%rax,1)
mov    $0x8,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
add    $0x1,%rbp
cmp    $0x8,%rbp
je     1160 <dump2_log+0x50>
lea    (%r12,%rbp,1),%rax
cmp    %r15,%rax
jae    1330 <dump2_log+0x220>
movzbl (%r14,%rbp,1),%edx
lea    -0x7f(%rdx),%eax
mov    $0x8,%edi
cmp    $0xa0,%al
ja     1370 <dump2_log+0x260>
lea    0xca0(%rip),%rsi
jmp    1338 <dump2_log+0x228>
lea    0xc99(%rip),%rsi
xor    %eax,%eax
call   1030 <log_redirect@plt>
jmp    133f <dump2_log+0x22f>

LLVM IR (-O0):
@.str = [6 x i8] c"%04X \00"
@.str.1 = [5 x i8] c"%02x\00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [2 x i8] c".\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [2 x i8] c"\0A\00"
define void @dump2_log(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%14 = load i32, i32* %6
%15 = add i32 %14, 8
%16 = sub i32 %15, 1
%17 = udiv i32 %16, 8
store i32 %17, i32* %9
store i32 0, i32* %7
br label %18
18: ; preds = %184, %3
%19 = load i32, i32* %7
%20 = load i32, i32* %9
%21 = icmp ult i32 %19, %20
br i1 %21, label %22, label %187
22: ; preds = %18
%23 = load i32, i32* %7
%24 = mul i32 %23, 8
%25 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %24)
store i32 0, i32* %8
br label %26
26: ; preds = %58, %22
%27 = load i32, i32* %8
%28 = icmp ult i32 %27, 8
br i1 %28, label %29, label %61
29: ; preds = %26
%30 = load i32, i32* %7
%31 = mul i32 %30, 8
%32 = load i32, i32* %8
%33 = add i32 %31, %32
%34 = load i32, i32* %6
%35 = icmp ult i32 %33, %34
br i1 %35, label %36, label %49
36: ; preds = %29
%37 = load i8*, i8** %4
%38 = load i32, i32* %7
%39 = mul i32 %38, 8
%40 = zext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %37, i64 %40
%42 = load i32, i32* %8
%43 = zext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %41, i64 %43
%45 = load i8, i8* %44
store i8 %45, i8* %10
%46 = load i8, i8* %10
%47 = zext i8 %46 to i32
%48 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %47)
br label %51
49: ; preds = %29
%50 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %49, %36
%52 = load i32, i32* %8
%53 = urem i32 %52, 4
%54 = icmp eq i32 %53, 3
br i1 %54, label %55, label %57
55: ; preds = %51
%56 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %57
57: ; preds = %55, %51
br label %58
58: ; preds = %57
%59 = load i32, i32* %8
%60 = add i32 %59, 1
store i32 %60, i32* %8
br label %26
61: ; preds = %26
%62 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %8
br label %63
63: ; preds = %100, %61
%64 = load i32, i32* %8
%65 = icmp ult i32 %64, 8
br i1 %65, label %66, label %103
66: ; preds = %63
%67 = load i32, i32* %7
%68 = mul i32 %67, 8
%69 = load i32, i32* %8
%70 = add i32 %68, %69
%71 = load i32, i32* %6
%72 = icmp ult i32 %70, %71
br i1 %72, label %73, label %97
73: ; preds = %66
%74 = load i8*, i8** %4
%75 = load i32, i32* %7
%76 = mul i32 %75, 8
%77 = zext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %74, i64 %77
%79 = load i32, i32* %8
%80 = zext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %78, i64 %80
%82 = load i8, i8* %81
store i8 %82, i8* %11
%83 = load i8, i8* %11
%84 = zext i8 %83 to i32
%85 = icmp slt i32 %84, 32
br i1 %85, label %90, label %86
86: ; preds = %73
%87 = load i8, i8* %11
%88 = zext i8 %87 to i32
%89 = icmp sge i32 %88, 127
br i1 %89, label %90, label %92
90: ; preds = %86, %73
%91 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %96
92: ; preds = %86
%93 = load i8, i8* %11
%94 = zext i8 %93 to i32
%95 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %94)
br label %96
96: ; preds = %92, %90
br label %99
97: ; preds = %66
%98 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %99
99: ; preds = %97, %96
br label %100
100: ; preds = %99
%101 = load i32, i32* %8
%102 = add i32 %101, 1
store i32 %102, i32* %8
br label %63
103: ; preds = %63
%104 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %8
br label %105
105: ; preds = %137, %103
%106 = load i32, i32* %8
%107 = icmp ult i32 %106, 8
br i1 %107, label %108, label %140
108: ; preds = %105
%109 = load i32, i32* %7
%110 = mul i32 %109, 8
%111 = load i32, i32* %8
%112 = add i32 %110, %111
%113 = load i32, i32* %6
%114 = icmp ult i32 %112, %113
br i1 %114, label %115, label %128
115: ; preds = %108
%116 = load i8*, i8** %5
%117 = load i32, i32* %7
%118 = mul i32 %117, 8
%119 = zext i32 %118 to i64
%120 = getelementptr inbounds i8, i8* %116, i64 %119
%121 = load i32, i32* %8
%122 = zext i32 %121 to i64
%123 = getelementptr inbounds i8, i8* %120, i64 %122
%124 = load i8, i8* %123
store i8 %124, i8* %12
%125 = load i8, i8* %12
%126 = zext i8 %125 to i32
%127 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %126)
br label %130
128: ; preds = %108
%129 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %130
130: ; preds = %128, %115
%131 = load i32, i32* %8
%132 = urem i32 %131, 4
%133 = icmp eq i32 %132, 3
br i1 %133, label %134, label %136
134: ; preds = %130
%135 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %136
136: ; preds = %134, %130
br label %137
137: ; preds = %136
%138 = load i32, i32* %8
%139 = add i32 %138, 1
store i32 %139, i32* %8
br label %105
140: ; preds = %105
%141 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %8
br label %142
142: ; preds = %179, %140
%143 = load i32, i32* %8
%144 = icmp ult i32 %143, 8
br i1 %144, label %145, label %182
145: ; preds = %142
%146 = load i32, i32* %7
%147 = mul i32 %146, 8
%148 = load i32, i32* %8
%149 = add i32 %147, %148
%150 = load i32, i32* %6
%151 = icmp ult i32 %149, %150
br i1 %151, label %152, label %176
152: ; preds = %145
%153 = load i8*, i8** %5
%154 = load i32, i32* %7
%155 = mul i32 %154, 8
%156 = zext i32 %155 to i64
%157 = getelementptr inbounds i8, i8* %153, i64 %156
%158 = load i32, i32* %8
%159 = zext i32 %158 to i64
%160 = getelementptr inbounds i8, i8* %157, i64 %159
%161 = load i8, i8* %160
store i8 %161, i8* %13
%162 = load i8, i8* %13
%163 = zext i8 %162 to i32
%164 = icmp slt i32 %163, 32
br i1 %164, label %169, label %165
165: ; preds = %152
%166 = load i8, i8* %13
%167 = zext i8 %166 to i32
%168 = icmp sge i32 %167, 127
br i1 %168, label %169, label %171
169: ; preds = %165, %152
%170 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %175
171: ; preds = %165
%172 = load i8, i8* %13
%173 = zext i8 %172 to i32
%174 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %173)
br label %175
175: ; preds = %171, %169
br label %178
176: ; preds = %145
%177 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %178
178: ; preds = %176, %175
br label %179
179: ; preds = %178
%180 = load i32, i32* %8
%181 = add i32 %180, 1
store i32 %181, i32* %8
br label %142
182: ; preds = %142
%183 = call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %184
184: ; preds = %182
%185 = load i32, i32* %7
%186 = add i32 %185, 1
store i32 %186, i32* %7
br label %18
187: ; preds = %18
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%04X \00"
@.str.1 = [5 x i8] c"%02x\00"
@.str.2 = [3 x i8] c" \00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [2 x i8] c".\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [2 x i8] c"\0A\00"
define void @dump2_log(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = add i32 %2, 7
%5 = icmp ult i32 %4, 8
br i1 %5, label %103, label %6
6: ; preds = %3
%7 = lshr i32 %4, 3
%8 = zext i32 %2 to i64
%9 = zext i32 %7 to i64
br label %10
10: ; preds = %6, %99
%11 = phi i64 [ 0, %6 ], [ %101, %99 ]
%12 = shl i64 %11, 3
%13 = trunc i64 %12 to i32
%14 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds i8, i8* %0, i64 %12
br label %16
16: ; preds = %10, %32
%17 = phi i64 [ 0, %10 ], [ %33, %32 ]
%18 = add nuw nsw i64 %17, %12
%19 = icmp ult i64 %18, %8
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = getelementptr inbounds i8, i8* %15, i64 %17
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %27
25: ; preds = %16
%26 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %25, %20
%28 = and i64 %17, 3
%29 = icmp eq i64 %28, 3
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %27, %30
%33 = add nuw nsw i64 %17, 1
%34 = icmp eq i64 %33, 8
br i1 %34, label %35, label %16
35: ; preds = %32
%36 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35, %53
%38 = phi i64 [ 0, %35 ], [ %54, %53 ]
%39 = add nuw nsw i64 %38, %12
%40 = icmp ult i64 %39, %8
br i1 %40, label %41, label %51
41: ; preds = %37
%42 = getelementptr inbounds i8, i8* %15, i64 %38
%43 = load i8, i8* %42
%44 = add i8 %43, -127
%45 = icmp ult i8 %44, -95
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %53
48: ; preds = %41
%49 = zext i8 %43 to i32
%50 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %49)
br label %53
51: ; preds = %37
%52 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %46, %48, %51
%54 = add nuw nsw i64 %38, 1
%55 = icmp eq i64 %54, 8
br i1 %55, label %56, label %37
56: ; preds = %53
%57 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%58 = getelementptr inbounds i8, i8* %1, i64 %12
br label %59
59: ; preds = %56, %75
%60 = phi i64 [ 0, %56 ], [ %76, %75 ]
%61 = add nuw nsw i64 %60, %12
%62 = icmp ult i64 %61, %8
br i1 %62, label %63, label %68
63: ; preds = %59
%64 = getelementptr inbounds i8, i8* %58, i64 %60
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %66)
br label %70
68: ; preds = %59
%69 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %70
70: ; preds = %68, %63
%71 = and i64 %60, 3
%72 = icmp eq i64 %71, 3
br i1 %72, label %73, label %75
73: ; preds = %70
%74 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %75
75: ; preds = %70, %73
%76 = add nuw nsw i64 %60, 1
%77 = icmp eq i64 %76, 8
br i1 %77, label %78, label %59
78: ; preds = %75
%79 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %80
80: ; preds = %78, %96
%81 = phi i64 [ 0, %78 ], [ %97, %96 ]
%82 = add nuw nsw i64 %81, %12
%83 = icmp ult i64 %82, %8
br i1 %83, label %84, label %94
84: ; preds = %80
%85 = getelementptr inbounds i8, i8* %58, i64 %81
%86 = load i8, i8* %85
%87 = add i8 %86, -127
%88 = icmp ult i8 %87, -95
br i1 %88, label %89, label %91
89: ; preds = %84
%90 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %96
91: ; preds = %84
%92 = zext i8 %86 to i32
%93 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %92)
br label %96
94: ; preds = %80
%95 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %96
96: ; preds = %89, %91, %94
%97 = add nuw nsw i64 %81, 1
%98 = icmp eq i64 %97, 8
br i1 %98, label %99, label %80
99: ; preds = %96
%100 = tail call i32 (i32, i8*, ...) @log_redirect(i32 8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%101 = add nuw nsw i64 %11, 1
%102 = icmp eq i64 %101, %9
br i1 %102, label %103, label %10
103: ; preds = %99, %3
ret void
}