#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__ WhiteSpace(unsigned char);
int /*<<< orphan*/ assert(int);
const char *str_ltrim(const char *start, const char *end) {
  const char *it;
  assert(start <= end);
  for (it = start; it != end && (WhiteSpace(((unsigned char)(*it)))); it++)
    ;
  return it;
}


x86 assembly (clang, -O0):
<str_ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
je     1176 <str_ltrim+0x56>
mov    -0x18(%rbp),%rax
movzbl (%rax),%edi
call   1030 <WhiteSpace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1186 <str_ltrim+0x66>
jmp    119c <str_ltrim+0x7c>
jmp    118b <str_ltrim+0x6b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114d <str_ltrim+0x2d>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_ltrim>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    %rsi,%rbx
setbe  %dil
call   1040 <assert@plt>
cmp    %r14,%rbx
je     1159 <str_ltrim+0x39>
nopl   (%rax)
movzbl (%rbx),%edi
call   1030 <WhiteSpace@plt>
test   %rax,%rax
je     1159 <str_ltrim+0x39>
add    $0x1,%rbx
cmp    %r14,%rbx
jne    1140 <str_ltrim+0x20>
mov    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @str_ltrim(i8* %0, i8* readnone %1) {
%3 = icmp ule i8* %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i8* %0, %1
br i1 %6, label %15, label %7
7: ; preds = %2, %12
%8 = phi i8* [ %13, %12 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = tail call i64 @WhiteSpace(i8 zeroext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i8* %13, %1
br i1 %14, label %15, label %7
15: ; preds = %7, %12, %2
%16 = phi i8* [ %0, %2 ], [ %1, %12 ], [ %8, %7 ]
ret i8* %16
}