#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*/ printf(char *, char *);
int /*<<< orphan*/ reverseWords(char *);
int main(int argc, char **argv) {
  char s1[] = "the sky is blue";
  char s2[] = "     the    sky is    blue      ";
  char s3[] = " ";
  char s4[] =
      "pz! .xwy.,cga. vua frjrmcjf, xxw'izz vgthvpfhl sldudifok wvls orujxroi "
      "w. oo c?ymxlptr ff'?rh bsjjoyjwvx tj pqv.zlq ,jlu',j dg izq.fo wtvwqn "
      "teual jnsv.a .oclyrvg tkgag'a' !wsz?sclc pvhl.ypq vyin cn?z,kxg , u l?l "
      "glr zf'hew l'wmi .nlvgr u zfwzra? ot!emgg. rg,'.d.kp fn vat ba.myfqxe "
      "znzdrhh xjeubr taztndst v nep?bs .,pwin. e pi";
  reverseWords(s1);
  reverseWords(s2);
  reverseWords(s3);
  reverseWords(s4);
  printf("'%s'\n", s1);
  printf("'%s'\n", s2);
  printf("'%s'\n", s3);
  printf("'%s'\n", s4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x21,%edx
call   1040 <memcpy@plt>
mov    0x100e(%rip),%ax
mov    %ax,-0x52(%rbp)
lea    -0x1a0(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x149,%edx
call   1040 <memcpy@plt>
lea    -0x20(%rbp),%rdi
call   1050 <reverseWords@plt>
lea    -0x50(%rbp),%rdi
call   1050 <reverseWords@plt>
lea    -0x52(%rbp),%rdi
call   1050 <reverseWords@plt>
lea    -0x1a0(%rbp),%rdi
call   1050 <reverseWords@plt>
lea    -0x20(%rbp),%rsi
lea    0xfc2(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xfb2(%rip),%rdi
call   1030 <printf@plt>
lea    -0x52(%rbp),%rsi
lea    0xfa2(%rip),%rdi
call   1030 <printf@plt>
lea    -0x1a0(%rbp),%rsi
lea    0xf8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a0,%rsp
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movb   $0x0,0x40(%rsp)
movw   $0x20,0xe(%rsp)
lea    0xec9(%rip),%rsi
lea    0x50(%rsp),%r14
mov    $0x149,%edx
mov    %r14,%rdi
call   1040 <memcpy@plt>
lea    0x10(%rsp),%r13
mov    %r13,%rdi
call   1050 <reverseWords@plt>
lea    0x20(%rsp),%r15
mov    %r15,%rdi
call   1050 <reverseWords@plt>
lea    0xe(%rsp),%r12
mov    %r12,%rdi
call   1050 <reverseWords@plt>
mov    %r14,%rdi
call   1050 <reverseWords@plt>
lea    0xfca(%rip),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s1 = [16 x i8] c"the sky is blue\00"
@__const.main.s2 = [33 x i8] c" the sky is blue \00"
@__const.main.s3 = [2 x i8] c" \00"
@__const.main.s4 = [329 x i8] c"pz! .xwy.,cga. vua frjrmcjf, xxw'izz vgthvpfhl sldudifok wvls orujxroi w. oo c?ymxlptr ff'?rh bsjjoyjwvx tj pqv.zlq ,jlu',j dg izq.fo wtvwqn teual jnsv.a .oclyrvg tkgag'a' !wsz?sclc pvhl.ypq vyin cn?z,kxg , u l?l glr zf'hew l'wmi .nlvgr u zfwzra? ot!emgg. rg,'.d.kp fn vat ba.myfqxe znzdrhh xjeubr taztndst v nep?bs .,pwin. e pi\00"
@.str = [6 x i8] c"'%s'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca [33 x i8]
%8 = alloca [2 x i8]
%9 = alloca [329 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [16 x i8]* %6 to i8*
%11 = bitcast [33 x i8]* %7 to i8*
%12 = bitcast [2 x i8]* %8 to i8*
%13 = bitcast [329 x i8]* %9 to i8*
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%15 = call i32 @reverseWords(i8* %14)
%16 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%17 = call i32 @reverseWords(i8* %16)
%18 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%19 = call i32 @reverseWords(i8* %18)
%20 = getelementptr inbounds [329 x i8], [329 x i8]* %9, i64 0, i64 0
%21 = call i32 @reverseWords(i8* %20)
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%23 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%25 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%27 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds [329 x i8], [329 x i8]* %9, i64 0, i64 0
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %28)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [16 x i8] c"the sky is blue\00"
@__const.main.s2 = [33 x i8] c" the sky is blue \00"
@__const.main.s4 = [329 x i8] c"pz! .xwy.,cga. vua frjrmcjf, xxw'izz vgthvpfhl sldudifok wvls orujxroi w. oo c?ymxlptr ff'?rh bsjjoyjwvx tj pqv.zlq ,jlu',j dg izq.fo wtvwqn teual jnsv.a .oclyrvg tkgag'a' !wsz?sclc pvhl.ypq vyin cn?z,kxg , u l?l glr zf'hew l'wmi .nlvgr u zfwzra? ot!emgg. rg,'.d.kp fn vat ba.myfqxe znzdrhh xjeubr taztndst v nep?bs .,pwin. e pi\00"
@.str = [6 x i8] c"'%s'\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = alloca [33 x i8]
%5 = alloca i16
%6 = alloca [329 x i8]
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 0
%9 = bitcast i16* %5 to i8*
store i16 32, i16* %5
%10 = getelementptr inbounds [329 x i8], [329 x i8]* %6, i64 0, i64 0
%11 = call i32 @reverseWords(i8* %7)
%12 = call i32 @reverseWords(i8* %8)
%13 = call i32 @reverseWords(i8* %9)
%14 = call i32 @reverseWords(i8* %10)
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8)
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9)
%18 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}