#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 strlen(char const *);
int Readable(const char *cmdstr) {
  int readable;
  int i;
  char ch;
  for (i = 0; i < strlen(cmdstr); i++) {
    if (cmdstr[i] == 32 || cmdstr[i] == '\t' || cmdstr[i] == ' ') {
      continue;
    } else {
      break;
    }
  }
  if (i >= strlen(cmdstr)) {
    readable = 0;
  } else {
    ch = cmdstr[i];
    if (ch != '#' && ch != '\n' && ch != '\0' && ch != '\r') {
      readable = 1;
    } else {
      readable = 0;
    }
  }
  return readable;
}


x86 assembly (clang, -O0):
<Readable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1196 <Readable+0x86>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     117e <Readable+0x6e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
je     117e <Readable+0x6e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1183 <Readable+0x73>
jmp    1188 <Readable+0x78>
jmp    1196 <Readable+0x86>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <Readable+0x13>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jl     11be <Readable+0xae>
movl   $0x0,-0xc(%rbp)
jmp    1218 <Readable+0x108>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x23,%eax
je     120c <Readable+0xfc>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
je     120c <Readable+0xfc>
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
je     120c <Readable+0xfc>
movsbl -0x11(%rbp),%eax
cmp    $0xd,%eax
je     120c <Readable+0xfc>
movl   $0x1,-0xc(%rbp)
jmp    1213 <Readable+0x103>
movl   $0x0,-0xc(%rbp)
jmp    1218 <Readable+0x108>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Readable>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
xor    %r14d,%r14d
mov    $0x0,%ebp
test   %eax,%eax
jle    114f <Readable+0x3f>
xor    %ebp,%ebp
jmp    1143 <Readable+0x33>
nopl   0x0(%rax)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jge    114f <Readable+0x3f>
movzbl (%rbx,%rbp,1),%eax
cmp    $0x20,%al
je     1130 <Readable+0x20>
cmp    $0x9,%al
je     1130 <Readable+0x20>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
jge    1180 <Readable+0x70>
mov    %ebp,%eax
movzbl (%rbx,%rax,1),%eax
mov    $0x1,%r14d
cmp    $0x23,%rax
ja     1180 <Readable+0x70>
movabs $0x800002401,%rcx
bt     %rax,%rcx
jae    1180 <Readable+0x70>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Readable(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %2
store i32 0, i32* %4
br label %6
6: ; preds = %37, %1
%7 = load i32, i32* %4
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %40
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
br i1 %18, label %35, label %19
19: ; preds = %11
%20 = load i8*, i8** %2
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 9
br i1 %26, label %35, label %27
27: ; preds = %19
%28 = load i8*, i8** %2
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 32
br i1 %34, label %35, label %36
35: ; preds = %27, %19, %11
br label %37
36: ; preds = %27
br label %40
37: ; preds = %35
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %6
40: ; preds = %36, %6
%41 = load i32, i32* %4
%42 = load i8*, i8** %2
%43 = call i32 @strlen(i8* %42)
%44 = icmp sge i32 %41, %43
br i1 %44, label %45, label %46
45: ; preds = %40
store i32 0, i32* %3
br label %70
46: ; preds = %40
%47 = load i8*, i8** %2
%48 = load i32, i32* %4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %47, i64 %49
%51 = load i8, i8* %50
store i8 %51, i8* %5
%52 = load i8, i8* %5
%53 = sext i8 %52 to i32
%54 = icmp ne i32 %53, 35
br i1 %54, label %55, label %68
55: ; preds = %46
%56 = load i8, i8* %5
%57 = sext i8 %56 to i32
%58 = icmp ne i32 %57, 10
br i1 %58, label %59, label %68
59: ; preds = %55
%60 = load i8, i8* %5
%61 = sext i8 %60 to i32
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %68
63: ; preds = %59
%64 = load i8, i8* %5
%65 = sext i8 %64 to i32
%66 = icmp ne i32 %65, 13
br i1 %66, label %67, label %68
67: ; preds = %63
store i32 1, i32* %3
br label %69
68: ; preds = %63, %59, %55, %46
store i32 0, i32* %3
br label %69
69: ; preds = %68, %67
br label %70
70: ; preds = %69, %45
%71 = load i32, i32* %3
ret i32 %71
}

LLVM IR (-O2):
define i32 @Readable(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %16
4: ; preds = %1, %8
%5 = phi i64 [ %9, %8 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %13 [
i8 32, label %8
i8 9, label %8
]
8: ; preds = %4, %4
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %8
%14 = phi i64 [ %9, %8 ], [ %5, %4 ]
%15 = trunc i64 %14 to i32
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ 0, %1 ], [ %15, %13 ]
%18 = tail call i32 @strlen(i8* %0)
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %25
20: ; preds = %16
%21 = zext i32 %17 to i64
%22 = getelementptr inbounds i8, i8* %0, i64 %21
%23 = load i8, i8* %22
switch i8 %23, label %25 [
i8 35, label %24
i8 13, label %24
i8 10, label %24
i8 0, label %24
]
24: ; preds = %20, %20, %20, %20
br label %25
25: ; preds = %20, %16, %24
%26 = phi i32 [ 0, %24 ], [ 0, %16 ], [ 1, %20 ]
ret i32 %26
}