int get_white_space(char **ch) {
  char *forward = *ch;
  if (*forward == ' ') {
    while (*forward++ == ' ')
      ;
    *ch = (forward - 1);
    return 0;
  }
  if (*forward == '\t') {
    while (*forward++ == '\t')
      ;
    *ch = (forward - 1);
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_white_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1163 <get_white_space+0x63>
jmp    1128 <get_white_space+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1148 <get_white_space+0x48>
jmp    1128 <get_white_space+0x28>
mov    -0x18(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    11ba <get_white_space+0xba>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    11b3 <get_white_space+0xb3>
jmp    1178 <get_white_space+0x78>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1198 <get_white_space+0x98>
jmp    1178 <get_white_space+0x78>
mov    -0x18(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    11ba <get_white_space+0xba>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_white_space>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
cmp    $0x20,%dl
je     1130 <get_white_space+0x30>
mov    $0xffffffff,%eax
cmp    $0x9,%dl
jne    1142 <get_white_space+0x42>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%rcx),%rax
cmpb   $0x9,0x1(%rcx)
mov    %rax,%rcx
je     1120 <get_white_space+0x20>
jmp    113d <get_white_space+0x3d>
nop
lea    0x1(%rcx),%rax
cmpb   $0x20,0x1(%rcx)
mov    %rax,%rcx
je     1130 <get_white_space+0x30>
mov    %rax,(%rdi)
xor    %eax,%eax
ret

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

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