#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_trimwhitespace2() {
  char str[] = "dt";
  char out[40];
  trimwhitespace(out, str);
  do {
    if (!(strcmp(out, "dt") == 0))
      return "2: after trim str != dt";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_trimwhitespace2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xee6(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xede(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1030 <trimwhitespace@plt>
lea    -0x40(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1173 <test_trimwhitespace2+0x53>
lea    0xe96(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1180 <test_trimwhitespace2+0x60>
jmp    1178 <test_trimwhitespace2+0x58>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_trimwhitespace2>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movb   $0x0,0xe(%rsp)
movw   $0x7464,0xc(%rsp)
lea    0xedb(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <trimwhitespace@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xe9f(%rip),%rcx
cmovne %rcx,%rax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.test_trimwhitespace2.str = [3 x i8] c"dt\00"
@.str = [3 x i8] c"dt\00"
@.str.1 = [24 x i8] c"2: after trim str != dt\00"
define i8* @test_trimwhitespace2() {
%1 = alloca i8*
%2 = alloca [3 x i8]
%3 = alloca [40 x i8]
%4 = bitcast [3 x i8]* %2 to i8*
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [3 x i8], [3 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):
@.str = [3 x i8] c"dt\00"
@.str.1 = [24 x i8] c"2: after trim str != dt\00"
define i8* @test_trimwhitespace2() {
%1 = alloca [3 x i8]
%2 = alloca [40 x i8]
%3 = getelementptr inbounds [3 x i8], [3 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
}