#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*/ exit(int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
void parseend(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; i++) {
    if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) {
      exit(0);
    }
  }
}


x86 assembly (clang, -O0):
<parseend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a0 <parseend+0x80>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xeab(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1186 <parseend+0x66>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe90(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    118d <parseend+0x6d>
xor    %edi,%edi
call   1040 <exit@plt>
jmp    1192 <parseend+0x72>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <parseend+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseend>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    $0x2,%edi
jl     117d <parseend+0x5d>
mov    %rsi,%r13
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xec0(%rip),%r14
lea    0xec0(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,8),%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1187 <parseend+0x67>
mov    0x0(%r13,%rbx,8),%rdi
mov    %r15,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1187 <parseend+0x67>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1150 <parseend+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
xor    %edi,%edi
call   1040 <exit@plt>

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

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