#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*/ free(char *);
scalar_t__ strcmp(char const *, char *);
char *trimWhitespace(char const *);
bool testAllWhitespace(void) {
  char const *line = "   \t \v \f \r  \n";
  char const *expected = "";
  char *actual = NULL;
  bool retval;
  actual = trimWhitespace(line);
  if (NULL == actual) {
    return false;
  }
  if (0 == strcmp(expected, actual)) {
    retval = true;
  } else {
    retval = false;
  }
  free(actual);
  return retval;
}


x86 assembly (clang, -O0):
<testAllWhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <trimWhitespace@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    117b <testAllWhitespace+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    11b8 <testAllWhitespace+0x88>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    11a2 <testAllWhitespace+0x72>
movl   $0x1,-0x24(%rbp)
jmp    11a9 <testAllWhitespace+0x79>
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAllWhitespace>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
call   1040 <trimWhitespace@plt>
test   %rax,%rax
je     1169 <testAllWhitespace+0x39>
mov    %rax,%rbx
lea    0xebf(%rip),%rdi
mov    %rax,%rsi
call   1050 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
sete   %bpl
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    116b <testAllWhitespace+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c" \09 \0B \0C \0D \0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @testAllWhitespace() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* null, i8** %4
%6 = load i8*, i8** %2
%7 = call i8* @trimWhitespace(i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp eq i8* null, %8
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 0, i32* %1
br label %22
11: ; preds = %0
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp eq i64 0, %14
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 1, i32* %5
br label %18
17: ; preds = %11
store i32 0, i32* %5
br label %18
18: ; preds = %17, %16
%19 = load i8*, i8** %4
%20 = call i32 @free(i8* %19)
%21 = load i32, i32* %5
store i32 %21, i32* %1
br label %22
22: ; preds = %18, %10
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [14 x i8] c" \09 \0B \0C \0D \0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @testAllWhitespace() {
%1 = tail call i8* @trimWhitespace(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i64 @strcmp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @free(i8* %1)
br label %8
8: ; preds = %0, %3
%9 = phi i32 [ %6, %3 ], [ 0, %0 ]
ret i32 %9
}