#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 count_tabs(char *);
int count_words(char *);
int /*<<< orphan*/ printf(char *, ...);
void test9(void) {
  char string[] = "  \t This\t  string\n  \t \t\t  has\n \t\n  \t\"more\" than"
                  " five \n\t\n  words.\n\n";
  int count;
  printf("\n== test9 =====================================================\n");
  printf("|%s|\n", string);
  count = count_words(string);
  printf("Word count is %2i\n", count);
  printf("Number of tabs is %i\n", count_tabs(string));
}


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x43,%edx
call   1060 <memcpy@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xf0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <count_words@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%esi
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
call   1050 <count_tabs@plt>
mov    %eax,%esi
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
push   %rbx
sub    $0x50,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe90(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0xa0a2e,0x3f(%rsp)
lea    0xeef(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <count_words@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <count_tabs@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test9.string = [67 x i8] c" \09 This\09 string\0A \09 \09\09 has\0A \09\0A \09\22more\22 than five \0A\09\0A words.\0A\0A\00"
@.str = [65 x i8] c"\0A== test9 =====================================================\0A\00"
@.str.1 = [6 x i8] c"|%s|\0A\00"
@.str.2 = [19 x i8] c"Word count is %2i\0A\00"
@.str.3 = [22 x i8] c"Number of tabs is %i\0A\00"
define void @test9() {
%1 = alloca [67 x i8]
%2 = alloca i32
%3 = bitcast [67 x i8]* %1 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [67 x i8], [67 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [67 x i8], [67 x i8]* %1, i64 0, i64 0
%8 = call i32 @count_words(i8* %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [67 x i8], [67 x i8]* %1, i64 0, i64 0
%12 = call i32 @count_tabs(i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@__const.test9.string = [67 x i8] c" \09 This\09 string\0A \09 \09\09 has\0A \09\0A \09\22more\22 than five \0A\09\0A words.\0A\0A\00"
@.str.1 = [6 x i8] c"|%s|\0A\00"
@.str.2 = [19 x i8] c"Word count is %2i\0A\00"
@.str.3 = [22 x i8] c"Number of tabs is %i\0A\00"
@str = [64 x i8] c"\0A== test9 =====================================================\00"
define void @test9() {
%1 = alloca [67 x i8]
%2 = getelementptr inbounds [67 x i8], [67 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @count_words(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @count_tabs(i8* %2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %7)
ret void
}