#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 *, ...);
int string_is_all_whitespace(char *);
void test_all_whitespace() {
  printf("Test string_is_all_whitespace:\n");
  char *str = "  \tasdf";
  printf("string_is_all_whitespace('%s'): %i\n", str,
         string_is_all_whitespace(str));
  str = "  \t ";
  printf("string_is_all_whitespace('%s'): %i\n", str,
         string_is_all_whitespace(str));
}


x86 assembly (clang, -O0):
<test_all_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <string_is_all_whitespace@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <string_is_all_whitespace@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_all_whitespace>:
push   %r14
push   %rbx
push   %rax
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
call   1040 <string_is_all_whitespace@plt>
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec0(%rip),%rbx
mov    %rbx,%rdi
call   1040 <string_is_all_whitespace@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Test string_is_all_whitespace:\0A\00"
@.str.1 = [8 x i8] c" \09asdf\00"
@.str.2 = [36 x i8] c"string_is_all_whitespace('%s'): %i\0A\00"
@.str.3 = [5 x i8] c" \09 \00"
define void @test_all_whitespace() {
%1 = alloca i8*
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @string_is_all_whitespace(i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %3, i32 %5)
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %1
%7 = load i8*, i8** %1
%8 = load i8*, i8** %1
%9 = call i32 @string_is_all_whitespace(i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %7, i32 %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c" \09asdf\00"
@.str.2 = [36 x i8] c"string_is_all_whitespace('%s'): %i\0A\00"
@.str.3 = [5 x i8] c" \09 \00"
@str = [31 x i8] c"Test string_is_all_whitespace:\00"
define void @test_all_whitespace() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @string_is_all_whitespace(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @string_is_all_whitespace(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %4)
ret void
}