#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);
char *skipLeading(const char *string) {
  char *ptr;
  if (string == (const char *)NULL)
    return ((char *)NULL);
  for (ptr = (char *)string; ((*ptr != '\0') && isspace(*ptr)); ptr++)
    ;
  return (ptr);
}


x86 assembly (clang, -O0):
<skipLeading>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <skipLeading+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1195 <skipLeading+0x85>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1167 <skipLeading+0x57>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1177 <skipLeading+0x67>
jmp    118d <skipLeading+0x7d>
jmp    117c <skipLeading+0x6c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113c <skipLeading+0x2c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipLeading>:
push   %rbx
test   %rdi,%rdi
je     113b <skipLeading+0x2b>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     113d <skipLeading+0x2d>
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     113d <skipLeading+0x2d>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skipLeading+0x10>
jmp    113d <skipLeading+0x2d>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

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