#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 const *const);
int lc_read_flag(int const argc, char **argv, char const *const er_long,
                 char const *const er_short) {
  for (int er_parse = 0; er_parse < argc; er_parse++) {
    if ((strcmp(argv[er_parse], er_long) == 0) ||
        (strcmp(argv[er_parse], er_short) == 0)) {
      return ((1));
    }
  }
  return ((0));
}


x86 assembly (clang, -O0):
<lc_read_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1197 <lc_read_flag+0x87>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1178 <lc_read_flag+0x68>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1184 <lc_read_flag+0x74>
movl   $0x1,-0x4(%rbp)
jmp    119e <lc_read_flag+0x8e>
jmp    1189 <lc_read_flag+0x79>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112e <lc_read_flag+0x1e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lc_read_flag>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    116d <lc_read_flag+0x5d>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r13
mov    %edi,%r12d
xor    %ebx,%ebx
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x0(%r13,%rbx,8),%rdi
mov    %r15,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     116f <lc_read_flag+0x5f>
mov    0x0(%r13,%rbx,8),%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     116f <lc_read_flag+0x5f>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <lc_read_flag+0x30>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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