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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(unsigned char *);
scalar_t__ isprint(unsigned char);
scalar_t__ malloc(int);
int hex_dump(FILE *input, FILE *output, size_t file_size, int columns) {
  int i, nvals;
  size_t tsize;
  unsigned char ascii[2 * columns];
  unsigned char *buffer;
  nvals = 0;
  tsize = 0;
  while (tsize < file_size) {
    buffer = (unsigned char *)malloc((2 * columns) * sizeof(unsigned char));
    if (buffer == NULL) {
      return -1;
    }
    fread(buffer, 1, 2 * columns, input);
    fprintf(output, "%08x  ", nvals);
    for (i = 0; i < 2 * columns; i++) {
      ascii[i] = buffer[i];
      if (tsize >= file_size) {
        fprintf(output, "   ");
      } else {
        fprintf(output, "%02x ", buffer[i]);
        nvals++;
      }
      if (i == (columns - 1)) {
        fprintf(output, " ");
      }
      tsize++;
    }
    free(buffer);
    fprintf(output, " ");
    fprintf(output, "|");
    for (i = 0; i < 2 * columns; i++) {
      if ((tsize - 2 * columns + i + 1) > file_size) {
        break;
      }
      if (isprint(ascii[i])) {
        fprintf(output, "%c", ascii[i]);
      } else {
        fprintf(output, ".");
      }
    }
    fprintf(output, "|");
    fprintf(output, "\n");
  }
  fprintf(output, "%08x\n", nvals);
  return 0;
}


x86 assembly (clang, -O0):
<hex_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    13c0 <hex_dump+0x270>
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    11e1 <hex_dump+0x91>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    13e3 <hex_dump+0x293>
mov    -0x50(%rbp),%rdi
mov    -0x24(%rbp),%edx
shl    $0x1,%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xdf9(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    12c5 <hex_dump+0x175>
mov    -0x60(%rbp),%rax
mov    -0x50(%rbp),%rcx
movslq -0x28(%rbp),%rdx
mov    (%rcx,%rdx,1),%dl
movslq -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x38(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     1261 <hex_dump+0x111>
mov    -0x18(%rbp),%rdi
lea    0xdb2(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1288 <hex_dump+0x138>
mov    -0x18(%rbp),%rdi
mov    -0x50(%rbp),%rax
movslq -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xd93(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    12ab <hex_dump+0x15b>
mov    -0x18(%rbp),%rdi
lea    0xd65(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1215 <hex_dump+0xc5>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
lea    0xd30(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    1397 <hex_dump+0x247>
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
movslq -0x28(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
cmp    -0x20(%rbp),%rax
jbe    1334 <hex_dump+0x1e4>
jmp    1397 <hex_dump+0x247>
mov    -0x60(%rbp),%rax
movslq -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1070 <isprint@plt>
cmp    $0x0,%rax
je     1372 <hex_dump+0x222>
mov    -0x60(%rbp),%rax
mov    -0x18(%rbp),%rdi
movslq -0x28(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xcad(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1384 <hex_dump+0x234>
mov    -0x18(%rbp),%rdi
lea    0xc99(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1389 <hex_dump+0x239>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12f9 <hex_dump+0x1a9>
mov    -0x18(%rbp),%rdi
lea    0xc6f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xc68(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    119e <hex_dump+0x4e>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xc4a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_dump>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %ecx,%r13d
mov    %rsi,%r14
mov    %rdi,-0x68(%rbp)
lea    0x0(%r13,%r13,1),%ebx
mov    %rsp,%rcx
lea    0xf(%rbx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
movl   $0x0,-0x2c(%rbp)
mov    %rdx,-0x40(%rbp)
test   %rdx,%rdx
je     1371 <hex_dump+0x201>
movslq %ebx,%rax
lea    -0x1(%r13),%ecx
mov    %rcx,-0x70(%rbp)
cmp    $0x2,%eax
mov    $0x1,%r12d
cmovge %ebx,%r12d
mov    $0x1,%ecx
sub    %rax,%rcx
mov    %rcx,-0x50(%rbp)
movl   $0x0,-0x2c(%rbp)
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
mov    %r13,-0x60(%rbp)
mov    %rbx,-0x58(%rbp)
jmp    1230 <hex_dump+0xc0>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x7c,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
mov    $0xa,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
mov    -0x38(%rbp),%rax
cmp    -0x40(%rbp),%rax
mov    -0x60(%rbp),%r13
mov    -0x58(%rbp),%rbx
jae    1371 <hex_dump+0x201>
mov    %ebx,%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     1389 <hex_dump+0x219>
mov    %rax,%r15
mov    %rax,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
mov    -0x68(%rbp),%rcx
call   1040 <fread@plt>
mov    %r14,%rdi
lea    0xda0(%rip),%rsi
mov    -0x2c(%rbp),%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %r13d,%r13d
jle    12f4 <hex_dump+0x184>
xor    %ebx,%ebx
jmp    1289 <hex_dump+0x119>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %rbx,%r12
je     12f0 <hex_dump+0x180>
mov    -0x38(%rbp),%rax
add    %rbx,%rax
movzbl (%r15,%rbx,1),%edx
mov    -0x48(%rbp),%rcx
mov    %dl,(%rcx,%rbx,1)
cmp    -0x40(%rbp),%rax
jae    12c0 <hex_dump+0x150>
mov    %r14,%rdi
lea    0xd5f(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
addl   $0x1,-0x2c(%rbp)
cmp    %rbx,-0x70(%rbp)
jne    1280 <hex_dump+0x110>
jmp    12df <hex_dump+0x16f>
nop
mov    $0x3,%esi
mov    $0x1,%edx
lea    0xd36(%rip),%rdi
mov    %r14,%rcx
call   1090 <fwrite@plt>
cmp    %rbx,-0x70(%rbp)
jne    1280 <hex_dump+0x110>
mov    $0x20,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
jmp    1280 <hex_dump+0x110>
xchg   %ax,%ax
add    %rbx,-0x38(%rbp)
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x20,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
mov    $0x7c,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
test   %r13d,%r13d
jle    1200 <hex_dump+0x90>
mov    -0x50(%rbp),%rax
mov    -0x38(%rbp),%rcx
lea    (%rax,%rcx,1),%r15
xor    %r13d,%r13d
xchg   %ax,%ax
lea    (%r15,%r13,1),%rax
cmp    -0x40(%rbp),%rax
ja     1200 <hex_dump+0x90>
mov    -0x48(%rbp),%rax
movzbl (%rax,%r13,1),%ebx
mov    %ebx,%edi
call   1080 <isprint@plt>
test   %rax,%rax
mov    $0x2e,%eax
cmove  %eax,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <fputc@plt>
add    $0x1,%r13
cmp    %r13,%r12
jne    1330 <hex_dump+0x1c0>
jmp    1200 <hex_dump+0x90>
lea    0xc99(%rip),%rsi
mov    %r14,%rdi
mov    -0x2c(%rbp),%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %eax,%eax
jmp    138e <hex_dump+0x21e>
mov    $0xffffffff,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%08x \00"
@.str.1 = [4 x i8] c" \00"
@.str.2 = [6 x i8] c"%02x \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".\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [6 x i8] c"%08x\0A\00"
define i32 @hex_dump(i32* %0, i32* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i8*
%16 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
%17 = load i32, i32* %9
%18 = mul nsw i32 2, %17
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %13
%21 = alloca i8, i64 %19
store i64 %19, i64* %14
store i32 0, i32* %11
store i64 0, i64* %12
br label %22
22: ; preds = %138, %4
%23 = load i64, i64* %12
%24 = load i64, i64* %8
%25 = icmp ult i64 %23, %24
br i1 %25, label %26, label %143
26: ; preds = %22
%27 = load i32, i32* %9
%28 = mul nsw i32 2, %27
%29 = sext i32 %28 to i64
%30 = mul i64 %29, 1
%31 = trunc i64 %30 to i32
%32 = call i64 @malloc(i32 %31)
%33 = inttoptr i64 %32 to i8*
store i8* %33, i8** %15
%34 = load i8*, i8** %15
%35 = icmp eq i8* %34, null
br i1 %35, label %36, label %37
36: ; preds = %26
store i32 -1, i32* %5
store i32 1, i32* %16
br label %147
37: ; preds = %26
%38 = load i8*, i8** %15
%39 = load i32, i32* %9
%40 = mul nsw i32 2, %39
%41 = load i32*, i32** %6
%42 = call i32 @fread(i8* %38, i32 1, i32 %40, i32* %41)
%43 = load i32*, i32** %7
%44 = load i32, i32* %11
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %44)
store i32 0, i32* %10
br label %46
46: ; preds = %88, %37
%47 = load i32, i32* %10
%48 = load i32, i32* %9
%49 = mul nsw i32 2, %48
%50 = icmp slt i32 %47, %49
br i1 %50, label %51, label %91
51: ; preds = %46
%52 = load i8*, i8** %15
%53 = load i32, i32* %10
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
%56 = load i8, i8* %55
%57 = load i32, i32* %10
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %21, i64 %58
store i8 %56, i8* %59
%60 = load i64, i64* %12
%61 = load i64, i64* %8
%62 = icmp uge i64 %60, %61
br i1 %62, label %63, label %66
63: ; preds = %51
%64 = load i32*, i32** %7
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %77
66: ; preds = %51
%67 = load i32*, i32** %7
%68 = load i8*, i8** %15
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %67, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %73)
%75 = load i32, i32* %11
%76 = add nsw i32 %75, 1
store i32 %76, i32* %11
br label %77
77: ; preds = %66, %63
%78 = load i32, i32* %10
%79 = load i32, i32* %9
%80 = sub nsw i32 %79, 1
%81 = icmp eq i32 %78, %80
br i1 %81, label %82, label %85
82: ; preds = %77
%83 = load i32*, i32** %7
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %85
85: ; preds = %82, %77
%86 = load i64, i64* %12
%87 = add i64 %86, 1
store i64 %87, i64* %12
br label %88
88: ; preds = %85
%89 = load i32, i32* %10
%90 = add nsw i32 %89, 1
store i32 %90, i32* %10
br label %46
91: ; preds = %46
%92 = load i8*, i8** %15
%93 = call i32 @free(i8* %92)
%94 = load i32*, i32** %7
%95 = call i32 (i32*, i8*, ...) @fprintf(i32* %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%96 = load i32*, i32** %7
%97 = call i32 (i32*, i8*, ...) @fprintf(i32* %96, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %10
br label %98
98: ; preds = %135, %91
%99 = load i32, i32* %10
%100 = load i32, i32* %9
%101 = mul nsw i32 2, %100
%102 = icmp slt i32 %99, %101
br i1 %102, label %103, label %138
103: ; preds = %98
%104 = load i64, i64* %12
%105 = load i32, i32* %9
%106 = mul nsw i32 2, %105
%107 = sext i32 %106 to i64
%108 = sub i64 %104, %107
%109 = load i32, i32* %10
%110 = sext i32 %109 to i64
%111 = add i64 %108, %110
%112 = add i64 %111, 1
%113 = load i64, i64* %8
%114 = icmp ugt i64 %112, %113
br i1 %114, label %115, label %116
115: ; preds = %103
br label %138
116: ; preds = %103
%117 = load i32, i32* %10
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8, i8* %21, i64 %118
%120 = load i8, i8* %119
%121 = call i64 @isprint(i8 zeroext %120)
%122 = icmp ne i64 %121, 0
br i1 %122, label %123, label %131
123: ; preds = %116
%124 = load i32*, i32** %7
%125 = load i32, i32* %10
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds i8, i8* %21, i64 %126
%128 = load i8, i8* %127
%129 = zext i8 %128 to i32
%130 = call i32 (i32*, i8*, ...) @fprintf(i32* %124, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %129)
br label %134
131: ; preds = %116
%132 = load i32*, i32** %7
%133 = call i32 (i32*, i8*, ...) @fprintf(i32* %132, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %134
134: ; preds = %131, %123
br label %135
135: ; preds = %134
%136 = load i32, i32* %10
%137 = add nsw i32 %136, 1
store i32 %137, i32* %10
br label %98
138: ; preds = %115, %98
%139 = load i32*, i32** %7
%140 = call i32 (i32*, i8*, ...) @fprintf(i32* %139, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%141 = load i32*, i32** %7
%142 = call i32 (i32*, i8*, ...) @fprintf(i32* %141, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %22
143: ; preds = %22
%144 = load i32*, i32** %7
%145 = load i32, i32* %11
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %144, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %145)
store i32 0, i32* %5
store i32 1, i32* %16
br label %147
147: ; preds = %143, %36
%148 = load i8*, i8** %13
%149 = load i32, i32* %5
ret i32 %149
}

LLVM IR (-O2):
@.str = [7 x i8] c"%08x \00"
@.str.1 = [4 x i8] c" \00"
@.str.2 = [6 x i8] c"%02x \00"
@.str.8 = [6 x i8] c"%08x\0A\00"
define i32 @hex_dump(i32* nocapture %0, i32* nocapture %1, i64 %2, i32 %3) {
%5 = shl i32 %3, 1
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = icmp eq i64 %2, 0
br i1 %8, label %76, label %9
9: ; preds = %4
%10 = sext i32 %5 to i64
%11 = icmp sgt i32 %3, 0
%12 = add nsw i32 %3, -1
%13 = sub nsw i64 1, %10
%14 = zext i32 %12 to i64
%15 = call i32 @llvm.smax.i32(i32 %5, i32 1)
%16 = zext i32 %15 to i64
%17 = zext i32 %15 to i64
br label %18
18: ; preds = %9, %72
%19 = phi i32 [ 0, %9 ], [ %52, %72 ]
%20 = phi i64 [ 0, %9 ], [ %51, %72 ]
%21 = tail call i64 @malloc(i32 %5)
%22 = inttoptr i64 %21 to i8*
%23 = icmp eq i64 %21, 0
br i1 %23, label %79, label %24
24: ; preds = %18
%25 = tail call i32 @fread(i8* %22, i32 1, i32 %5, i32* %0)
%26 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %19)
br i1 %11, label %27, label %50
27: ; preds = %24, %46
%28 = phi i64 [ %48, %46 ], [ 0, %24 ]
%29 = phi i32 [ %42, %46 ], [ %19, %24 ]
%30 = phi i64 [ %47, %46 ], [ %20, %24 ]
%31 = getelementptr inbounds i8, i8* %22, i64 %28
%32 = load i8, i8* %31
%33 = getelementptr inbounds i8, i8* %7, i64 %28
store i8 %32, i8* %33
%34 = icmp ult i64 %30, %2
br i1 %34, label %37, label %35
35: ; preds = %27
%36 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 3, i64 1, i32* %1)
br label %41
37: ; preds = %27
%38 = zext i8 %32 to i32
%39 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = add nsw i32 %29, 1
br label %41
41: ; preds = %37, %35
%42 = phi i32 [ %29, %35 ], [ %40, %37 ]
%43 = icmp eq i64 %28, %14
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = tail call i32 @fputc(i32 32, i32* %1)
br label %46
46: ; preds = %44, %41
%47 = add i64 %30, 1
%48 = add nuw nsw i64 %28, 1
%49 = icmp eq i64 %48, %16
br i1 %49, label %50, label %27
50: ; preds = %46, %24
%51 = phi i64 [ %20, %24 ], [ %47, %46 ]
%52 = phi i32 [ %19, %24 ], [ %42, %46 ]
%53 = tail call i32 @free(i8* %22)
%54 = tail call i32 @fputc(i32 32, i32* %1)
%55 = tail call i32 @fputc(i32 124, i32* %1)
br i1 %11, label %56, label %72
56: ; preds = %50
%57 = add i64 %13, %51
br label %58
58: ; preds = %56, %62
%59 = phi i64 [ 0, %56 ], [ %70, %62 ]
%60 = add i64 %57, %59
%61 = icmp ugt i64 %60, %2
br i1 %61, label %72, label %62
62: ; preds = %58
%63 = getelementptr inbounds i8, i8* %7, i64 %59
%64 = load i8, i8* %63
%65 = tail call i64 @isprint(i8 zeroext %64)
%66 = icmp eq i64 %65, 0
%67 = zext i8 %64 to i32
%68 = select i1 %66, i32 46, i32 %67
%69 = tail call i32 @fputc(i32 %68, i32* %1)
%70 = add nuw nsw i64 %59, 1
%71 = icmp eq i64 %70, %17
br i1 %71, label %72, label %58
72: ; preds = %62, %58, %50
%73 = tail call i32 @fputc(i32 124, i32* %1)
%74 = tail call i32 @fputc(i32 10, i32* %1)
%75 = icmp ult i64 %51, %2
br i1 %75, label %18, label %76
76: ; preds = %72, %4
%77 = phi i32 [ 0, %4 ], [ %52, %72 ]
%78 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i32 %77)
br label %79
79: ; preds = %18, %76
%80 = phi i32 [ 0, %76 ], [ -1, %18 ]
ret i32 %80
}