#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*/ ACL_ISASCII(int);
int /*<<< orphan*/ ACL_ISPRINT(int);
int allprint(const char *string) {
  const char *cp;
  int ch;
  if (*string == 0)
    return (0);
  for (cp = string; (ch = *(const unsigned char *)cp) != 0; cp++)
    if (!ACL_ISASCII(ch) || !ACL_ISPRINT(ch))
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<allprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1148 <allprint+0x28>
movl   $0x0,-0x4(%rbp)
jmp    11ae <allprint+0x8e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     11a7 <allprint+0x87>
mov    -0x1c(%rbp),%edi
call   1030 <ACL_ISASCII@plt>
cmp    $0x0,%eax
je     1185 <allprint+0x65>
mov    -0x1c(%rbp),%edi
call   1040 <ACL_ISPRINT@plt>
cmp    $0x0,%eax
jne    1191 <allprint+0x71>
movl   $0x0,-0x4(%rbp)
jmp    11ae <allprint+0x8e>
jmp    1196 <allprint+0x76>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1150 <allprint+0x30>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allprint>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
xor    %r14d,%r14d
test   %al,%al
je     116a <allprint+0x4a>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %al,%ebp
mov    %ebp,%edi
call   1030 <ACL_ISASCII@plt>
test   %eax,%eax
je     116a <allprint+0x4a>
mov    %ebp,%edi
call   1040 <ACL_ISPRINT@plt>
test   %eax,%eax
je     116a <allprint+0x4a>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <allprint+0x20>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @allprint(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %32
11: ; preds = %1
%12 = load i8*, i8** %3
store i8* %12, i8** %4
br label %13
13: ; preds = %28, %11
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
store i32 %16, i32* %5
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %31
18: ; preds = %13
%19 = load i32, i32* %5
%20 = call i32 @ACL_ISASCII(i32 %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i32, i32* %5
%24 = call i32 @ACL_ISPRINT(i32 %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %22, %18
store i32 0, i32* %2
br label %32
27: ; preds = %22
br label %28
28: ; preds = %27
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %4
br label %13
31: ; preds = %13
store i32 1, i32* %2
br label %32
32: ; preds = %31, %26, %10
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @allprint(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %13
%5 = phi i8 [ %15, %13 ], [ %2, %1 ]
%6 = phi i8* [ %14, %13 ], [ %0, %1 ]
%7 = zext i8 %5 to i32
%8 = tail call i32 @ACL_ISASCII(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %4
%11 = tail call i32 @ACL_ISPRINT(i32 %7)
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %10, %4, %13, %1
%18 = phi i32 [ 0, %1 ], [ 0, %10 ], [ 0, %4 ], [ 1, %13 ]
ret i32 %18
}