#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__ isspace(unsigned char);
int /*<<< orphan*/ warning(char *, char *);
char *wskip(char *cptr) {
  if (!*cptr || !isspace((unsigned char)*cptr)) {
    warning(cptr, "expected a space");
    return (cptr);
  }
  while (*cptr && isspace((unsigned char)*cptr))
    ++cptr;
  return (cptr);
}


x86 assembly (clang, -O0):
<wskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <wskip+0x2f>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
jne    116c <wskip+0x4c>
mov    -0x10(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <warning@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11c5 <wskip+0xa5>
jmp    1171 <wskip+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     119c <wskip+0x7c>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    11ac <wskip+0x8c>
jmp    11bd <wskip+0x9d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1171 <wskip+0x51>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wskip>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     115b <wskip+0x3b>
movzbl %al,%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     115b <wskip+0x3b>
mov    (%rbx),%al
test   %al,%al
je     116a <wskip+0x4a>
nopl   (%rax)
movzbl %al,%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     116a <wskip+0x4a>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <wskip+0x20>
jmp    116a <wskip+0x4a>
lea    0xe9e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <warning@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"expected a space\00"
define i8* @wskip(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = call i64 @isspace(i8 zeroext %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %7, %1
%13 = load i8*, i8** %3
%14 = call i32 @warning(i8* %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %3
store i8* %15, i8** %2
br label %34
16: ; preds = %7
br label %17
17: ; preds = %29, %16
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = load i8, i8* %23
%25 = call i64 @isspace(i8 zeroext %24)
%26 = icmp ne i64 %25, 0
br label %27
27: ; preds = %22, %17
%28 = phi i1 [ false, %17 ], [ %26, %22 ]
br i1 %28, label %29, label %32
29: ; preds = %27
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %3
br label %17
32: ; preds = %27
%33 = load i8*, i8** %3
store i8* %33, i8** %2
br label %34
34: ; preds = %32, %12
%35 = load i8*, i8** %2
ret i8* %35
}

LLVM IR (-O2):
@.str = [17 x i8] c"expected a space\00"
define i8* @wskip(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i64 @isspace(i8 zeroext %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = load i8, i8* %0
%9 = icmp eq i8 %8, 0
br i1 %9, label %21, label %12
10: ; preds = %4, %1
%11 = tail call i32 @warning(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %21
12: ; preds = %7, %17
%13 = phi i8 [ %19, %17 ], [ %8, %7 ]
%14 = phi i8* [ %18, %17 ], [ %0, %7 ]
%15 = tail call i64 @isspace(i8 zeroext %13)
%16 = icmp eq i64 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %12
%18 = getelementptr inbounds i8, i8* %14, i64 1
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %12
21: ; preds = %17, %12, %7, %10
%22 = phi i8* [ %0, %10 ], [ %0, %7 ], [ %18, %17 ], [ %14, %12 ]
ret i8* %22
}