#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*/ isspace(char const);
char __unfo_iswhitespace(const char *str, int len) {
  for (int x = 0; x < len; x++) {
    if (!isspace(str[x]))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<__unfo_iswhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1168 <__unfo_iswhitespace+0x58>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1155 <__unfo_iswhitespace+0x45>
movb   $0x0,-0x1(%rbp)
jmp    116c <__unfo_iswhitespace+0x5c>
jmp    115a <__unfo_iswhitespace+0x4a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <__unfo_iswhitespace+0x16>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__unfo_iswhitespace>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1152 <__unfo_iswhitespace+0x42>
mov    %esi,%ebp
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1156 <__unfo_iswhitespace+0x46>
mov    %ebp,%ebp
mov    $0x1,%ecx
mov    %rcx,%rbx
cmp    %rcx,%rbp
je     114a <__unfo_iswhitespace+0x3a>
movsbl (%r14,%rbx,1),%edi
call   1030 <isspace@plt>
lea    0x1(%rbx),%rcx
test   %eax,%eax
jne    1130 <__unfo_iswhitespace+0x20>
cmp    %rbp,%rbx
setae  %al
jmp    1158 <__unfo_iswhitespace+0x48>
mov    $0x1,%al
jmp    1158 <__unfo_iswhitespace+0x48>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i8 @__unfo_iswhitespace(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %22
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = zext i32 %1 to i64
%7 = load i8, i8* %0
%8 = tail call i32 @isspace(i8 signext %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %22, label %10
10: ; preds = %4, %13
%11 = phi i64 [ %18, %13 ], [ 1, %4 ]
%12 = icmp eq i64 %11, %6
br i1 %12, label %19, label %13
13: ; preds = %10
%14 = getelementptr inbounds i8, i8* %0, i64 %11
%15 = load i8, i8* %14
%16 = tail call i32 @isspace(i8 signext %15)
%17 = icmp eq i32 %16, 0
%18 = add nuw nsw i64 %11, 1
br i1 %17, label %19, label %10
19: ; preds = %10, %13
%20 = icmp uge i64 %11, %5
%21 = zext i1 %20 to i8
br label %22
22: ; preds = %19, %4, %2
%23 = phi i8 [ 1, %2 ], [ 0, %4 ], [ %21, %19 ]
ret i8 %23
}