#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__ strlen(char const *);
int Readable(const char *cmdstr) {
  int readable;
  int i;
  char ch;
  for (i = 0; i < (int)(strlen(cmdstr)); i++) {
    if (cmdstr[i] == 32 || cmdstr[i] == '\t') {
      continue;
    } else {
      break;
    }
  }
  if (i >= (int)(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    %rax,%rcx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1182 <Readable+0x72>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     116a <Readable+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
jne    116f <Readable+0x5f>
jmp    1174 <Readable+0x64>
jmp    1182 <Readable+0x72>
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    %rax,%rcx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jl     11ab <Readable+0x9b>
movl   $0x0,-0xc(%rbp)
jmp    1205 <Readable+0xf5>
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     11f9 <Readable+0xe9>
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
je     11f9 <Readable+0xe9>
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
je     11f9 <Readable+0xe9>
movsbl -0x11(%rbp),%eax
cmp    $0xd,%eax
je     11f9 <Readable+0xe9>
movl   $0x1,-0xc(%rbp)
jmp    1200 <Readable+0xf0>
movl   $0x0,-0xc(%rbp)
jmp    1205 <Readable+0xf5>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Readable>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1166 <Readable+0x56>
mov    %eax,%eax
xor    %ecx,%ecx
jmp    1139 <Readable+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rcx
cmp    %rcx,%rax
je     1166 <Readable+0x56>
movzbl (%rbx,%rcx,1),%edx
cmp    $0x20,%dl
je     1130 <Readable+0x20>
cmp    $0x9,%dl
je     1130 <Readable+0x20>
movzbl (%rbx,%rcx,1),%ecx
mov    $0x1,%eax
cmp    $0x23,%rcx
ja     1168 <Readable+0x58>
movabs $0x800002401,%rdx
bt     %rcx,%rdx
jae    1168 <Readable+0x58>
xor    %eax,%eax
pop    %rbx
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 = %30, %1
%7 = load i32, i32* %4
%8 = load i8*, i8** %2
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
%11 = icmp slt i32 %7, %10
br i1 %11, label %12, label %33
12: ; preds = %6
%13 = load i8*, i8** %2
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 32
br i1 %19, label %28, label %20
20: ; preds = %12
%21 = load i8*, i8** %2
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 9
br i1 %27, label %28, label %29
28: ; preds = %20, %12
br label %30
29: ; preds = %20
br label %33
30: ; preds = %28
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %6
33: ; preds = %29, %6
%34 = load i32, i32* %4
%35 = load i8*, i8** %2
%36 = call i64 @strlen(i8* %35)
%37 = trunc i64 %36 to i32
%38 = icmp sge i32 %34, %37
br i1 %38, label %39, label %40
39: ; preds = %33
store i32 0, i32* %3
br label %64
40: ; preds = %33
%41 = load i8*, i8** %2
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8, i8* %41, i64 %43
%45 = load i8, i8* %44
store i8 %45, i8* %5
%46 = load i8, i8* %5
%47 = sext i8 %46 to i32
%48 = icmp ne i32 %47, 35
br i1 %48, label %49, label %62
49: ; preds = %40
%50 = load i8, i8* %5
%51 = sext i8 %50 to i32
%52 = icmp ne i32 %51, 10
br i1 %52, label %53, label %62
53: ; preds = %49
%54 = load i8, i8* %5
%55 = sext i8 %54 to i32
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %62
57: ; preds = %53
%58 = load i8, i8* %5
%59 = sext i8 %58 to i32
%60 = icmp ne i32 %59, 13
br i1 %60, label %61, label %62
61: ; preds = %57
store i32 1, i32* %3
br label %63
62: ; preds = %57, %53, %49, %40
store i32 0, i32* %3
br label %63
63: ; preds = %62, %61
br label %64
64: ; preds = %63, %39
%65 = load i32, i32* %3
ret i32 %65
}

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