#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 */
int /*<<< orphan*/ assert(int);
char *skip_ws(char *);
void skip_ws_test(void) {
  char *str;
  str = "  hell";
  assert(skip_ws(str) == str + 2);
  str = "a  hell";
  assert(skip_ws(str) == str);
  str = "hell  ";
  assert(skip_ws(str) == str);
  str = " hell  ";
  assert(skip_ws(str) == str + 1);
  str = "";
  assert(skip_ws(str) == str);
  char str2[] = {'\0', 'a', 'h'};
  assert(skip_ws(str2) == str2);
  char str3[] = {' ', ' ', ' ', '\0'};
  assert(skip_ws(str3) == str3 + 3);
}


x86 assembly (clang, -O0):
<skip_ws_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_ws@plt>
mov    -0x8(%rbp),%rcx
add    $0x2,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xea5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_ws@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe89(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_ws@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe63(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_ws@plt>
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xe42(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_ws@plt>
cmp    -0x8(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0xe1e(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xe16(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0xb(%rbp),%rdi
call   1040 <skip_ws@plt>
lea    -0xb(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0xdea(%rip),%eax
mov    %eax,-0xf(%rbp)
lea    -0xf(%rbp),%rdi
call   1040 <skip_ws@plt>
lea    -0xf(%rbp),%rcx
add    $0x3,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ws_test>:
push   %rbx
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
call   1040 <skip_ws@plt>
lea    0xecb(%rip),%rcx
xor    %edi,%edi
cmp    %rcx,%rax
sete   %dil
call   1030 <assert@plt>
lea    0xeb3(%rip),%rbx
mov    %rbx,%rdi
call   1040 <skip_ws@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1030 <assert@plt>
lea    0xe9f(%rip),%rbx
mov    %rbx,%rdi
call   1040 <skip_ws@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1030 <assert@plt>
lea    0xe81(%rip),%rdi
call   1040 <skip_ws@plt>
lea    0xe76(%rip),%rcx
xor    %edi,%edi
cmp    %rcx,%rax
sete   %dil
call   1030 <assert@plt>
lea    0xe67(%rip),%rbx
mov    %rbx,%rdi
call   1040 <skip_ws@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1030 <assert@plt>
movb   $0x68,0xa(%rsp)
movw   $0x6100,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <skip_ws@plt>
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
call   1030 <assert@plt>
movl   $0x202020,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <skip_ws@plt>
lea    0xf(%rsp),%rcx
xor    %edi,%edi
cmp    %rcx,%rax
sete   %dil
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" hell\00"
@.str.1 = [8 x i8] c"a hell\00"
@.str.2 = [7 x i8] c"hell \00"
@.str.3 = [8 x i8] c" hell \00"
@.str.4 = [1 x i8] zeroinitializer
@__const.skip_ws_test.str2 = [3 x i8] c"\00ah"
@__const.skip_ws_test.str3 = [4 x i8] c" \00"
define void @skip_ws_test() {
%1 = alloca i8*
%2 = alloca [3 x i8]
%3 = alloca [4 x i8]
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @skip_ws(i8* %4)
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = icmp eq i8* %5, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %1
%11 = load i8*, i8** %1
%12 = call i8* @skip_ws(i8* %11)
%13 = load i8*, i8** %1
%14 = icmp eq i8* %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %1
%17 = load i8*, i8** %1
%18 = call i8* @skip_ws(i8* %17)
%19 = load i8*, i8** %1
%20 = icmp eq i8* %18, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %1
%23 = load i8*, i8** %1
%24 = call i8* @skip_ws(i8* %23)
%25 = load i8*, i8** %1
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = icmp eq i8* %24, %26
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8** %1
%30 = load i8*, i8** %1
%31 = call i8* @skip_ws(i8* %30)
%32 = load i8*, i8** %1
%33 = icmp eq i8* %31, %32
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = bitcast [3 x i8]* %2 to i8*
%37 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%38 = call i8* @skip_ws(i8* %37)
%39 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%40 = icmp eq i8* %38, %39
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = bitcast [4 x i8]* %3 to i8*
%44 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%45 = call i8* @skip_ws(i8* %44)
%46 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%47 = getelementptr inbounds i8, i8* %46, i64 3
%48 = icmp eq i8* %45, %47
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c" hell\00"
@.str.1 = [8 x i8] c"a hell\00"
@.str.2 = [7 x i8] c"hell \00"
@.str.3 = [8 x i8] c" hell \00"
@.str.4 = [1 x i8] zeroinitializer
@__const.skip_ws_test.str2 = [3 x i8] c"\00ah"
define void @skip_ws_test() {
%1 = alloca [3 x i8]
%2 = alloca i32
%3 = tail call i8* @skip_ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 2)
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i8* @skip_ws(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i8* %7, getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i8* @skip_ws(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i8* %11, getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0)
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i8* @skip_ws(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i8* %15, getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 1)
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = tail call i8* @skip_ws(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
%20 = icmp eq i8* %19, getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0)
%21 = zext i1 %20 to i32
%22 = tail call i32 @assert(i32 %21)
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%24 = call i8* @skip_ws(i8* %23)
%25 = icmp eq i8* %24, %23
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = bitcast i32* %2 to i8*
store i32 2105376, i32* %2
%29 = call i8* @skip_ws(i8* %28)
%30 = getelementptr inbounds i8, i8* %28, i64 3
%31 = icmp eq i8* %29, %30
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
ret void
}