#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 *cskip(char *cptr) {
  if (!*cptr || isspace((unsigned char)*cptr)) {
    warning(cptr, "wasn't expecting a space");
    return (cptr);
  }
  while (*cptr && !isspace((unsigned char)*cptr))
    ++cptr;
  return (cptr);
}


x86 assembly (clang, -O0):
<cskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <cskip+0x2f>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     116c <cskip+0x4c>
mov    -0x10(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <warning@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11c7 <cskip+0xa7>
jmp    1171 <cskip+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     119e <cskip+0x7e>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    11ae <cskip+0x8e>
jmp    11bf <cskip+0x9f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1171 <cskip+0x51>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cskip>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1137 <cskip+0x17>
movzbl %al,%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     114b <cskip+0x2b>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <warning@plt>
mov    %rbx,%rax
pop    %rbx
ret
mov    (%rbx),%al
test   %al,%al
je     1146 <cskip+0x26>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1146 <cskip+0x26>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1160 <cskip+0x40>
jmp    1146 <cskip+0x26>

LLVM IR (-O0):
@.str = [25 x i8] c"wasn't expecting a space\00"
define i8* @cskip(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 %12, label %16
12: ; preds = %7, %1
%13 = load i8*, i8** %3
%14 = call i32 @warning(i8* %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %3
store i8* %15, i8** %2
br label %35
16: ; preds = %7
br label %17
17: ; preds = %30, %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 %28
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
%27 = xor i1 %26, true
br label %28
28: ; preds = %22, %17
%29 = phi i1 [ false, %17 ], [ %27, %22 ]
br i1 %29, label %30, label %33
30: ; preds = %28
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %3
br label %17
33: ; preds = %28
%34 = load i8*, i8** %3
store i8* %34, i8** %2
br label %35
35: ; preds = %33, %12
%36 = load i8*, i8** %2
ret i8* %36
}

LLVM IR (-O2):
@.str = [25 x i8] c"wasn't expecting a space\00"
define i8* @cskip(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 %7, label %10
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 ([25 x i8], [25 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 %17, label %21
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
}