#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);
int wount(char *, char *);
int main(int argc, char *args[]) {
  int wc = 0;
  char *str = "Anubhav Sain is awesome. Waht do you say? Yeah you are right my "
              "brother  ";
  char *sep = " ";
  wc = wount(str, sep);
  printf("Words in '%s' = %d\n", str, wc);
  if (argc == 2) {
    wc = wount(args[1], sep);
    printf("Words in '%s' = %d.\n", args[1], wc);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xef9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <wount@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    11ab <main+0x8b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <wount@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x14(%rbp),%edx
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xed0(%rip),%rbx
lea    0xf11(%rip),%rsi
mov    %rbx,%rdi
call   1030 <wount@plt>
lea    0xf04(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
cmp    $0x2,%ebp
jne    1177 <main+0x57>
mov    0x8(%r14),%rdi
lea    0xee8(%rip),%rsi
call   1030 <wount@plt>
mov    0x8(%r14),%rsi
lea    0xeee(%rip),%rdi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [74 x i8] c"Anubhav Sain is awesome. Waht do you say? Yeah you are right my brother \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [20 x i8] c"Words in '%s' = %d\0A\00"
@.str.3 = [21 x i8] c"Words in '%s' = %d.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %8
%11 = call i32 @wount(i8* %9, i8* %10)
store i32 %11, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %12, i32 %13)
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %28
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = load i8*, i8** %8
%22 = call i32 @wount(i8* %20, i8* %21)
store i32 %22, i32* %6
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = load i32, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %25, i32 %26)
br label %28
28: ; preds = %17, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [74 x i8] c"Anubhav Sain is awesome. Waht do you say? Yeah you are right my brother \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [20 x i8] c"Words in '%s' = %d\0A\00"
@.str.3 = [21 x i8] c"Words in '%s' = %d.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @wount(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @wount(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8*, i8** %7
%11 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %10, i32 %9)
br label %12
12: ; preds = %6, %2
ret i32 0
}