#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 *, char *);
int derniereOption(int argc, char **argv) {
  argc--;
  while (argc > 0 && (argv[argc][0] != '-' || !strcmp(argv[argc], "-r") ||
                      !strcmp(argv[argc], "-i") || !strcmp(argv[argc], "-o") ||
                      !strcmp(argv[argc], "-lo") || !strcmp(argv[argc], "-li")))
    argc--;
  return argc;
}


x86 assembly (clang, -O0):
<derniereOption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jle    121d <derniereOption+0x10d>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x12(%rbp)
jne    1217 <derniereOption+0x107>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe99(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1217 <derniereOption+0x107>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe74(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1217 <derniereOption+0x107>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe4f(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1217 <derniereOption+0x107>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe2a(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1217 <derniereOption+0x107>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe06(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    122d <derniereOption+0x11d>
jmp    123b <derniereOption+0x12b>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <derniereOption+0x18>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derniereOption>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    -0x1(%rdi),%ebx
cmp    $0x2,%edi
jl     11be <derniereOption+0xae>
mov    %rsi,%r14
mov    %ebx,%ebx
lea    0xecd(%rip),%r15
lea    0xec9(%rip),%r12
lea    0xec5(%rip),%r13
jmp    115d <derniereOption+0x4d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%rbx),%rax
cmp    $0x1,%rbx
mov    %rax,%rbx
jle    11bc <derniereOption+0xac>
mov    (%r14,%rbx,8),%rbp
cmpb   $0x2d,0x0(%rbp)
jne    1150 <derniereOption+0x40>
mov    %rbp,%rdi
mov    %r15,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1150 <derniereOption+0x40>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1150 <derniereOption+0x40>
mov    %rbp,%rdi
mov    %r13,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1150 <derniereOption+0x40>
mov    %rbp,%rdi
lea    0xe6b(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1150 <derniereOption+0x40>
mov    %rbp,%rdi
lea    0xe5c(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1150 <derniereOption+0x40>
jmp    11be <derniereOption+0xae>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-r\00"
@.str.1 = [3 x i8] c"-i\00"
@.str.2 = [3 x i8] c"-o\00"
@.str.3 = [4 x i8] c"-lo\00"
@.str.4 = [4 x i8] c"-li\00"
define i32 @derniereOption(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, -1
store i32 %6, i32* %3
br label %7
7: ; preds = %65, %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %63
10: ; preds = %7
%11 = load i8**, i8*** %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 45
br i1 %19, label %61, label %20
20: ; preds = %10
%21 = load i8**, i8*** %4
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %61
28: ; preds = %20
%29 = load i8**, i8*** %4
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %61
36: ; preds = %28
%37 = load i8**, i8*** %4
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %37, i64 %39
%41 = load i8*, i8** %40
%42 = call i32 @strcmp(i8* %41, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %61
44: ; preds = %36
%45 = load i8**, i8*** %4
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8*, i8** %45, i64 %47
%49 = load i8*, i8** %48
%50 = call i32 @strcmp(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%51 = icmp ne i32 %50, 0
br i1 %51, label %52, label %61
52: ; preds = %44
%53 = load i8**, i8*** %4
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %53, i64 %55
%57 = load i8*, i8** %56
%58 = call i32 @strcmp(i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%59 = icmp ne i32 %58, 0
%60 = xor i1 %59, true
br label %61
61: ; preds = %52, %44, %36, %28, %20, %10
%62 = phi i1 [ true, %44 ], [ true, %36 ], [ true, %28 ], [ true, %20 ], [ true, %10 ], [ %60, %52 ]
br label %63
63: ; preds = %61, %7
%64 = phi i1 [ false, %7 ], [ %62, %61 ]
br i1 %64, label %65, label %68
65: ; preds = %63
%66 = load i32, i32* %3
%67 = add nsw i32 %66, -1
store i32 %67, i32* %3
br label %7
68: ; preds = %63
%69 = load i32, i32* %3
ret i32 %69
}

LLVM IR (-O2):
@.str = [3 x i8] c"-r\00"
@.str.1 = [3 x i8] c"-i\00"
@.str.2 = [3 x i8] c"-o\00"
@.str.3 = [4 x i8] c"-lo\00"
@.str.4 = [4 x i8] c"-li\00"
define i32 @derniereOption(i32 %0, i8** nocapture %1) {
%3 = add i32 %0, -1
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %33
5: ; preds = %2
%6 = zext i32 %3 to i64
br label %7
7: ; preds = %5, %28
%8 = phi i64 [ %6, %5 ], [ %29, %28 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %28
13: ; preds = %7
%14 = tail call i32 @strcmp(i8* %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %28, label %16
16: ; preds = %13
%17 = tail call i32 @strcmp(i8* %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %28, label %19
19: ; preds = %16
%20 = tail call i32 @strcmp(i8* %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %28, label %22
22: ; preds = %19
%23 = tail call i32 @strcmp(i8* %10, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = tail call i32 @strcmp(i8* %10, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %7, %13, %16, %19, %22, %25
%29 = add nsw i64 %8, -1
%30 = icmp sgt i64 %8, 1
br i1 %30, label %7, label %33
31: ; preds = %25
%32 = trunc i64 %8 to i32
br label %33
33: ; preds = %28, %31, %2
%34 = phi i32 [ %3, %2 ], [ %32, %31 ], [ 0, %28 ]
ret i32 %34
}