#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 */
scalar_t__ isprint(int);
int /*<<< orphan*/ printf(char *, ...);
void dump_row(long count, int numinrow, int *chs) {
  int i;
  printf("%08lX:", count - numinrow);
  if (numinrow > 0) {
    for (i = 0; i < numinrow; i++) {
      if (i == 8)
        printf(" :");
      printf(" %02X", chs[i]);
    }
    for (i = numinrow; i < 16; i++) {
      if (i == 8)
        printf(" :");
      printf("   ");
    }
    printf("  ");
    for (i = 0; i < numinrow; i++) {
      if (isprint(chs[i]))
        printf("%c", chs[i]);
      else
        printf(".");
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dump_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
sub    %rax,%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jle    126b <dump_row+0x14b>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a8 <dump_row+0x88>
cmpl   $0x8,-0x1c(%rbp)
jne    1181 <dump_row+0x61>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115d <dump_row+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    11ec <dump_row+0xcc>
cmpl   $0x8,-0x1c(%rbp)
jne    11d0 <dump_row+0xb0>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ae <dump_row+0x8e>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1266 <dump_row+0x146>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <isprint@plt>
cmp    $0x0,%rax
je     1245 <dump_row+0x125>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1253 <dump_row+0x133>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1258 <dump_row+0x138>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1201 <dump_row+0xe1>
jmp    126b <dump_row+0x14b>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_row>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rsi
movslq %r14d,%rbp
sub    %rbp,%rsi
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jle    1235 <dump_row+0x105>
mov    %r14d,%r13d
lea    0xe9d(%rip),%r15
lea    0xe99(%rip),%r12
xor    %ebp,%ebp
jmp    1196 <dump_row+0x66>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%rbp,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
je     11a8 <dump_row+0x78>
cmp    $0x8,%rbp
jne    1180 <dump_row+0x50>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1180 <dump_row+0x50>
cmp    $0xf,%r14d
jg     11f0 <dump_row+0xc0>
mov    $0x10,%ebp
sub    %r14d,%ebp
lea    0xe4a(%rip),%r14
lea    0xe4c(%rip),%r15
jmp    11df <dump_row+0xaf>
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
je     11f0 <dump_row+0xc0>
cmp    $0x8,%ebp
jne    11d0 <dump_row+0xa0>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11d0 <dump_row+0xa0>
lea    0xe1a(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1221 <dump_row+0xf1>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,4),%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
je     1235 <dump_row+0x105>
mov    (%rbx,%rbp,4),%edi
call   1050 <isprint@plt>
test   %rax,%rax
jne    1210 <dump_row+0xe0>
mov    $0x2e,%edi
jmp    1213 <dump_row+0xe3>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%08lX:\00"
@.str.1 = [3 x i8] c" :\00"
@.str.2 = [6 x i8] c" %02X\00"
@.str.3 = [4 x i8] c" \00"
@.str.4 = [3 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"
define void @dump_row(i64 %0, i32 %1, i32* %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i64, i64* %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = sub nsw i64 %8, %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %78
15: ; preds = %3
store i32 0, i32* %7
br label %16
16: ; preds = %32, %15
%17 = load i32, i32* %7
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %35
20: ; preds = %16
%21 = load i32, i32* %7
%22 = icmp eq i32 %21, 8
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
%26 = load i32*, i32** %6
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %25
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %16
35: ; preds = %16
%36 = load i32, i32* %5
store i32 %36, i32* %7
br label %37
37: ; preds = %47, %35
%38 = load i32, i32* %7
%39 = icmp slt i32 %38, 16
br i1 %39, label %40, label %50
40: ; preds = %37
%41 = load i32, i32* %7
%42 = icmp eq i32 %41, 8
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %45
45: ; preds = %43, %40
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %37
50: ; preds = %37
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %7
br label %52
52: ; preds = %74, %50
%53 = load i32, i32* %7
%54 = load i32, i32* %5
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %77
56: ; preds = %52
%57 = load i32*, i32** %6
%58 = load i32, i32* %7
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %57, i64 %59
%61 = load i32, i32* %60
%62 = call i64 @isprint(i32 %61)
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %71
64: ; preds = %56
%65 = load i32*, i32** %6
%66 = load i32, i32* %7
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i32, i32* %65, i64 %67
%69 = load i32, i32* %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %69)
br label %73
71: ; preds = %56
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %73
73: ; preds = %71, %64
br label %74
74: ; preds = %73
%75 = load i32, i32* %7
%76 = add nsw i32 %75, 1
store i32 %76, i32* %7
br label %52
77: ; preds = %52
br label %78
78: ; preds = %77, %3
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%08lX:\00"
@.str.1 = [3 x i8] c" :\00"
@.str.2 = [6 x i8] c" %02X\00"
@.str.3 = [4 x i8] c" \00"
@.str.4 = [3 x i8] c" \00"
define void @dump_row(i64 %0, i32 %1, i32* nocapture %2) {
%4 = sext i32 %1 to i64
%5 = sub nsw i64 %0, %4
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %47
8: ; preds = %3
%9 = zext i32 %1 to i64
br label %12
10: ; preds = %17
%11 = icmp slt i32 %1, 16
br i1 %11, label %23, label %32
12: ; preds = %8, %17
%13 = phi i64 [ 0, %8 ], [ %21, %17 ]
%14 = icmp eq i64 %13, 8
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
%18 = getelementptr inbounds i32, i32* %2, i64 %13
%19 = load i32, i32* %18
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%21 = add nuw nsw i64 %13, 1
%22 = icmp eq i64 %21, %9
br i1 %22, label %10, label %12
23: ; preds = %10, %28
%24 = phi i32 [ %30, %28 ], [ %1, %10 ]
%25 = icmp eq i32 %24, 8
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%30 = add i32 %24, 1
%31 = icmp eq i32 %30, 16
br i1 %31, label %32, label %23
32: ; preds = %28, %10
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %34
34: ; preds = %32, %42
%35 = phi i64 [ 0, %32 ], [ %45, %42 ]
%36 = getelementptr inbounds i32, i32* %2, i64 %35
%37 = load i32, i32* %36
%38 = tail call i64 @isprint(i32 %37)
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %34
%41 = load i32, i32* %36
br label %42
42: ; preds = %34, %40
%43 = phi i32 [ %41, %40 ], [ 46, %34 ]
%44 = tail call i32 @putchar(i32 %43)
%45 = add nuw nsw i64 %35, 1
%46 = icmp eq i64 %45, %9
br i1 %46, label %47, label %34
47: ; preds = %42, %3
%48 = tail call i32 @putchar(i32 10)
ret void
}