#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*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ isprint(char);
int /*<<< orphan*/ stderr;
int __debug_raw_binary(char *data, int len) {
  while (len--) {
    if (isprint(*data))
      fprintf(stderr, "%c", *data);
    else
      fprintf(stderr, ".");
    data++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<__debug_raw_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     11a4 <__debug_raw_binary+0x84>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isprint@plt>
cmp    $0x0,%rax
je     117c <__debug_raw_binary+0x5c>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    1193 <__debug_raw_binary+0x73>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
lea    0xe77(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112f <__debug_raw_binary+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__debug_raw_binary>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1185 <__debug_raw_binary+0x65>
mov    %rdi,%rbx
mov    %esi,%r12d
mov    0x2ea4(%rip),%r13
lea    0xec0(%rip),%r14
lea    0xeb6(%rip),%r15
xor    %ebp,%ebp
jmp    1163 <__debug_raw_binary+0x43>
xchg   %ax,%ax
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%rbp
cmp    %ebp,%r12d
je     1185 <__debug_raw_binary+0x65>
movsbl (%rbx,%rbp,1),%edi
call   1040 <isprint@plt>
mov    0x0(%r13),%edi
test   %rax,%rax
je     1150 <__debug_raw_binary+0x30>
movsbl (%rbx,%rbp,1),%edx
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    115a <__debug_raw_binary+0x3a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c".\00"
define i32 @__debug_raw_binary(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %23, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %26
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call i64 @isprint(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i32, i32* @stderr
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %23
20: ; preds = %9
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %20, %14
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %3
br label %5
26: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c".\00"
define i32 @__debug_raw_binary(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %21, label %4
4: ; preds = %2, %18
%5 = phi i32 [ %7, %18 ], [ %1, %2 ]
%6 = phi i8* [ %19, %18 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = load i8, i8* %6
%9 = tail call i64 @isprint(i8 signext %8)
%10 = icmp eq i64 %9, 0
%11 = load i32, i32* @stderr
br i1 %10, label %16, label %12
12: ; preds = %4
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %18
16: ; preds = %4
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %12
%19 = getelementptr inbounds i8, i8* %6, i64 1
%20 = icmp eq i32 %7, 0
br i1 %20, label %21, label %4
21: ; preds = %18, %2
ret i32 0
}