#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*/ _citrus_bcs_isspace(char const);
const char *_citrus_bcs_skip_nonws_len(const char *__restrict p,
                                       size_t *__restrict len) {
  while (*p && *len > 0 && !_citrus_bcs_isspace(*p)) {
    p++;
    (*len)--;
  }
  return (p);
}


x86 assembly (clang, -O0):
<_citrus_bcs_skip_nonws_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     115f <_citrus_bcs_skip_nonws_len+0x4f>
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x11(%rbp)
jbe    115f <_citrus_bcs_skip_nonws_len+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <_citrus_bcs_isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <_citrus_bcs_skip_nonws_len+0x5f>
jmp    118e <_citrus_bcs_skip_nonws_len+0x7e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
jmp    1120 <_citrus_bcs_skip_nonws_len+0x10>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_citrus_bcs_skip_nonws_len>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    (%rdi),%al
test   %al,%al
je     1156 <_citrus_bcs_skip_nonws_len+0x46>
mov    %rsi,%r14
mov    (%rsi),%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
cmp    $0xffffffffffffffff,%rbx
je     1156 <_citrus_bcs_skip_nonws_len+0x46>
movsbl %al,%edi
call   1030 <_citrus_bcs_isspace@plt>
test   %eax,%eax
jne    1156 <_citrus_bcs_skip_nonws_len+0x46>
mov    %rbx,(%r14)
movzbl 0x1(%r15),%eax
add    $0x1,%r15
add    $0xffffffffffffffff,%rbx
test   %al,%al
jne    1130 <_citrus_bcs_skip_nonws_len+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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