void test_mx_strskipwhitespaces(void) {
  char *s;
  assert(s = mx_strskipwhitespaces("     abc   "));
  assert(strcmp(s, "abc   ") == 0);
  assert(s = mx_strskipwhitespaces("abc   "));
  assert(strcmp(s, "abc   ") == 0);
  assert(s = mx_strskipwhitespaces(""));
  assert(strcmp(s, "") == 0);
}


x86 assembly (clang, -O0):
<test_mx_strskipwhitespaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1050 <mx_strskipwhitespaces@plt>
movslq %eax,%rdi
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xea6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1050 <mx_strskipwhitespaces@plt>
movslq %eax,%rdi
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1050 <mx_strskipwhitespaces@plt>
movslq %eax,%rdi
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe30(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mx_strskipwhitespaces>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1050 <mx_strskipwhitespaces@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
lea    0xeaf(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
xor    %eax,%eax
call   1040 <assert@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <mx_strskipwhitespaces@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
xor    %eax,%eax
call   1040 <assert@plt>
lea    0xe63(%rip),%rdi
xor    %eax,%eax
call   1050 <mx_strskipwhitespaces@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <assert@plt>
xor    %edi,%edi
cmpb   $0x0,(%rbx)
sete   %dil
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [12 x i8] c" abc \00"
@.str.1 = [7 x i8] c"abc \00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_mx_strskipwhitespaces() {
%1 = alloca i8*
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @mx_strskipwhitespaces to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %9)
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @mx_strskipwhitespaces to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %1
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %13)
%15 = load i8*, i8** %1
%16 = call i32 @strcmp(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %18)
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @mx_strskipwhitespaces to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8*
store i8* %22, i8** %1
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %22)
%24 = load i8*, i8** %1
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
%27 = zext i1 %26 to i32
%28 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %27)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c" abc \00"
@.str.1 = [7 x i8] c"abc \00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_mx_strskipwhitespaces() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mx_strskipwhitespaces to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %3)
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %7)
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mx_strskipwhitespaces to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %11)
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %15)
%17 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mx_strskipwhitespaces to i32 (i8*, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
%20 = tail call i32 (i8*, ...) bitcast (i32 (...)* @assert to i32 (i8*, ...)*)(i8* %19)
%21 = load i8, i8* %19
%22 = icmp eq i8 %21, 0
%23 = zext i1 %22 to i32
%24 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %23)
ret void
}