#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 TruncStrCmp(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ len(char *);
int IsTrain(char *str) {
  int retVal;
  retVal = TruncStrCmp(len("Train"), str, "train");
  if (!retVal) {
    retVal = TruncStrCmp(len("Train"), str, "Train");
  }
  if (retVal < 1)
    return 0;
  return retVal;
}


x86 assembly (clang, -O0):
<IsTrain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <len@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
lea    0xec1(%rip),%rdx
call   1040 <TruncStrCmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1178 <IsTrain+0x58>
lea    0xea2(%rip),%rdi
call   1030 <len@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
lea    0xe90(%rip),%rdx
call   1040 <TruncStrCmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jge    118e <IsTrain+0x6e>
movl   $0x0,-0x4(%rbp)
jmp    1194 <IsTrain+0x74>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsTrain>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
call   1030 <len@plt>
lea    0xecc(%rip),%rdx
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <TruncStrCmp@plt>
test   %eax,%eax
jne    1164 <IsTrain+0x44>
lea    0xeb1(%rip),%r14
mov    %r14,%rdi
call   1030 <len@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <TruncStrCmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
cmovns %eax,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Train\00"
@.str.1 = [6 x i8] c"train\00"
define i32 @IsTrain(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = call i32 @len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 @TruncStrCmp(i32 %5, i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = call i32 @len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %3
%13 = call i32 @TruncStrCmp(i32 %11, i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %13, i32* %4
br label %14
14: ; preds = %10, %1
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 0, i32* %2
br label %20
18: ; preds = %14
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %17
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [6 x i8] c"Train\00"
@.str.1 = [6 x i8] c"train\00"
define i32 @IsTrain(i8* %0) {
%2 = tail call i32 @len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @TruncStrCmp(i32 %2, i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @len(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @TruncStrCmp(i32 %6, i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
%9 = phi i32 [ %3, %1 ], [ %7, %5 ]
%10 = icmp sgt i32 %9, 0
%11 = select i1 %10, i32 %9, i32 0
ret i32 %11
}