#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 strlen(char *);
int isDNAFileExtension(char *filePath) {
  int size = strlen(filePath);
  if (size > 4 && filePath[size - 1] == 'a' && filePath[size - 2] == 'n' &&
      filePath[size - 3] == 'd' && filePath[size - 4] == '.')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isDNAFileExtension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jle    11a6 <isDNAFileExtension+0x96>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
jne    11a6 <isDNAFileExtension+0x96>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6e,%eax
jne    11a6 <isDNAFileExtension+0x96>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x64,%eax
jne    11a6 <isDNAFileExtension+0x96>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x4,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    11a6 <isDNAFileExtension+0x96>
movl   $0x1,-0x4(%rbp)
jmp    11ad <isDNAFileExtension+0x9d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDNAFileExtension>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x5,%eax
jl     1147 <isDNAFileExtension+0x37>
lea    -0x1(%rax),%ecx
cmpb   $0x61,(%rbx,%rcx,1)
jne    1147 <isDNAFileExtension+0x37>
lea    -0x2(%rax),%ecx
cmpb   $0x6e,(%rbx,%rcx,1)
jne    1147 <isDNAFileExtension+0x37>
lea    -0x3(%rax),%ecx
cmpb   $0x64,(%rbx,%rcx,1)
jne    1147 <isDNAFileExtension+0x37>
add    $0xfffffffc,%eax
mov    $0x1,%ecx
cmpb   $0x2e,(%rbx,%rax,1)
je     1149 <isDNAFileExtension+0x39>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isDNAFileExtension(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 4
br i1 %8, label %9, label %46
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 97
br i1 %17, label %18, label %46
18: ; preds = %9
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = sub nsw i32 %20, 2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 110
br i1 %26, label %27, label %46
27: ; preds = %18
%28 = load i8*, i8** %3
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %28, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 100
br i1 %35, label %36, label %46
36: ; preds = %27
%37 = load i8*, i8** %3
%38 = load i32, i32* %4
%39 = sub nsw i32 %38, 4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i8, i8* %37, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 46
br i1 %44, label %45, label %46
45: ; preds = %36
store i32 1, i32* %2
br label %47
46: ; preds = %36, %27, %18, %9, %1
store i32 0, i32* %2
br label %47
47: ; preds = %46, %45
%48 = load i32, i32* %2
ret i32 %48
}

LLVM IR (-O2):
define i32 @isDNAFileExtension(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 4
br i1 %3, label %4, label %28
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 97
br i1 %9, label %10, label %28
10: ; preds = %4
%11 = add nsw i32 %2, -2
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 110
br i1 %15, label %16, label %28
16: ; preds = %10
%17 = add nsw i32 %2, -3
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 100
br i1 %21, label %22, label %28
22: ; preds = %16
%23 = add nsw i32 %2, -4
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %0, i64 %24
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 46
br i1 %27, label %29, label %28
28: ; preds = %22, %16, %10, %4, %1
br label %29
29: ; preds = %22, %28
%30 = phi i32 [ 0, %28 ], [ 1, %22 ]
ret i32 %30
}