#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_log(int, int, char *, int *);
char **split_white(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int test_split_white(int verbose) {
  int ok = 1;
  char *line = "this is  \n a \t line";
  char **sp = split_white(line);
  assert_log(!strcmp(sp[0], "this"), verbose, "sp[0] != 'this'", &ok);
  assert_log(!strcmp(sp[1], "is"), verbose, "sp[1] != 'is'", &ok);
  assert_log(!strcmp(sp[2], "a"), verbose, "sp[2] != 'a'", &ok);
  assert_log(!strcmp(sp[3], "line"), verbose, "sp[3] != 'line'", &ok);
  line = " \n \t ";
  sp = split_white(line);
  assert_log(sp == NULL, verbose, "sp != NULL", &ok);
  return ok;
}


x86 assembly (clang, -O0):
<test_split_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <split_white@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%esi
lea    0xe95(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <assert_log@plt>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%esi
lea    0xe71(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <assert_log@plt>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%esi
lea    0xe4d(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <assert_log@plt>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe0b(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%esi
lea    0xe26(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <assert_log@plt>
lea    0xe26(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <split_white@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x4(%rbp),%esi
lea    0xe04(%rip),%rdx
lea    -0x8(%rbp),%rcx
call   1040 <assert_log@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_split_white>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebp
movl   $0x1,0xc(%rsp)
lea    0xeb7(%rip),%rdi
call   1050 <split_white@plt>
mov    %rax,%rbx
mov    (%rax),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xeaa(%rip),%rdx
lea    0xc(%rsp),%r14
mov    %ebp,%esi
mov    %r14,%rcx
call   1040 <assert_log@plt>
mov    0x8(%rbx),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xe8c(%rip),%rdx
mov    %ebp,%esi
mov    %r14,%rcx
call   1040 <assert_log@plt>
mov    0x10(%rbx),%rdi
lea    0xe85(%rip),%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xe73(%rip),%rdx
mov    %ebp,%esi
mov    %r14,%rcx
call   1040 <assert_log@plt>
mov    0x18(%rbx),%rdi
lea    0xe34(%rip),%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xe57(%rip),%rdx
mov    %ebp,%esi
mov    %r14,%rcx
call   1040 <assert_log@plt>
lea    0xe56(%rip),%rdi
call   1050 <split_white@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xe47(%rip),%rdx
mov    %ebp,%esi
mov    %r14,%rcx
call   1040 <assert_log@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"this is \0A a \09 line\00"
@.str.1 = [5 x i8] c"this\00"
@.str.2 = [16 x i8] c"sp[0] != 'this'\00"
@.str.3 = [3 x i8] c"is\00"
@.str.4 = [14 x i8] c"sp[1] != 'is'\00"
@.str.5 = [2 x i8] c"a\00"
@.str.6 = [13 x i8] c"sp[2] != 'a'\00"
@.str.7 = [5 x i8] c"line\00"
@.str.8 = [16 x i8] c"sp[3] != 'line'\00"
@.str.9 = [6 x i8] c" \0A \09 \00"
@.str.10 = [11 x i8] c"sp != NULL\00"
define i32 @test_split_white(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
store i32 %0, i32* %2
store i32 1, i32* %3
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %4
%6 = load i8*, i8** %4
%7 = call i8** @split_white(i8* %6)
store i8** %7, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = load i32, i32* %2
%16 = call i32 @assert_log(i32 %14, i32 %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
%24 = load i32, i32* %2
%25 = call i32 @assert_log(i32 %23, i32 %24, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
%31 = xor i1 %30, true
%32 = zext i1 %31 to i32
%33 = load i32, i32* %2
%34 = call i32 @assert_log(i32 %32, i32 %33, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 3
%37 = load i8*, i8** %36
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
%40 = xor i1 %39, true
%41 = zext i1 %40 to i32
%42 = load i32, i32* %2
%43 = call i32 @assert_log(i32 %41, i32 %42, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32* %3)
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8** %4
%44 = load i8*, i8** %4
%45 = call i8** @split_white(i8* %44)
store i8** %45, i8*** %5
%46 = load i8**, i8*** %5
%47 = icmp eq i8** %46, null
%48 = zext i1 %47 to i32
%49 = load i32, i32* %2
%50 = call i32 @assert_log(i32 %48, i32 %49, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32* %3)
%51 = load i32, i32* %3
ret i32 %51
}

LLVM IR (-O2):
@.str = [20 x i8] c"this is \0A a \09 line\00"
@.str.1 = [5 x i8] c"this\00"
@.str.2 = [16 x i8] c"sp[0] != 'this'\00"
@.str.3 = [3 x i8] c"is\00"
@.str.4 = [14 x i8] c"sp[1] != 'is'\00"
@.str.5 = [2 x i8] c"a\00"
@.str.6 = [13 x i8] c"sp[2] != 'a'\00"
@.str.7 = [5 x i8] c"line\00"
@.str.8 = [16 x i8] c"sp[3] != 'line'\00"
@.str.9 = [6 x i8] c" \0A \09 \00"
@.str.10 = [11 x i8] c"sp != NULL\00"
define i32 @test_split_white(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = tail call i8** @split_white(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %4
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert_log(i32 %8, i32 %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = getelementptr inbounds i8*, i8** %4, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert_log(i32 %14, i32 %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%16 = getelementptr inbounds i8*, i8** %4, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @strcmp(i8* dereferenceable(1) %17, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert_log(i32 %20, i32 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32* %2)
%22 = getelementptr inbounds i8*, i8** %4, i64 3
%23 = load i8*, i8** %22
%24 = call i32 @strcmp(i8* dereferenceable(1) %23, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
%26 = zext i1 %25 to i32
%27 = call i32 @assert_log(i32 %26, i32 %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%28 = call i8** @split_white(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%29 = icmp eq i8** %28, null
%30 = zext i1 %29 to i32
%31 = call i32 @assert_log(i32 %30, i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32* %2)
%32 = load i32, i32* %2
ret i32 %32
}