#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 stringEqual(char const *, char *);
int helpRequested(int argc, const char **argv) {
  if (argc != 2)
    return 0;
  const char *arg = argv[1];
  int requested;
  requested = stringEqual(arg, "--help");
  requested = requested || stringEqual(arg, "-help");
  return requested;
}


x86 assembly (clang, -O0):
<helpRequested>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1135 <helpRequested+0x25>
movl   $0x0,-0x4(%rbp)
jmp    118d <helpRequested+0x7d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <stringEqual@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jne    117c <helpRequested+0x6c>
mov    -0x18(%rbp),%rdi
lea    0xe93(%rip),%rsi
call   1030 <stringEqual@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpRequested>:
push   %rbx
xor    %eax,%eax
cmp    $0x2,%edi
jne    1136 <helpRequested+0x26>
mov    0x8(%rsi),%rbx
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <stringEqual@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1138 <helpRequested+0x28>
pop    %rbx
ret
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <stringEqual@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [6 x i8] c"-help\00"
define i32 @helpRequested(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %27
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = call i32 @stringEqual(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = icmp ne i32 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %11
%20 = load i8*, i8** %6
%21 = call i32 @stringEqual(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %19, %11
%24 = phi i1 [ true, %11 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
store i32 %25, i32* %7
%26 = load i32, i32* %7
store i32 %26, i32* %3
br label %27
27: ; preds = %23, %10
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [6 x i8] c"-help\00"
define i32 @helpRequested(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @stringEqual(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = tail call i32 @stringEqual(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %4, %9, %2
%14 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %12, %9 ]
ret i32 %14
}