int main() {
  int num = 4;
  int ret = 0;
  char source[4][100] = {"    Hello    world    good     !",
                         "lol i good * # Hello world     p ",
                         "  Hel, wr k   lk    ",
                         "create_print_function printDouble \"%lf\" double"};
  int wc[4] = {4, 4, 4, 4};
  for (int k = 0; k < num; ++k) {
    char buff[250][150];
    int count = get_all_words(source[k], buff, 250);
    print_string_array(buff, count, 150);
    if (count != wc[k]) {
      ret = -1;
    }
    for (int i = 0; i < count; ++i) {
      int j;
      for (j = 0; buff[i][j] != '\0'; ++j)
        ;
      if (j < 1)
        if (buff[i][j] == ' ')
          ret = -1;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9440,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x1a0(%rbp),%rdi
lea    0xea2(%rip),%rsi
mov    $0x190,%edx
call   1050 <memcpy@plt>
mov    0x1021(%rip),%rax
mov    %rax,-0x1b0(%rbp)
mov    0x101b(%rip),%rax
mov    %rax,-0x1a8(%rbp)
movl   $0x0,-0x1b4(%rbp)
mov    -0x1b4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12e7 <main+0x1b7>
movslq -0x1b4(%rbp),%rax
lea    -0x1a0(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
lea    -0x9430(%rbp),%rsi
mov    $0xfa,%edx
mov    $0x0,%al
call   1030 <get_all_words@plt>
mov    %eax,-0x9434(%rbp)
lea    -0x9430(%rbp),%rdi
mov    -0x9434(%rbp),%esi
mov    $0x96,%edx
mov    $0x0,%al
call   1040 <print_string_array@plt>
mov    -0x9434(%rbp),%eax
movslq -0x1b4(%rbp),%rcx
cmp    -0x1b0(%rbp,%rcx,4),%eax
je     1205 <main+0xd5>
movl   $0xffffffff,-0xc(%rbp)
movl   $0x0,-0x9438(%rbp)
mov    -0x9438(%rbp),%eax
cmp    -0x9434(%rbp),%eax
jge    12ce <main+0x19e>
movl   $0x0,-0x943c(%rbp)
movslq -0x9438(%rbp),%rcx
lea    -0x9430(%rbp),%rax
imul   $0x96,%rcx,%rcx
add    %rcx,%rax
movslq -0x943c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1270 <main+0x140>
jmp    125c <main+0x12c>
mov    -0x943c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x943c(%rbp)
jmp    122b <main+0xfb>
cmpl   $0x1,-0x943c(%rbp)
jge    12b5 <main+0x185>
movslq -0x9438(%rbp),%rcx
lea    -0x9430(%rbp),%rax
imul   $0x96,%rcx,%rcx
add    %rcx,%rax
movslq -0x943c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    12b0 <main+0x180>
movl   $0xffffffff,-0xc(%rbp)
jmp    12b5 <main+0x185>
jmp    12ba <main+0x18a>
mov    -0x9438(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9438(%rbp)
jmp    120f <main+0xdf>
jmp    12d3 <main+0x1a3>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    118e <main+0x5e>
mov    -0xc(%rbp),%eax
add    $0x9440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x9410,%rsp
lea    0xeba(%rip),%rsi
mov    %rsp,%rbx
mov    $0x190,%edx
mov    %rbx,%rdi
call   1050 <memcpy@plt>
lea    0x190(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfa,%edx
xor    %eax,%eax
call   1030 <get_all_words@plt>
mov    %eax,%ebx
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x96,%edx
xor    %eax,%eax
call   1040 <print_string_array@plt>
lea    0x64(%rsp),%rdi
mov    %r14,%rsi
mov    $0xfa,%edx
xor    %eax,%eax
call   1030 <get_all_words@plt>
mov    %eax,%r15d
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x96,%edx
xor    %eax,%eax
call   1040 <print_string_array@plt>
lea    0xc8(%rsp),%rdi
mov    %r14,%rsi
mov    $0xfa,%edx
xor    %eax,%eax
call   1030 <get_all_words@plt>
mov    %eax,%r12d
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x96,%edx
xor    %eax,%eax
call   1040 <print_string_array@plt>
lea    0x12c(%rsp),%rdi
mov    %r14,%rsi
mov    $0xfa,%edx
xor    %eax,%eax
call   1030 <get_all_words@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x96,%edx
xor    %eax,%eax
call   1040 <print_string_array@plt>
xor    $0x4,%ebp
xor    $0x4,%r12d
xor    $0x4,%r15d
xor    $0x4,%ebx
or     %r15d,%ebx
or     %r12d,%ebx
xor    %eax,%eax
or     %ebp,%ebx
setne  %al
neg    %eax
add    $0x9410,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.source = [4 x [100 x i8]] [[100 x i8] c" Hello world good !\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"lol i good * # Hello world p \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c" Hel, wr k lk \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"create_print_function printDouble \22%lf\22 double\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
@__const.main.wc = [4 x i32] [i32 4, i32 4, i32 4, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4 x [100 x i8]]
%5 = alloca [4 x i32]
%6 = alloca i32
%7 = alloca [250 x [150 x i8]]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %2
store i32 0, i32* %3
%11 = bitcast [4 x [100 x i8]]* %4 to i8*
%12 = bitcast [4 x i32]* %5 to i8*
store i32 0, i32* %6
br label %13
13: ; preds = %74, %0
%14 = load i32, i32* %6
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %77
17: ; preds = %13
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x [100 x i8]], [4 x [100 x i8]]* %4, i64 0, i64 %19
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %20, i64 0, i64 0
%22 = getelementptr inbounds [250 x [150 x i8]], [250 x [150 x i8]]* %7, i64 0, i64 0
%23 = call i32 (i8*, [150 x i8]*, i32, ...) bitcast (i32 (...)* @get_all_words to i32 (i8*, [150 x i8]*, i32, ...)*)(i8* %21, [150 x i8]* %22, i32 250)
store i32 %23, i32* %8
%24 = getelementptr inbounds [250 x [150 x i8]], [250 x [150 x i8]]* %7, i64 0, i64 0
%25 = load i32, i32* %8
%26 = call i32 ([150 x i8]*, i32, i32, ...) bitcast (i32 (...)* @print_string_array to i32 ([150 x i8]*, i32, i32, ...)*)([150 x i8]* %24, i32 %25, i32 150)
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %29
%31 = load i32, i32* %30
%32 = icmp ne i32 %27, %31
br i1 %32, label %33, label %34
33: ; preds = %17
store i32 -1, i32* %3
br label %34
34: ; preds = %33, %17
store i32 0, i32* %9
br label %35
35: ; preds = %70, %34
%36 = load i32, i32* %9
%37 = load i32, i32* %8
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %73
39: ; preds = %35
store i32 0, i32* %10
br label %40
40: ; preds = %51, %39
%41 = load i32, i32* %9
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [250 x [150 x i8]], [250 x [150 x i8]]* %7, i64 0, i64 %42
%44 = load i32, i32* %10
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [150 x i8], [150 x i8]* %43, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %40
br label %51
51: ; preds = %50
%52 = load i32, i32* %10
%53 = add nsw i32 %52, 1
store i32 %53, i32* %10
br label %40
54: ; preds = %40
%55 = load i32, i32* %10
%56 = icmp slt i32 %55, 1
br i1 %56, label %57, label %69
57: ; preds = %54
%58 = load i32, i32* %9
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [250 x [150 x i8]], [250 x [150 x i8]]* %7, i64 0, i64 %59
%61 = load i32, i32* %10
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [150 x i8], [150 x i8]* %60, i64 0, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 32
br i1 %66, label %67, label %68
67: ; preds = %57
store i32 -1, i32* %3
br label %68
68: ; preds = %67, %57
br label %69
69: ; preds = %68, %54
br label %70
70: ; preds = %69
%71 = load i32, i32* %9
%72 = add nsw i32 %71, 1
store i32 %72, i32* %9
br label %35
73: ; preds = %35
br label %74
74: ; preds = %73
%75 = load i32, i32* %6
%76 = add nsw i32 %75, 1
store i32 %76, i32* %6
br label %13
77: ; preds = %13
%78 = load i32, i32* %3
ret i32 %78
}

LLVM IR (-O2):
@__const.main.source = [4 x [100 x i8]] [[100 x i8] c" Hello world good !\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"lol i good * # Hello world p \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c" Hel, wr k lk \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", [100 x i8] c"create_print_function printDouble \22%lf\22 double\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"]
define i32 @main() {
%1 = alloca [4 x [100 x i8]]
%2 = alloca [250 x [150 x i8]]
%3 = getelementptr inbounds [4 x [100 x i8]], [4 x [100 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [250 x [150 x i8]], [250 x [150 x i8]]* %2, i64 0, i64 0, i64 0
%5 = getelementptr inbounds [250 x [150 x i8]], [250 x [150 x i8]]* %2, i64 0, i64 0
%6 = call i32 (i8*, [150 x i8]*, i32, ...) bitcast (i32 (...)* @get_all_words to i32 (i8*, [150 x i8]*, i32, ...)*)(i8* %3, [150 x i8]* %5, i32 250)
%7 = call i32 ([150 x i8]*, i32, i32, ...) bitcast (i32 (...)* @print_string_array to i32 ([150 x i8]*, i32, i32, ...)*)([150 x i8]* %5, i32 %6, i32 150)
%8 = getelementptr inbounds [4 x [100 x i8]], [4 x [100 x i8]]* %1, i64 0, i64 1, i64 0
%9 = call i32 (i8*, [150 x i8]*, i32, ...) bitcast (i32 (...)* @get_all_words to i32 (i8*, [150 x i8]*, i32, ...)*)(i8* %8, [150 x i8]* %5, i32 250)
%10 = call i32 ([150 x i8]*, i32, i32, ...) bitcast (i32 (...)* @print_string_array to i32 ([150 x i8]*, i32, i32, ...)*)([150 x i8]* %5, i32 %9, i32 150)
%11 = getelementptr inbounds [4 x [100 x i8]], [4 x [100 x i8]]* %1, i64 0, i64 2, i64 0
%12 = call i32 (i8*, [150 x i8]*, i32, ...) bitcast (i32 (...)* @get_all_words to i32 (i8*, [150 x i8]*, i32, ...)*)(i8* %11, [150 x i8]* %5, i32 250)
%13 = call i32 ([150 x i8]*, i32, i32, ...) bitcast (i32 (...)* @print_string_array to i32 ([150 x i8]*, i32, i32, ...)*)([150 x i8]* %5, i32 %12, i32 150)
%14 = getelementptr inbounds [4 x [100 x i8]], [4 x [100 x i8]]* %1, i64 0, i64 3, i64 0
%15 = call i32 (i8*, [150 x i8]*, i32, ...) bitcast (i32 (...)* @get_all_words to i32 (i8*, [150 x i8]*, i32, ...)*)(i8* %14, [150 x i8]* %5, i32 250)
%16 = call i32 ([150 x i8]*, i32, i32, ...) bitcast (i32 (...)* @print_string_array to i32 ([150 x i8]*, i32, i32, ...)*)([150 x i8]* %5, i32 %15, i32 150)
%17 = icmp ne i32 %15, 4
%18 = icmp ne i32 %12, 4
%19 = icmp ne i32 %9, 4
%20 = icmp ne i32 %6, 4
%21 = or i1 %19, %20
%22 = or i1 %18, %21
%23 = or i1 %17, %22
%24 = sext i1 %23 to i32
ret i32 %24
}