#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__ checkForOption(char *, int, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ print_help();
void check_for_help(int argc, char *argv[]) {
  if (checkForOption("--help", argc, argv) ||
      checkForOption("-h", argc, argv) || checkForOption("-help", argc, argv)) {
    print_help();
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_for_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeb3(%rip),%rdi
call   1030 <checkForOption@plt>
cmp    $0x0,%rax
jne    1196 <check_for_help+0x66>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe9d(%rip),%rdi
call   1030 <checkForOption@plt>
cmp    $0x0,%rax
jne    1196 <check_for_help+0x66>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe7a(%rip),%rdi
call   1030 <checkForOption@plt>
cmp    $0x0,%rax
je     11a7 <check_for_help+0x77>
mov    $0x0,%al
call   1040 <print_help@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_help>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <checkForOption@plt>
test   %rax,%rax
jne    1181 <check_for_help+0x51>
lea    0xeb2(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <checkForOption@plt>
test   %rax,%rax
jne    1181 <check_for_help+0x51>
lea    0xe96(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <checkForOption@plt>
test   %rax,%rax
jne    1181 <check_for_help+0x51>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1040 <print_help@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [6 x i8] c"-help\00"
define void @check_for_help(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 = load i8**, i8*** %4
%7 = call i64 @checkForOption(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i8** %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i8**, i8*** %4
%12 = call i64 @checkForOption(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10, i8** %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = load i8**, i8*** %4
%17 = call i64 @checkForOption(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %15, i8** %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %14, %9, %2
%20 = call i32 (...) @print_help()
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %14
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [6 x i8] c"-help\00"
define void @check_for_help(i32 %0, i8** %1) {
%3 = tail call i64 @checkForOption(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i64 @checkForOption(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0, i8** %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i64 @checkForOption(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %0, i8** %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8, %5, %2
%12 = tail call i32 (...) @print_help()
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %8
ret void
}