#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 file_is_verse_source(char *name, int namelen) {
  if (namelen < 4) {
    return 0;
  }
  if (strcmp(name + namelen - 3, ".vs")) {
    return 0;
  }
  if (namelen > 9 && !strcmp(name + namelen - 8, "_test.vs")) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<file_is_verse_source>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1135 <file_is_verse_source+0x25>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <file_is_verse_source+0x98>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1166 <file_is_verse_source+0x56>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <file_is_verse_source+0x98>
cmpl   $0x9,-0x14(%rbp)
jle    11a1 <file_is_verse_source+0x91>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
lea    0xe7a(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11a1 <file_is_verse_source+0x91>
movl   $0x0,-0x4(%rbp)
jmp    11a8 <file_is_verse_source+0x98>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_is_verse_source>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
cmp    $0x4,%esi
jl     1165 <file_is_verse_source+0x55>
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%r15d
add    %r15,%rdi
add    $0xfffffffffffffffd,%rdi
lea    0xed0(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1165 <file_is_verse_source+0x55>
cmp    $0xa,%ebp
jb     115f <file_is_verse_source+0x4f>
add    %r15,%rbx
add    $0xfffffffffffffff8,%rbx
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1165 <file_is_verse_source+0x55>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c".vs\00"
@.str.1 = [9 x i8] c"_test.vs\00"
define i32 @file_is_verse_source(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %31
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = getelementptr inbounds i8, i8* %13, i64 -3
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %9
store i32 0, i32* %3
br label %31
18: ; preds = %9
%19 = load i32, i32* %5
%20 = icmp sgt i32 %19, 9
br i1 %20, label %21, label %30
21: ; preds = %18
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
%26 = getelementptr inbounds i8, i8* %25, i64 -8
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp ne i64 %27, 0
br i1 %28, label %30, label %29
29: ; preds = %21
store i32 0, i32* %3
br label %31
30: ; preds = %21, %18
store i32 1, i32* %3
br label %31
31: ; preds = %30, %29, %17, %8
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [4 x i8] c".vs\00"
@.str.1 = [9 x i8] c"_test.vs\00"
define i32 @file_is_verse_source(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 4
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -3
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %4
%11 = icmp ugt i32 %1, 9
br i1 %11, label %12, label %16
12: ; preds = %10
%13 = getelementptr inbounds i8, i8* %6, i64 -8
%14 = tail call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %12, %10
br label %17
17: ; preds = %12, %4, %2, %16
%18 = phi i32 [ 1, %16 ], [ 0, %2 ], [ 0, %4 ], [ 0, %12 ]
ret i32 %18
}