#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*/ assert_equal_str(char *, char *, char *, char *);
int /*<<< orphan*/ free(char *);
char *pl_strip(char *, int /*<<< orphan*/ *);
void test_strip_no_chars() {
  char the_string[] = "   aaabbbccc";
  char str2[] = "aaabbbccc   ";
  char str3[] = "   aaabbbccc   ";
  char str4[] = "\n\r\t\v\f aaabbbccc    \f\v\r\n\t";
  char *ret_val;
  ret_val = pl_strip(the_string, NULL);
  assert_equal_str("aaabbbccc", ret_val, "test_strip_no_chars",
                   "Test 1: Strings are not equal.");
  free(ret_val);
  ret_val = pl_strip(str2, NULL);
  assert_equal_str("aaabbbccc", ret_val, "test_strip_no_chars",
                   "Test 2: Strings are not equal.");
  free(ret_val);
  ret_val = pl_strip(str3, NULL);
  assert_equal_str("aaabbbccc", ret_val, "test_strip_no_chars",
                   "Test 3: Strings are not equal.");
  free(ret_val);
  ret_val = pl_strip(str4, NULL);
  assert_equal_str("aaabbbccc", ret_val, "test_strip_no_chars",
                   "Test 4: Strings are not equal.");
  free(ret_val);
}


x86 assembly (clang, -O0):
<test_strip_no_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xeaf(%rip),%eax
mov    %eax,-0x12(%rbp)
mov    0xeaa(%rip),%al
mov    %al,-0xe(%rbp)
mov    0xf37(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xf34(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xf31(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xf2e(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xf2b(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xf29(%rip),%al
mov    %al,-0x38(%rbp)
lea    -0xd(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pl_strip@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rsi
lea    0xe35(%rip),%rdi
lea    0xe45(%rip),%rdx
lea    0xe52(%rip),%rcx
call   1040 <assert_equal_str@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
lea    -0x1a(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pl_strip@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rsi
lea    0xdfd(%rip),%rdi
lea    0xe0d(%rip),%rdx
lea    0xe39(%rip),%rcx
call   1040 <assert_equal_str@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
lea    -0x30(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pl_strip@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rsi
lea    0xdc5(%rip),%rdi
lea    0xdd5(%rip),%rdx
lea    0xe20(%rip),%rcx
call   1040 <assert_equal_str@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
lea    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pl_strip@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rsi
lea    0xd8d(%rip),%rdi
lea    0xd9d(%rip),%rdx
lea    0xe07(%rip),%rcx
call   1040 <assert_equal_str@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strip_no_chars>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
movabs $0x63636362626261,%rax
mov    %rax,0x15(%rsp)
movabs $0x6262616161202020,%rax
61 62 62
mov    %rax,0x10(%rsp)
movabs $0x20202063636362,%rax
mov    %rax,0x5(%rsp)
movabs $0x6363626262616161,%rax
62 63 63
mov    %rax,(%rsp)
movaps 0xf35(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xf42(%rip),%xmm0
movups %xmm0,0x39(%rsp)
movaps 0xf2d(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   1050 <pl_strip@plt>
mov    %rax,%rbx
lea    0xe55(%rip),%r15
lea    0xe65(%rip),%r14
lea    0xe72(%rip),%rcx
mov    %r15,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <assert_equal_str@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rsp,%rdi
xor    %esi,%esi
call   1050 <pl_strip@plt>
mov    %rax,%rbx
lea    0xe67(%rip),%rcx
mov    %r15,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <assert_equal_str@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0x20(%rsp),%rdi
xor    %esi,%esi
call   1050 <pl_strip@plt>
mov    %rax,%rbx
lea    0xe5a(%rip),%rcx
mov    %r15,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <assert_equal_str@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0x30(%rsp),%rdi
xor    %esi,%esi
call   1050 <pl_strip@plt>
mov    %rax,%rbx
lea    0xe4d(%rip),%rcx
mov    %r15,%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <assert_equal_str@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.test_strip_no_chars.the_string = [13 x i8] c" aaabbbccc\00"
@__const.test_strip_no_chars.str2 = [13 x i8] c"aaabbbccc \00"
@__const.test_strip_no_chars.str3 = [16 x i8] c" aaabbbccc \00"
@__const.test_strip_no_chars.str4 = [25 x i8] c"\0A\0D\09\0B\0C aaabbbccc \0C\0B\0D\0A\09\00"
@.str = [10 x i8] c"aaabbbccc\00"
@.str.1 = [20 x i8] c"test_strip_no_chars\00"
@.str.2 = [31 x i8] c"Test 1: Strings are not equal.\00"
@.str.3 = [31 x i8] c"Test 2: Strings are not equal.\00"
@.str.4 = [31 x i8] c"Test 3: Strings are not equal.\00"
@.str.5 = [31 x i8] c"Test 4: Strings are not equal.\00"
define void @test_strip_no_chars() {
%1 = alloca [13 x i8]
%2 = alloca [13 x i8]
%3 = alloca [16 x i8]
%4 = alloca [25 x i8]
%5 = alloca i8*
%6 = bitcast [13 x i8]* %1 to i8*
%7 = bitcast [13 x i8]* %2 to i8*
%8 = bitcast [16 x i8]* %3 to i8*
%9 = bitcast [25 x i8]* %4 to i8*
%10 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%11 = call i8* @pl_strip(i8* %10, i32* null)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = call i32 @assert_equal_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%14 = load i8*, i8** %5
%15 = call i32 @free(i8* %14)
%16 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%17 = call i8* @pl_strip(i8* %16, i32* null)
store i8* %17, i8** %5
%18 = load i8*, i8** %5
%19 = call i32 @assert_equal_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %18, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%20 = load i8*, i8** %5
%21 = call i32 @free(i8* %20)
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%23 = call i8* @pl_strip(i8* %22, i32* null)
store i8* %23, i8** %5
%24 = load i8*, i8** %5
%25 = call i32 @assert_equal_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %24, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%26 = load i8*, i8** %5
%27 = call i32 @free(i8* %26)
%28 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%29 = call i8* @pl_strip(i8* %28, i32* null)
store i8* %29, i8** %5
%30 = load i8*, i8** %5
%31 = call i32 @assert_equal_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %30, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%32 = load i8*, i8** %5
%33 = call i32 @free(i8* %32)
ret void
}

LLVM IR (-O2):
@__const.test_strip_no_chars.the_string = [13 x i8] c" aaabbbccc\00"
@__const.test_strip_no_chars.str2 = [13 x i8] c"aaabbbccc \00"
@__const.test_strip_no_chars.str3 = [16 x i8] c" aaabbbccc \00"
@__const.test_strip_no_chars.str4 = [25 x i8] c"\0A\0D\09\0B\0C aaabbbccc \0C\0B\0D\0A\09\00"
@.str = [10 x i8] c"aaabbbccc\00"
@.str.1 = [20 x i8] c"test_strip_no_chars\00"
@.str.2 = [31 x i8] c"Test 1: Strings are not equal.\00"
@.str.3 = [31 x i8] c"Test 2: Strings are not equal.\00"
@.str.4 = [31 x i8] c"Test 3: Strings are not equal.\00"
@.str.5 = [31 x i8] c"Test 4: Strings are not equal.\00"
define void @test_strip_no_chars() {
%1 = alloca [13 x i8]
%2 = alloca [13 x i8]
%3 = alloca [16 x i8]
%4 = alloca [25 x i8]
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%9 = call i8* @pl_strip(i8* %5, i32* null)
%10 = call i32 @assert_equal_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @free(i8* %9)
%12 = call i8* @pl_strip(i8* %6, i32* null)
%13 = call i32 @assert_equal_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @free(i8* %12)
%15 = call i8* @pl_strip(i8* %7, i32* null)
%16 = call i32 @assert_equal_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %15, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @free(i8* %15)
%18 = call i8* @pl_strip(i8* %8, i32* null)
%19 = call i32 @assert_equal_str(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %18, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 @free(i8* %18)
ret void
}