#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 isEdge(char *seq, int start, int end, int length) {
  return ((seq[0] == '-' && start <= 1) ||
          (seq[strlen(seq) - 1] == '-' && end >= length - 2));
}


x86 assembly (clang, -O0):
<isEdge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1144 <isEdge+0x34>
mov    $0x1,%al
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x15(%rbp)
jle    118a <isEdge+0x7a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x2d,%ecx
mov    %al,-0x16(%rbp)
jne    1184 <isEdge+0x74>
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
setge  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEdge>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %rdi,%rbp
cmp    $0x1,%esi
jg     112c <isEdge+0x1c>
mov    $0x1,%eax
cmpb   $0x2d,0x0(%rbp)
je     114c <isEdge+0x3c>
mov    %rbp,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x2d,-0x1(%rax,%rbp,1)
sete   %al
add    $0xfffffffe,%ebx
cmp    %r14d,%ebx
setle  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isEdge(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 45
br i1 %13, label %14, label %17
14: ; preds = %4
%15 = load i32, i32* %6
%16 = icmp sle i32 %15, 1
br i1 %16, label %34, label %17
17: ; preds = %14, %4
%18 = load i8*, i8** %5
%19 = load i8*, i8** %5
%20 = call i32 @strlen(i8* %19)
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %18, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 45
br i1 %26, label %27, label %32
27: ; preds = %17
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = sub nsw i32 %29, 2
%31 = icmp sge i32 %28, %30
br label %32
32: ; preds = %27, %17
%33 = phi i1 [ false, %17 ], [ %31, %27 ]
br label %34
34: ; preds = %32, %14
%35 = phi i1 [ true, %14 ], [ %33, %32 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @isEdge(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 45
%7 = icmp slt i32 %1, 2
%8 = and i1 %7, %6
br i1 %8, label %20, label %9
9: ; preds = %4
%10 = tail call i32 @strlen(i8* %0)
%11 = add nsw i32 %10, -1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 45
%16 = add nsw i32 %3, -2
%17 = icmp sle i32 %16, %2
%18 = select i1 %15, i1 %17, i1 false
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %4, %9
%21 = phi i32 [ %19, %9 ], [ 1, %4 ]
ret i32 %21
}