#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 */
struct usbmon_packet_1 {
  int dummy;
};
struct print_cursor {
  int dummy;
};

/* Variables and functions */
scalar_t__ isprint(unsigned char const);
int /*<<< orphan*/ print_safe(struct print_cursor *, char *, ...);
void print_human_data(struct print_cursor *curs,
                      const struct usbmon_packet_1 *ep,
                      const unsigned char *data, int data_len) {
  int i, j;
  for (i = 0; i < data_len; i++) {
    print_safe(curs, "   ");
    for (j = 0; j < 16; j++) {
      if (i + j < data_len)
        print_safe(curs, "%02x ", data[i + j]);
      else
        print_safe(curs, "   ");
      if (j == 7)
        print_safe(curs, " ");
    }
    print_safe(curs, "  ");
    for (j = 0; j < 16; j++, i++) {
      if (i < data_len)
        print_safe(curs, "%c", isprint(data[i]) ? data[i] : '.');
      else
        print_safe(curs, " ");
      if (j == 7)
        print_safe(curs, " ");
    }
    print_safe(curs, "\n");
  }
  print_safe(curs, "\n");
}


x86 assembly (clang, -O0):
<print_human_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12dc <print_human_data+0x1bc>
mov    -0x8(%rbp),%rdi
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10,-0x24(%rbp)
jge    11e5 <print_human_data+0xc5>
mov    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11a4 <print_human_data+0x84>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xe6c(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
jmp    11b6 <print_human_data+0x96>
mov    -0x8(%rbp),%rdi
lea    0xe51(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
cmpl   $0x7,-0x24(%rbp)
jne    11d2 <print_human_data+0xb2>
mov    -0x8(%rbp),%rdi
lea    0xe37(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
jmp    11d7 <print_human_data+0xb7>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1163 <print_human_data+0x43>
mov    -0x8(%rbp),%rdi
lea    0xe11(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x10,-0x24(%rbp)
jge    12bc <print_human_data+0x19c>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1272 <print_human_data+0x152>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%edi
call   1040 <isprint@plt>
cmp    $0x0,%rax
je     124b <print_human_data+0x12b>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x34(%rbp)
jmp    1258 <print_human_data+0x138>
mov    $0x2e,%eax
mov    %eax,-0x34(%rbp)
jmp    1258 <print_human_data+0x138>
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xda4(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
jmp    1284 <print_human_data+0x164>
mov    -0x8(%rbp),%rdi
lea    0xd85(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
cmpl   $0x7,-0x24(%rbp)
jne    12a0 <print_human_data+0x180>
mov    -0x8(%rbp),%rdi
lea    0xd69(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
jmp    12a5 <print_human_data+0x185>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11fe <print_human_data+0xde>
mov    -0x8(%rbp),%rdi
lea    0xd46(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    113e <print_human_data+0x1e>
mov    -0x8(%rbp),%rdi
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   1030 <print_safe@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_human_data>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %ecx,0x8(%rsp)
test   %ecx,%ecx
jle    12b0 <print_human_data+0x190>
mov    %rdx,%r15
mov    0x8(%rsp),%r12d
lea    0xeb6(%rip),%r13
xor    %ebp,%ebp
mov    %rdx,0x10(%rsp)
jmp    1188 <print_human_data+0x68>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%r15
mov    %rbx,%rdi
lea    0xea0(%rip),%rsi
xor    %eax,%eax
call   1030 <print_safe@plt>
mov    0xc(%rsp),%ebp
sub    %r14d,%ebp
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jge    12b0 <print_human_data+0x190>
mov    %r15,%r14
mov    %rbx,%rdi
lea    0xe6b(%rip),%rsi
xor    %eax,%eax
call   1030 <print_safe@plt>
mov    %ebp,0xc(%rsp)
movslq %ebp,%r15
add    %r15,%r14
xor    %ebp,%ebp
jmp    11ba <print_human_data+0x9a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    $0x10,%rbp
je     1220 <print_human_data+0x100>
lea    (%r15,%rbp,1),%rax
cmp    %r12,%rax
jge    11f0 <print_human_data+0xd0>
movzbl (%r14,%rbp,1),%edx
mov    %rbx,%rdi
lea    0xe32(%rip),%rsi
xor    %eax,%eax
call   1030 <print_safe@plt>
cmp    $0x7,%rbp
jne    11b0 <print_human_data+0x90>
jmp    1207 <print_human_data+0xe7>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xe06(%rip),%rsi
xor    %eax,%eax
call   1030 <print_safe@plt>
cmp    $0x7,%rbp
jne    11b0 <print_human_data+0x90>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <print_safe@plt>
jmp    11b0 <print_human_data+0x90>
cs nopw 0x0(%rax,%rax,1)
xor    %r14d,%r14d
mov    %rbx,%rdi
lea    0xdd4(%rip),%rsi
xor    %eax,%eax
call   1030 <print_safe@plt>
mov    0x10(%rsp),%rbp
jmp    1252 <print_human_data+0x132>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r15
add    $0xffffffff,%r14d
cmp    $0xfffffff0,%r14d
je     1160 <print_human_data+0x40>
cmp    %r12,%r15
jge    1270 <print_human_data+0x150>
movzbl 0x0(%rbp,%r15,1),%edi
call   1040 <isprint@plt>
test   %rax,%rax
je     1285 <print_human_data+0x165>
movzbl 0x0(%rbp,%r15,1),%edx
jmp    128a <print_human_data+0x16a>
nop
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <print_safe@plt>
cmp    $0xfffffff9,%r14d
jne    1240 <print_human_data+0x120>
jmp    12a1 <print_human_data+0x181>
mov    $0x2e,%edx
mov    %rbx,%rdi
lea    0xd76(%rip),%rsi
xor    %eax,%eax
call   1030 <print_safe@plt>
cmp    $0xfffffff9,%r14d
jne    1240 <print_human_data+0x120>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <print_safe@plt>
jmp    1240 <print_human_data+0x120>
lea    0xd56(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <print_safe@plt>

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

LLVM IR (-O2):
%struct.print_cursor = type { i32 }
%struct.usbmon_packet_1 = type { i32 }
@.str = [4 x i8] c" \00"
@.str.1 = [6 x i8] c"%02x \00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [3 x i8] c" \00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [2 x i8] c"\0A\00"
define void @print_human_data(%struct.print_cursor* %0, %struct.usbmon_packet_1* nocapture readnone %1, i8* nocapture %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %62
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %6, %57
%9 = phi i32 [ %60, %57 ], [ 0, %6 ]
%10 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = sext i32 %9 to i64
br label %12
12: ; preds = %8, %27
%13 = phi i64 [ 0, %8 ], [ %28, %27 ]
%14 = add nsw i64 %13, %11
%15 = icmp slt i64 %14, %7
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = getelementptr inbounds i8, i8* %2, i64 %14
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %23
21: ; preds = %12
%22 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %16
%24 = icmp eq i64 %13, 7
br i1 %24, label %25, label %27
25: ; preds = %23
%26 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %23, %25
%28 = add nuw nsw i64 %13, 1
%29 = icmp eq i64 %28, 16
br i1 %29, label %30, label %12
30: ; preds = %27
%31 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %32
32: ; preds = %30, %53
%33 = phi i64 [ %11, %30 ], [ %55, %53 ]
%34 = phi i32 [ 0, %30 ], [ %54, %53 ]
%35 = icmp slt i64 %33, %7
br i1 %35, label %36, label %47
36: ; preds = %32
%37 = getelementptr inbounds i8, i8* %2, i64 %33
%38 = load i8, i8* %37
%39 = tail call i64 @isprint(i8 zeroext %38)
%40 = icmp eq i64 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %36
%42 = load i8, i8* %37
%43 = zext i8 %42 to i32
br label %44
44: ; preds = %36, %41
%45 = phi i32 [ %43, %41 ], [ 46, %36 ]
%46 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %45)
br label %49
47: ; preds = %32
%48 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %49
49: ; preds = %47, %44
%50 = icmp eq i32 %34, 7
br i1 %50, label %51, label %53
51: ; preds = %49
%52 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %53
53: ; preds = %49, %51
%54 = add nuw nsw i32 %34, 1
%55 = add nsw i64 %33, 1
%56 = icmp eq i32 %54, 16
br i1 %56, label %57, label %32
57: ; preds = %53
%58 = trunc i64 %33 to i32
%59 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%60 = add nsw i32 %58, 2
%61 = icmp slt i32 %60, %3
br i1 %61, label %8, label %62
62: ; preds = %57, %4
%63 = tail call i32 (%struct.print_cursor*, i8*, ...) @print_safe(%struct.print_cursor* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
ret void
}