#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 */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ trimwhitespace(char *, char *);
char *test_trimwhitespace3() {
  char str[] = "  dt";
  char out[40];
  trimwhitespace(out, str);
  do {
    if (!(strcmp(out, "dt") == 0))
      return "3: after trim str != dt";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_trimwhitespace3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0xd(%rbp),%rsi
call   1030 <trimwhitespace@plt>
lea    -0x40(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1171 <test_trimwhitespace3+0x51>
lea    0xe9d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    117e <test_trimwhitespace3+0x5e>
jmp    1176 <test_trimwhitespace3+0x56>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_trimwhitespace3>:
push   %rbx
sub    $0x40,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x74642020,0x8(%rsp)
74
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <trimwhitespace@plt>
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xea8(%rip),%rcx
cmovne %rcx,%rax
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.test_trimwhitespace3.str = [5 x i8] c" dt\00"
@.str = [3 x i8] c"dt\00"
@.str.1 = [24 x i8] c"3: after trim str != dt\00"
define i8* @test_trimwhitespace3() {
%1 = alloca [5 x i8]
%2 = alloca [40 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @trimwhitespace(i8* %4, i8* %3)
%6 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* null, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0)
ret i8* %8
}