#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*/ assert(int);
scalar_t__ isspace(char);
bool match_whitespace(char **p, void *ignored) {
  assert(p && *p);
  while (isspace(**p))
    ++*p;
  return true;
}


x86 assembly (clang, -O0):
<match_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     114e <match_whitespace+0x2e>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1187 <match_whitespace+0x67>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    115b <match_whitespace+0x3b>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_whitespace>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1135 <match_whitespace+0x15>
xor    %edi,%edi
cmpq   $0x0,(%rbx)
setne  %dil
jmp    1137 <match_whitespace+0x17>
xor    %edi,%edi
call   1040 <assert@plt>
mov    (%rbx),%rax
movsbl (%rax),%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   1030 <isspace@plt>
test   %rax,%rax
je     116a <match_whitespace+0x4a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1150 <match_whitespace+0x30>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @match_whitespace(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8**, i8*** %3
%6 = icmp ne i8** %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br label %11
11: ; preds = %7, %2
%12 = phi i1 [ false, %2 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
br label %15
15: ; preds = %21, %11
%16 = load i8**, i8*** %3
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = call i64 @isspace(i8 signext %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %15
%22 = load i8**, i8*** %3
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %22
br label %15
25: ; preds = %15
ret i32 1
}

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