#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_SUCCESS;
int /*<<< orphan*/ buildConfig_save();
int /*<<< orphan*/ buildConfig_set(char *, char *);
int /*<<< orphan*/ errors_printMessageAndExit(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printHelp();
int /*<<< orphan*/ printVersion();
scalar_t__ strcmp(char *, char *);
void handleSpecialOptions(int argc, char **args) {
  if (argc > 1) {
    if (strcmp(args[1], "--help") == 0) {
      printHelp();
    } else if (strcmp(args[1], "--version") == 0) {
      printVersion();
    } else if (strcmp(args[1], "--config") == 0) {
      if (argc < 4) {
        errors_printMessageAndExit("Two arguments expected after --config");
      }
      buildConfig_set(args[2], args[3]);
      buildConfig_save();
      exit(EXIT_SUCCESS);
    }
  }
}


x86 assembly (clang, -O0):
<handleSpecialOptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    124a <handleSpecialOptions+0xda>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe68(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11b3 <handleSpecialOptions+0x43>
mov    $0x0,%al
call   1030 <printHelp@plt>
jmp    1245 <handleSpecialOptions+0xd5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe45(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11dd <handleSpecialOptions+0x6d>
mov    $0x0,%al
call   1070 <printVersion@plt>
jmp    1240 <handleSpecialOptions+0xd0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe42(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    123b <handleSpecialOptions+0xcb>
cmpl   $0x4,-0x4(%rbp)
jge    1211 <handleSpecialOptions+0xa1>
lea    0xe05(%rip),%rdi
call   1090 <errors_printMessageAndExit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
call   1040 <buildConfig_set@plt>
mov    $0x0,%al
call   1050 <buildConfig_save@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    1240 <handleSpecialOptions+0xd0>
jmp    1245 <handleSpecialOptions+0xd5>
jmp    124a <handleSpecialOptions+0xda>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleSpecialOptions>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11bc <handleSpecialOptions+0x4c>
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe78(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11c3 <handleSpecialOptions+0x53>
mov    0x8(%rbx),%rdi
lea    0xe6a(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11d0 <handleSpecialOptions+0x60>
mov    0x8(%rbx),%rdi
lea    0xe7c(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11dd <handleSpecialOptions+0x6d>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printHelp@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <printVersion@plt>
cmp    $0x3,%ebp
ja     11ee <handleSpecialOptions+0x7e>
lea    0xe28(%rip),%rdi
call   1090 <errors_printMessageAndExit@plt>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
call   1040 <buildConfig_set@plt>
xor    %eax,%eax
call   1050 <buildConfig_save@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [10 x i8] c"--version\00"
@.str.2 = [9 x i8] c"--config\00"
@.str.3 = [38 x i8] c"Two arguments expected after --config\00"
@EXIT_SUCCESS = global i32 0
define void @handleSpecialOptions(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 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %48
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 (...) @printHelp()
br label %47
15: ; preds = %7
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = call i32 (...) @printVersion()
br label %46
23: ; preds = %15
%24 = load i8**, i8*** %4
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %45
29: ; preds = %23
%30 = load i32, i32* %3
%31 = icmp slt i32 %30, 4
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @errors_printMessageAndExit(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
%35 = load i8**, i8*** %4
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = load i8**, i8*** %4
%39 = getelementptr inbounds i8*, i8** %38, i64 3
%40 = load i8*, i8** %39
%41 = call i32 @buildConfig_set(i8* %37, i8* %40)
%42 = call i32 (...) @buildConfig_save()
%43 = load i32, i32* @EXIT_SUCCESS
%44 = call i32 @exit(i32 %43)
unreachable
45: ; preds = %23
br label %46
46: ; preds = %45, %21
br label %47
47: ; preds = %46, %13
br label %48
48: ; preds = %47, %2
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [10 x i8] c"--version\00"
@.str.2 = [9 x i8] c"--config\00"
@.str.3 = [38 x i8] c"Two arguments expected after --config\00"
@EXIT_SUCCESS = global i32 0
define void @handleSpecialOptions(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %34
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @printHelp()
br label %34
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = tail call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = tail call i32 (...) @printVersion()
br label %34
17: ; preds = %11
%18 = load i8*, i8** %5
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %34
21: ; preds = %17
%22 = icmp ult i32 %0, 4
br i1 %22, label %23, label %25
23: ; preds = %21
%24 = tail call i32 @errors_printMessageAndExit(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
%26 = getelementptr inbounds i8*, i8** %1, i64 2
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8*, i8** %1, i64 3
%29 = load i8*, i8** %28
%30 = tail call i32 @buildConfig_set(i8* %27, i8* %29)
%31 = tail call i32 (...) @buildConfig_save()
%32 = load i32, i32* @EXIT_SUCCESS
%33 = tail call i32 @exit(i32 %32)
unreachable
34: ; preds = %9, %17, %15, %2
ret void
}