#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*/ printHelp(char **);
int /*<<< orphan*/ printVersion(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int processParam(int argc, char *argv[]) {
  int argc_cnt;
  int errorCode = 0;
  for (argc_cnt = 1; argc_cnt < argc; argc_cnt++) {
    if (!strcmp(argv[argc_cnt], "--help")) {
      printHelp(argv);
      errorCode = 1;
      break;
    }
    if (argv[argc_cnt][0] == '-') {
      switch (argv[argc_cnt][1]) {
      case '?':
      case 'h':
        printHelp(argv);
        errorCode = 1;
        break;
      case 'v':
        printVersion(argv[0]);
        errorCode = 1;
        break;
      default:
        printHelp(argv);
        errorCode = 1;
        break;
      }
    }
  }
  return (errorCode);
}


x86 assembly (clang, -O0):
<processParam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    123f <processParam+0x10f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe94(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    118f <processParam+0x5f>
mov    -0x10(%rbp),%rdi
call   1030 <printHelp@plt>
movl   $0x1,-0x18(%rbp)
jmp    123f <processParam+0x10f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    122c <processParam+0xfc>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x3f,%eax
je     11ea <processParam+0xba>
jmp    11c8 <processParam+0x98>
mov    -0x1c(%rbp),%eax
sub    $0x68,%eax
je     11ea <processParam+0xba>
jmp    11d9 <processParam+0xa9>
mov    -0x1c(%rbp),%eax
sub    $0x76,%eax
je     11ff <processParam+0xcf>
jmp    1217 <processParam+0xe7>
mov    -0x10(%rbp),%rdi
call   1030 <printHelp@plt>
movl   $0x1,-0x18(%rbp)
jmp    1227 <processParam+0xf7>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <printVersion@plt>
movl   $0x1,-0x18(%rbp)
jmp    1227 <processParam+0xf7>
mov    -0x10(%rbp),%rdi
call   1030 <printHelp@plt>
movl   $0x1,-0x18(%rbp)
jmp    122c <processParam+0xfc>
jmp    1231 <processParam+0x101>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <processParam+0x1d>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processParam>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r15d,%r15d
cmp    $0x2,%edi
jl     11bb <processParam+0x8b>
mov    %rsi,%r13
mov    %edi,%r12d
xor    %r15d,%r15d
mov    $0x1,%ebx
lea    0xea8(%rip),%r14
jmp    117a <processParam+0x4a>
nopw   0x0(%rax,%rax,1)
cmp    $0x68,%eax
mov    %r13,%rdi
call   1030 <printHelp@plt>
mov    $0x1,%r15d
add    $0x1,%rbx
cmp    %rbx,%r12
je     11bb <processParam+0x8b>
mov    0x0(%r13,%rbx,8),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11ad <processParam+0x7d>
cmpb   $0x2d,0x0(%rbp)
jne    1171 <processParam+0x41>
movsbl 0x1(%rbp),%eax
cmp    $0x3f,%eax
je     1163 <processParam+0x33>
cmp    $0x76,%eax
jne    1160 <processParam+0x30>
mov    0x0(%r13),%rdi
call   1050 <printVersion@plt>
jmp    116b <processParam+0x3b>
mov    %r13,%rdi
call   1030 <printHelp@plt>
mov    $0x1,%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
define i32 @processParam(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %6
store i32 1, i32* %5
br label %7
7: ; preds = %54, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %57
11: ; preds = %7
%12 = load i8**, i8*** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %11
%20 = load i8**, i8*** %4
%21 = call i32 @printHelp(i8** %20)
store i32 1, i32* %6
br label %57
22: ; preds = %11
%23 = load i8**, i8*** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 45
br i1 %31, label %32, label %53
32: ; preds = %22
%33 = load i8**, i8*** %4
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = getelementptr inbounds i8, i8* %37, i64 1
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
switch i32 %40, label %49 [
i32 63, label %41
i32 104, label %41
i32 118, label %44
]
41: ; preds = %32, %32
%42 = load i8**, i8*** %4
%43 = call i32 @printHelp(i8** %42)
store i32 1, i32* %6
br label %52
44: ; preds = %32
%45 = load i8**, i8*** %4
%46 = getelementptr inbounds i8*, i8** %45, i64 0
%47 = load i8*, i8** %46
%48 = call i32 @printVersion(i8* %47)
store i32 1, i32* %6
br label %52
49: ; preds = %32
%50 = load i8**, i8*** %4
%51 = call i32 @printHelp(i8** %50)
store i32 1, i32* %6
br label %52
52: ; preds = %49, %44, %41
br label %53
53: ; preds = %52, %22
br label %54
54: ; preds = %53
%55 = load i32, i32* %5
%56 = add nsw i32 %55, 1
store i32 %56, i32* %5
br label %7
57: ; preds = %19, %7
%58 = load i32, i32* %6
ret i32 %58
}

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