#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*/ mu_assert(char *, int);
scalar_t__ strcmp(char *, char *);
size_t trimwhitespace(char *, char *);
char *test_trimwhitespace1() {
  char str[] = "  dt  ";
  char out[20];
  size_t size = trimwhitespace(out, str);
  mu_assert("1: size != 2", size == 2);
  mu_assert("1: after trim str != dt", strcmp(out, "dt") == 0);
  return 0;
}


x86 assembly (clang, -O0):
<test_trimwhitespace1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x7(%rbp),%rsi
call   1030 <trimwhitespace@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x2,-0x28(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe8d(%rip),%rdi
call   1050 <mu_assert@plt>
lea    -0x20(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe72(%rip),%rdi
call   1050 <mu_assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_trimwhitespace1>:
push   %rbx
sub    $0x30,%rsp
movl   $0x202074,0xb(%rsp)
movl   $0x74642020,0x8(%rsp)
74
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <trimwhitespace@plt>
xor    %esi,%esi
cmp    $0x2,%rax
sete   %sil
lea    0xe9f(%rip),%rdi
call   1050 <mu_assert@plt>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
lea    0xe88(%rip),%rdi
call   1050 <mu_assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_trimwhitespace1.str = [7 x i8] c" dt \00"
@.str = [13 x i8] c"1: size != 2\00"
@.str.1 = [24 x i8] c"1: after trim str != dt\00"
@.str.2 = [3 x i8] c"dt\00"
define i8* @test_trimwhitespace1() {
%1 = alloca [7 x i8]
%2 = alloca [20 x i8]
%3 = alloca i64
%4 = bitcast [7 x i8]* %1 to i8*
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%7 = call i64 @trimwhitespace(i8* %5, i8* %6)
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 2
%10 = zext i1 %9 to i32
%11 = call i32 @mu_assert(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @mu_assert(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i8* null
}

LLVM IR (-O2):
@__const.test_trimwhitespace1.str = [7 x i8] c" dt \00"
@.str = [13 x i8] c"1: size != 2\00"
@.str.1 = [24 x i8] c"1: after trim str != dt\00"
@.str.2 = [3 x i8] c"dt\00"
define noalias i8* @test_trimwhitespace1() {
%1 = alloca [7 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i64 @trimwhitespace(i8* %4, i8* %3)
%6 = icmp eq i64 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @mu_assert(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @mu_assert(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i8* null
}