#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 isgraph(char const);
int string_is_ascii_graphable(const char *string) {
  int i = 0, printable;
  if (!string)
    return (0);
  while (string[i]) {
    printable = isgraph(string[i]);
    if (!printable)
      return (0);
    i++;
  }
  return (!(0));
}


x86 assembly (clang, -O0):
<string_is_ascii_graphable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <string_is_ascii_graphable+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1190 <string_is_ascii_graphable+0x80>
jmp    113f <string_is_ascii_graphable+0x2f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1189 <string_is_ascii_graphable+0x79>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isgraph@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    117b <string_is_ascii_graphable+0x6b>
movl   $0x0,-0x4(%rbp)
jmp    1190 <string_is_ascii_graphable+0x80>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <string_is_ascii_graphable+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_is_ascii_graphable>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
test   %rdi,%rdi
je     114c <string_is_ascii_graphable+0x3c>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1147 <string_is_ascii_graphable+0x37>
add    $0x1,%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isgraph@plt>
test   %eax,%eax
je     114c <string_is_ascii_graphable+0x3c>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <string_is_ascii_graphable+0x20>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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