#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*/ parse_cli(char *, int, char **);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_word_order(char *);
int main(int argv, char *argc[]) {
  int ret_val = 0;
  char test_string[128];
  if (!parse_cli(test_string, argv, argc)) {
    ret_val = 1;
    goto Exit;
  }
  printf("%s\n", test_string);
  reverse_word_order(test_string);
  printf("%s\n", test_string);
Exit:
  return ret_val;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1050 <parse_cli@plt>
cmp    $0x0,%eax
jne    1178 <main+0x48>
movl   $0x1,-0x14(%rbp)
jmp    11aa <main+0x7a>
lea    -0xa0(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
lea    -0xa0(%rbp),%rdi
call   1030 <reverse_word_order@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe5b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%rdx
mov    %edi,%esi
mov    %rsp,%rdi
call   1050 <parse_cli@plt>
test   %eax,%eax
je     1177 <main+0x47>
lea    0xeae(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse_word_order@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
jmp    117c <main+0x4c>
mov    $0x1,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [128 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @parse_cli(i8* %8, i32 %9, i8** %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %2
store i32 1, i32* %6
br label %21
14: ; preds = %2
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%18 = call i32 @reverse_word_order(i8* %17)
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %19)
br label %21
21: ; preds = %14, %13
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @parse_cli(i8* %4, i32 %0, i8** %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%9 = call i32 @reverse_word_order(i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %12
}