#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*/ add_cmdline_include(char *);
int /*<<< orphan*/ add_pre_buffer(char *, char *);
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ strcmp(char *, char *);
char **handle_switch_i(char *arg, char **next) {
  if (*next && !strcmp(arg, "include"))
    add_cmdline_include(*++next);
  else if (*next && !strcmp(arg, "imacros"))
    add_cmdline_include(*++next);
  else if (*next && !strcmp(arg, "isystem")) {
    char *path = *++next;
    if (!path)
      die("missing argument for -isystem option");
    add_pre_buffer("#add_isystem \"%s/\"\n", path);
  } else if (*next && !strcmp(arg, "idirafter")) {
    char *path = *++next;
    if (!path)
      die("missing argument for -idirafter option");
    add_pre_buffer("#add_dirafter \"%s/\"\n", path);
  }
  return next;
}


x86 assembly (clang, -O0):
<handle_switch_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1194 <handle_switch_i+0x54>
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1194 <handle_switch_i+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1050 <add_cmdline_include@plt>
jmp    12b6 <handle_switch_i+0x176>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     11d8 <handle_switch_i+0x98>
mov    -0x8(%rbp),%rdi
lea    0xe5b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11d8 <handle_switch_i+0x98>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1050 <add_cmdline_include@plt>
jmp    12b1 <handle_switch_i+0x171>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1242 <handle_switch_i+0x102>
mov    -0x8(%rbp),%rdi
lea    0xe1f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1242 <handle_switch_i+0x102>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    122d <handle_switch_i+0xed>
lea    0xdf0(%rip),%rdi
call   1060 <die@plt>
mov    -0x18(%rbp),%rsi
lea    0xe05(%rip),%rdi
call   1030 <add_pre_buffer@plt>
jmp    12ac <handle_switch_i+0x16c>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     12a7 <handle_switch_i+0x167>
mov    -0x8(%rbp),%rdi
lea    0xdf6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12a7 <handle_switch_i+0x167>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1297 <handle_switch_i+0x157>
lea    0xdc9(%rip),%rdi
call   1060 <die@plt>
mov    -0x20(%rbp),%rsi
lea    0xde0(%rip),%rdi
call   1030 <add_pre_buffer@plt>
jmp    12ac <handle_switch_i+0x16c>
jmp    12b1 <handle_switch_i+0x171>
jmp    12b6 <handle_switch_i+0x176>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_switch_i>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
cmpq   $0x0,(%rsi)
je     11f6 <handle_switch_i+0xb6>
mov    %rdi,%rbx
lea    0xea5(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11bf <handle_switch_i+0x7f>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11bf <handle_switch_i+0x7f>
lea    0xe92(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11ce <handle_switch_i+0x8e>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    11f6 <handle_switch_i+0xb6>
mov    0x8(%r14),%rbx
test   %rbx,%rbx
jne    11b2 <handle_switch_i+0x72>
lea    0xeae(%rip),%rdi
call   1060 <die@plt>
add    $0x8,%r14
lea    0xec5(%rip),%rdi
jmp    11ee <handle_switch_i+0xae>
mov    0x8(%r14),%rdi
add    $0x8,%r14
call   1050 <add_cmdline_include@plt>
jmp    11f6 <handle_switch_i+0xb6>
mov    0x8(%r14),%rbx
test   %rbx,%rbx
jne    11e3 <handle_switch_i+0xa3>
lea    0xe3a(%rip),%rdi
call   1060 <die@plt>
add    $0x8,%r14
lea    0xe4f(%rip),%rdi
mov    %rbx,%rsi
call   1030 <add_pre_buffer@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"include\00"
@.str.1 = [8 x i8] c"imacros\00"
@.str.2 = [8 x i8] c"isystem\00"
@.str.3 = [37 x i8] c"missing argument for -isystem option\00"
@.str.4 = [20 x i8] c"#add_isystem \22%s/\22\0A\00"
@.str.5 = [10 x i8] c"idirafter\00"
@.str.6 = [39 x i8] c"missing argument for -idirafter option\00"
@.str.7 = [21 x i8] c"#add_dirafter \22%s/\22\0A\00"
define i8** @handle_switch_i(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %10
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %4
%17 = load i8*, i8** %16
%18 = call i32 @add_cmdline_include(i8* %17)
br label %73
19: ; preds = %10, %2
%20 = load i8**, i8*** %4
%21 = load i8*, i8** %20
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %32
23: ; preds = %19
%24 = load i8*, i8** %3
%25 = call i32 @strcmp(i8* %24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp ne i32 %25, 0
br i1 %26, label %32, label %27
27: ; preds = %23
%28 = load i8**, i8*** %4
%29 = getelementptr inbounds i8*, i8** %28, i32 1
store i8** %29, i8*** %4
%30 = load i8*, i8** %29
%31 = call i32 @add_cmdline_include(i8* %30)
br label %72
32: ; preds = %23, %19
%33 = load i8**, i8*** %4
%34 = load i8*, i8** %33
%35 = icmp ne i8* %34, null
br i1 %35, label %36, label %51
36: ; preds = %32
%37 = load i8*, i8** %3
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %51, label %40
40: ; preds = %36
%41 = load i8**, i8*** %4
%42 = getelementptr inbounds i8*, i8** %41, i32 1
store i8** %42, i8*** %4
%43 = load i8*, i8** %42
store i8* %43, i8** %5
%44 = load i8*, i8** %5
%45 = icmp ne i8* %44, null
br i1 %45, label %48, label %46
46: ; preds = %40
%47 = call i32 @die(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
br label %48
48: ; preds = %46, %40
%49 = load i8*, i8** %5
%50 = call i32 @add_pre_buffer(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %49)
br label %71
51: ; preds = %36, %32
%52 = load i8**, i8*** %4
%53 = load i8*, i8** %52
%54 = icmp ne i8* %53, null
br i1 %54, label %55, label %70
55: ; preds = %51
%56 = load i8*, i8** %3
%57 = call i32 @strcmp(i8* %56, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%58 = icmp ne i32 %57, 0
br i1 %58, label %70, label %59
59: ; preds = %55
%60 = load i8**, i8*** %4
%61 = getelementptr inbounds i8*, i8** %60, i32 1
store i8** %61, i8*** %4
%62 = load i8*, i8** %61
store i8* %62, i8** %6
%63 = load i8*, i8** %6
%64 = icmp ne i8* %63, null
br i1 %64, label %67, label %65
65: ; preds = %59
%66 = call i32 @die(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
br label %67
67: ; preds = %65, %59
%68 = load i8*, i8** %6
%69 = call i32 @add_pre_buffer(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %68)
br label %70
70: ; preds = %67, %55, %51
br label %71
71: ; preds = %70, %48
br label %72
72: ; preds = %71, %27
br label %73
73: ; preds = %72, %14
%74 = load i8**, i8*** %4
ret i8** %74
}

LLVM IR (-O2):
@.str = [8 x i8] c"include\00"
@.str.1 = [8 x i8] c"imacros\00"
@.str.2 = [8 x i8] c"isystem\00"
@.str.3 = [37 x i8] c"missing argument for -isystem option\00"
@.str.4 = [20 x i8] c"#add_isystem \22%s/\22\0A\00"
@.str.5 = [10 x i8] c"idirafter\00"
@.str.6 = [39 x i8] c"missing argument for -idirafter option\00"
@.str.7 = [21 x i8] c"#add_dirafter \22%s/\22\0A\00"
define i8** @handle_switch_i(i8* nocapture %0, i8** %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %41, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @add_cmdline_include(i8* %10)
br label %41
12: ; preds = %5
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = tail call i32 @add_cmdline_include(i8* %17)
br label %41
19: ; preds = %12
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %30
22: ; preds = %19
%23 = getelementptr inbounds i8*, i8** %1, i64 1
%24 = load i8*, i8** %23
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = tail call i32 @die(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = tail call i32 @add_pre_buffer(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %24)
br label %41
30: ; preds = %19
%31 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(10) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %41
33: ; preds = %30
%34 = getelementptr inbounds i8*, i8** %1, i64 1
%35 = load i8*, i8** %34
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = tail call i32 @die(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
br label %39
39: ; preds = %37, %33
%40 = tail call i32 @add_pre_buffer(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0), i8* %35)
br label %41
41: ; preds = %2, %15, %30, %39, %28, %8
%42 = phi i8** [ %1, %30 ], [ %34, %39 ], [ %23, %28 ], [ %16, %15 ], [ %9, %8 ], [ %1, %2 ]
ret i8** %42
}