#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__ ft_isalnum(int);
int ft_isprint(int c) {
  char *characters;
  characters = " !\"#$%&\'()*+,-./:;<=>\?@[\\]^_`{|}~";
  if (ft_isalnum(c))
    return (1);
  while (*characters && *characters != c)
    ++characters;
  if (*characters == '\0')
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_isalnum@plt>
cmp    $0x0,%rax
je     1144 <ft_isprint+0x34>
movl   $0x1,-0x4(%rbp)
jmp    11b2 <ft_isprint+0xa2>
jmp    1149 <ft_isprint+0x39>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     116e <ft_isprint+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x8(%rbp),%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    117e <ft_isprint+0x6e>
jmp    118f <ft_isprint+0x7f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1149 <ft_isprint+0x39>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11ab <ft_isprint+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    11b2 <ft_isprint+0xa2>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <ft_isprint+0x17>
pop    %rbx
ret
lea    0xed2(%rip),%rax
xchg   %ax,%ax
movsbl (%rax),%ecx
test   %ecx,%ecx
je     113f <ft_isprint+0x2f>
add    $0x1,%rax
cmp    %ebx,%ecx
jne    1130 <ft_isprint+0x20>
xor    %eax,%eax
test   %cl,%cl
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c" !\22#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\00"
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i32, i32* %3
%6 = call i64 @ft_isalnum(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %33
9: ; preds = %1
br label %10
10: ; preds = %23, %9
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i32, i32* %3
%20 = icmp ne i32 %18, %19
br label %21
21: ; preds = %15, %10
%22 = phi i1 [ false, %10 ], [ %20, %15 ]
br i1 %22, label %23, label %26
23: ; preds = %21
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %10
26: ; preds = %21
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %26
store i32 0, i32* %2
br label %33
32: ; preds = %26
store i32 1, i32* %2
br label %33
33: ; preds = %32, %31, %8
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
@.str = [34 x i8] c" !\22#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\00"
define i32 @ft_isprint(i32 %0) {
%2 = tail call i64 @ft_isalnum(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %15
4: ; preds = %1, %4
%5 = phi i8* [ %11, %4 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), %1 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %0
%10 = or i1 %7, %9
%11 = getelementptr inbounds i8, i8* %5, i64 1
br i1 %10, label %12, label %4
12: ; preds = %4
%13 = xor i1 %7, true
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %12, %1
%16 = phi i32 [ 1, %1 ], [ %14, %12 ]
ret i32 %16
}