#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*/ assert(int /*<<< orphan*/);
int srt_is_end_of_block(const char *str) {
  int ret = 1;
  unsigned int i;
  assert(str != NULL);
  for (i = 0; str[i] != '\0' && ret; i++) {
    switch (str[i]) {
    case ' ':
    case '\t':
    case '\n':
      break;
    default:
      ret = 0;
      break;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<srt_is_end_of_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     115f <srt_is_end_of_block+0x4f>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <srt_is_end_of_block+0x5f>
jmp    11be <srt_is_end_of_block+0xae>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     119f <srt_is_end_of_block+0x8f>
jmp    118e <srt_is_end_of_block+0x7e>
mov    -0x18(%rbp),%eax
sub    $0x20,%eax
jne    11a4 <srt_is_end_of_block+0x94>
jmp    119f <srt_is_end_of_block+0x8f>
jmp    11ab <srt_is_end_of_block+0x9b>
movl   $0x0,-0xc(%rbp)
jmp    11b0 <srt_is_end_of_block+0xa0>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113c <srt_is_end_of_block+0x2c>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srt_is_end_of_block>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%al
test   %al,%al
je     115d <srt_is_end_of_block+0x4d>
mov    $0x1,%ecx
movabs $0x100000600,%rdx
nopw   0x0(%rax,%rax,1)
movsbl %al,%esi
xor    %eax,%eax
cmp    $0x20,%esi
ja     1162 <srt_is_end_of_block+0x52>
bt     %rsi,%rdx
jae    1162 <srt_is_end_of_block+0x52>
mov    %ecx,%eax
movzbl (%rbx,%rax,1),%eax
add    $0x1,%ecx
test   %al,%al
jne    1140 <srt_is_end_of_block+0x30>
mov    $0x1,%eax
pop    %rbx
ret

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

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