#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 /*<<< orphan*/ strcmp(char const *, char const *);
int strlen(char const *);
int isoption(const char *text, char shortopt, const char *longopt) {
  if (text[0] != '-')
    return 0;
  if (strlen(text) == 2 && text[1] == shortopt)
    return 1;
  if (text[1] == '-' && !strcmp(text + 2, longopt))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isoption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1152 <isoption+0x32>
movl   $0x0,-0x4(%rbp)
jmp    11c2 <isoption+0xa2>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1184 <isoption+0x64>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1184 <isoption+0x64>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <isoption+0xa2>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
jne    11bb <isoption+0x9b>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11bb <isoption+0x9b>
movl   $0x1,-0x4(%rbp)
jmp    11c2 <isoption+0xa2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isoption>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebp,%ebp
cmpb   $0x2d,(%rdi)
jne    1168 <isoption+0x48>
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    0x1(%rbx),%cl
mov    $0x1,%ebp
cmp    $0x2,%eax
jne    114e <isoption+0x2e>
cmp    %r15b,%cl
je     1168 <isoption+0x48>
cmp    $0x2d,%cl
jne    1166 <isoption+0x46>
add    $0x2,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1168 <isoption+0x48>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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