#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 */
char *leadingwst(char *istr) {
  if (NULL == istr)
    return (istr);
  if (istr[0] == 0)
    return (istr);
  while ((*istr == ' ') || (*istr == '\t'))
    istr++;
  return (istr);
}


x86 assembly (clang, -O0):
<leadingwst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1121 <leadingwst+0x21>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1191 <leadingwst+0x91>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <leadingwst+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1191 <leadingwst+0x91>
jmp    1143 <leadingwst+0x43>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     1168 <leadingwst+0x68>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1178 <leadingwst+0x78>
jmp    1189 <leadingwst+0x89>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1143 <leadingwst+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leadingwst>:
test   %rdi,%rdi
je     1124 <leadingwst+0x24>
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
jne    1118 <leadingwst+0x18>
ret
nop
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    $0x20,%cl
je     1110 <leadingwst+0x10>
cmp    $0x9,%cl
je     1110 <leadingwst+0x10>
jmp    110e <leadingwst+0xe>
xor    %eax,%eax
ret

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

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