#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 *, int);
int /*<<< orphan*/ putchar(char);
void print_byte_rows(int *ptr, int rows) {
  int i, j;
  int *my_ptr_row, *my_ptr;
  my_ptr_row = ptr;
  for (i = 0; i < rows; i++) {
    my_ptr = my_ptr_row;
    for (j = 0; j < 8; j++) {
      printf(" %02x", *my_ptr++ & 0xff);
    }
    my_ptr = my_ptr_row;
    for (j = 0; j < 8; j++) {
      if (isprint(*my_ptr))
        printf("%c", *my_ptr);
      else
        putchar('.');
      my_ptr++;
    }
  }
  my_ptr_row = my_ptr;
}


x86 assembly (clang, -O0):
<print_byte_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1220 <print_byte_rows+0xf0>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    11a4 <print_byte_rows+0x74>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%esi
and    $0xff,%esi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <print_byte_rows+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    120d <print_byte_rows+0xdd>
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     11e9 <print_byte_rows+0xb9>
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
jmp    11f3 <print_byte_rows+0xc3>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b3 <print_byte_rows+0x83>
jmp    1212 <print_byte_rows+0xe2>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <print_byte_rows+0x1e>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_byte_rows>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    133f <print_byte_rows+0x20f>
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xeb5(%rip),%r14
lea    0xeb4(%rip),%r15
jmp    1173 <print_byte_rows+0x43>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
je     133f <print_byte_rows+0x20f>
movzbl (%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movzbl 0x4(%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movzbl 0x8(%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movzbl 0xc(%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movzbl 0x10(%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movzbl 0x14(%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movzbl 0x18(%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movzbl 0x1c(%rbx),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    (%rbx),%edi
call   1050 <isprint@plt>
test   %rax,%rax
je     11f0 <print_byte_rows+0xc0>
mov    (%rbx),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
jmp    11fa <print_byte_rows+0xca>
nopw   0x0(%rax,%rax,1)
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x4(%rbx),%edi
call   1050 <isprint@plt>
test   %rax,%rax
je     1220 <print_byte_rows+0xf0>
mov    0x4(%rbx),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
jmp    122a <print_byte_rows+0xfa>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x8(%rbx),%edi
call   1050 <isprint@plt>
test   %rax,%rax
je     1250 <print_byte_rows+0x120>
mov    0x8(%rbx),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
jmp    125a <print_byte_rows+0x12a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0xc(%rbx),%edi
call   1050 <isprint@plt>
test   %rax,%rax
je     1280 <print_byte_rows+0x150>
mov    0xc(%rbx),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
jmp    128a <print_byte_rows+0x15a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x10(%rbx),%edi
call   1050 <isprint@plt>
test   %rax,%rax
je     12b0 <print_byte_rows+0x180>
mov    0x10(%rbx),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
jmp    12ba <print_byte_rows+0x18a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x14(%rbx),%edi
call   1050 <isprint@plt>
test   %rax,%rax
je     12e0 <print_byte_rows+0x1b0>
mov    0x14(%rbx),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
jmp    12ea <print_byte_rows+0x1ba>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%edi
call   1050 <isprint@plt>
test   %rax,%rax
je     1310 <print_byte_rows+0x1e0>
mov    0x18(%rbx),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
jmp    131a <print_byte_rows+0x1ea>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    0x1c(%rbx),%edi
call   1050 <isprint@plt>
test   %rax,%rax
je     1160 <print_byte_rows+0x30>
mov    0x1c(%rbx),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1173 <print_byte_rows+0x43>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c" %02x\00"
@.str.1 = [3 x i8] c"%c\00"
define void @print_byte_rows(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%9 = load i32*, i32** %3
store i32* %9, i32** %7
store i32 0, i32* %5
br label %10
10: ; preds = %51, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %54
14: ; preds = %10
%15 = load i32*, i32** %7
store i32* %15, i32** %8
store i32 0, i32* %6
br label %16
16: ; preds = %25, %14
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 8
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i32*, i32** %8
%21 = getelementptr inbounds i32, i32* %20, i32 1
store i32* %21, i32** %8
%22 = load i32, i32* %20
%23 = and i32 %22, 255
%24 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %19
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %16
28: ; preds = %16
%29 = load i32*, i32** %7
store i32* %29, i32** %8
store i32 0, i32* %6
br label %30
30: ; preds = %47, %28
%31 = load i32, i32* %6
%32 = icmp slt i32 %31, 8
br i1 %32, label %33, label %50
33: ; preds = %30
%34 = load i32*, i32** %8
%35 = load i32, i32* %34
%36 = call i64 @isprint(i32 %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %42
38: ; preds = %33
%39 = load i32*, i32** %8
%40 = load i32, i32* %39
%41 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %40)
br label %44
42: ; preds = %33
%43 = call i32 @putchar(i8 signext 46)
br label %44
44: ; preds = %42, %38
%45 = load i32*, i32** %8
%46 = getelementptr inbounds i32, i32* %45, i32 1
store i32* %46, i32** %8
br label %47
47: ; preds = %44
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
store i32 %49, i32* %6
br label %30
50: ; preds = %30
br label %51
51: ; preds = %50
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 1
store i32 %53, i32* %5
br label %10
54: ; preds = %10
%55 = load i32*, i32** %8
store i32* %55, i32** %7
ret void
}

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