#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*/ isdigit(char const);
int not_unsigned(const char *str) {
  int rv = 0;
  const char *ptr = str;
  while (*ptr != ' ' && *ptr != '\t' && *ptr != '\0') {
    if (!isdigit(*ptr)) {
      rv = 1;
      break;
    }
    ptr++;
  }
  return rv;
}


x86 assembly (clang, -O0):
<not_unsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x19(%rbp)
je     1165 <not_unsigned+0x55>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x19(%rbp)
je     1165 <not_unsigned+0x55>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1175 <not_unsigned+0x65>
jmp    11a7 <not_unsigned+0x97>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1196 <not_unsigned+0x86>
movl   $0x1,-0xc(%rbp)
jmp    11a7 <not_unsigned+0x97>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112b <not_unsigned+0x1b>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_unsigned>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movabs $0x100000201,%r14
jmp    1140 <not_unsigned+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %eax,%eax
je     1153 <not_unsigned+0x43>
movzbl (%rbx),%eax
cmp    $0x20,%rax
ja     1130 <not_unsigned+0x20>
bt     %rax,%r14
jae    1130 <not_unsigned+0x20>
xor    %eax,%eax
jmp    1158 <not_unsigned+0x48>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @not_unsigned(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %8, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 32, label %9
i8 9, label %9
i8 0, label %9
]
5: ; preds = %2
%6 = tail call i32 @isdigit(i8 signext %4)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %5, %2, %2, %2
%10 = phi i32 [ 0, %2 ], [ 0, %2 ], [ 0, %2 ], [ 1, %5 ]
ret i32 %10
}