#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(char const);
void ez_skip_space(const char **str, size_t *len) {
  while (*len > 0 && isspace(**str)) {
    (*str)++;
    (*len)--;
  }
}


x86 assembly (clang, -O0):
<ez_skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x11(%rbp)
jbe    114c <ez_skip_space+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115c <ez_skip_space+0x4c>
jmp    117d <ez_skip_space+0x6d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
jmp    1120 <ez_skip_space+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_skip_space>:
push   %r14
push   %rbx
push   %rax
cmpq   $0x0,(%rsi)
je     114d <ez_skip_space+0x3d>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     114d <ez_skip_space+0x3d>
mov    (%rbx),%rax
add    $0x1,%rax
mov    %rax,(%rbx)
addq   $0xffffffffffffffff,(%r14)
jne    1130 <ez_skip_space+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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