#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 */
struct pplex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ endoflinep(struct pplex *);
char *nextchar(struct pplex *, char const *);
int /*<<< orphan*/ whitespacep(struct pplex *);
char const *skiptowhite(struct pplex *cl, char const *input) {
  while (!whitespacep(cl) && !endoflinep(cl))
    input = nextchar(cl, input);
  return input;
}


x86 assembly (clang, -O0):
<skiptowhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <whitespacep@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    116d <skiptowhite+0x3d>
mov    -0x8(%rbp),%rdi
call   1040 <endoflinep@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    117d <skiptowhite+0x4d>
jmp    1193 <skiptowhite+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <nextchar@plt>
mov    %rax,-0x10(%rbp)
jmp    1140 <skiptowhite+0x10>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skiptowhite>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
call   1030 <whitespacep@plt>
test   %eax,%eax
jne    1168 <skiptowhite+0x38>
mov    %r14,%rdi
call   1040 <endoflinep@plt>
test   %eax,%eax
jne    1168 <skiptowhite+0x38>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <nextchar@plt>
mov    %rax,%rbx
mov    %r14,%rdi
jmp    1140 <skiptowhite+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.pplex = type { i32 }
define i8* @skiptowhite(%struct.pplex* %0, i8* %1) {
%3 = alloca %struct.pplex*
%4 = alloca i8*
store %struct.pplex* %0, %struct.pplex** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %16, %2
%6 = load %struct.pplex*, %struct.pplex** %3
%7 = call i32 @whitespacep(%struct.pplex* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = load %struct.pplex*, %struct.pplex** %3
%11 = call i32 @endoflinep(%struct.pplex* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %9, %5
%15 = phi i1 [ false, %5 ], [ %13, %9 ]
br i1 %15, label %16, label %20
16: ; preds = %14
%17 = load %struct.pplex*, %struct.pplex** %3
%18 = load i8*, i8** %4
%19 = call i8* @nextchar(%struct.pplex* %17, i8* %18)
store i8* %19, i8** %4
br label %5
20: ; preds = %14
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
%struct.pplex = type { i32 }
define i8* @skiptowhite(%struct.pplex* %0, i8* %1) {
%3 = tail call i32 @whitespacep(%struct.pplex* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %2, %9
%6 = phi i8* [ %10, %9 ], [ %1, %2 ]
%7 = tail call i32 @endoflinep(%struct.pplex* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = tail call i8* @nextchar(%struct.pplex* %0, i8* %6)
%11 = tail call i32 @whitespacep(%struct.pplex* %0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %9, %2
%14 = phi i8* [ %1, %2 ], [ %10, %9 ], [ %6, %5 ]
ret i8* %14
}