#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*/ action(char *, char *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
void parse_command_line(int argc, char *argv[]) {
  if (argc <= 1) {
    print_help();
    exit(0);
  }
  for (int i = 1; i < argc; i++) {
    if ((!strcmp(argv[i], "-h")) || (!strcmp(argv[i], "--help"))) {
      print_help();
      exit(0);
    } else if (!strcmp(argv[i], "-i")) {
      if (i + 2 < argc) {
        char *resources = argv[i + 1];
        char *app = argv[i + 2];
        action(app, resources, 1);
        exit(0);
      } else {
        printf("Not enough actual parameters for '-i' action\n");
        exit(1);
      }
    } else if (!strcmp(argv[i], "-c")) {
      if (i + 1 < argc) {
        char resources[] = "CPU";
        char *app = argv[i + 1];
        action(app, resources, 1);
        exit(0);
      } else {
        printf("Not enough actual parameters for '-c' action\n");
        exit(1);
      }
    } else if (!strcmp(argv[i], "-d")) {
      if (i + 1 < argc) {
        char resources[] = "Display";
        char *app = argv[i + 1];
        action(app, resources, 1);
        exit(0);
      } else {
        printf("Not enough actual parameters for '-d' action\n");
        exit(1);
      }
    } else if (!strcmp(argv[i], "-r")) {
      if (i + 1 < argc) {
        char *app = argv[i + 1];
        action(app, NULL, 2);
        exit(0);
      } else {
        printf("Not enough actual parameters for '-r' action\n");
        exit(1);
      }
    } else if (!strcmp(argv[i], "-s")) {
      if (i + 1 < argc) {
        char *app = argv[i + 1];
        action(app, NULL, 3);
        exit(0);
      } else {
        printf("Not enough actual parameters for '-s' action\n");
        exit(1);
      }
    } else {
      printf("Unknown argument '%s'\n", argv[i]);
      exit(1);
    }
  }
}


x86 assembly (clang, -O0):
<parse_command_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     1177 <parse_command_line+0x27>
mov    $0x0,%al
call   1050 <print_help@plt>
xor    %edi,%edi
call   1060 <exit@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1475 <parse_command_line+0x325>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe63(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     11cc <parse_command_line+0x7c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe45(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11da <parse_command_line+0x8a>
mov    $0x0,%al
call   1050 <print_help@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe1d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1265 <parse_command_line+0x115>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
cmp    -0x4(%rbp),%eax
jge    124d <parse_command_line+0xfd>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1070 <action@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdc3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12e4 <parse_command_line+0x194>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cmp    -0x4(%rbp),%eax
jge    12cc <parse_command_line+0x17c>
mov    0xda3(%rip),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x1,%edx
call   1070 <action@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd79(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1365 <parse_command_line+0x215>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cmp    -0x4(%rbp),%eax
jge    134d <parse_command_line+0x1fd>
mov    0xd58(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x1,%edx
call   1070 <action@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xd27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd31(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    13db <parse_command_line+0x28b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cmp    -0x4(%rbp),%eax
jge    13c3 <parse_command_line+0x273>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1070 <action@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xce2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xcec(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1451 <parse_command_line+0x301>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cmp    -0x4(%rbp),%eax
jge    1439 <parse_command_line+0x2e9>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x3,%edx
call   1070 <action@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xc9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xca7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_command_line>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
cmp    $0x1,%edi
jle    119c <parse_command_line+0x3c>
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x8(%rsi),%rbx
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     119c <parse_command_line+0x3c>
lea    0xe73(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    11aa <parse_command_line+0x4a>
xor    %eax,%eax
call   1060 <print_help@plt>
xor    %edi,%edi
call   1070 <exit@plt>
lea    0xe59(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    11cc <parse_command_line+0x6c>
cmp    $0x4,%ebp
jb     11f7 <parse_command_line+0x97>
mov    0x10(%r14),%rsi
mov    0x18(%r14),%rdi
jmp    1233 <parse_command_line+0xd3>
lea    0xe3a(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1203 <parse_command_line+0xa3>
cmp    $0x3,%ebp
jb     1244 <parse_command_line+0xe4>
movl   $0x555043,0x4(%rsp)
mov    0x10(%r14),%rdi
lea    0x4(%rsp),%rsi
jmp    1233 <parse_command_line+0xd3>
lea    0xe32(%rip),%rdi
jmp    12cb <parse_command_line+0x16b>
lea    0xe06(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    124d <parse_command_line+0xed>
cmp    $0x3,%ebp
jb     1272 <parse_command_line+0x112>
movabs $0x79616c70736944,%rax
mov    %rax,0x8(%rsp)
mov    0x10(%r14),%rdi
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1080 <action@plt>
xor    %edi,%edi
call   1070 <exit@plt>
lea    0xe12(%rip),%rdi
jmp    12cb <parse_command_line+0x16b>
lea    0xdbf(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    127b <parse_command_line+0x11b>
cmp    $0x3,%ebp
jb     12a0 <parse_command_line+0x140>
mov    0x10(%r14),%rdi
xor    %esi,%esi
mov    $0x2,%edx
jmp    1238 <parse_command_line+0xd8>
lea    0xe11(%rip),%rdi
jmp    12cb <parse_command_line+0x16b>
lea    0xd94(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    12a9 <parse_command_line+0x149>
cmp    $0x3,%ebp
jb     12c4 <parse_command_line+0x164>
mov    0x10(%r14),%rdi
xor    %esi,%esi
mov    $0x3,%edx
jmp    1238 <parse_command_line+0xd8>
lea    0xe10(%rip),%rdi
jmp    12cb <parse_command_line+0x16b>
lea    0xd69(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
lea    0xe19(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-i\00"
@.str.3 = [46 x i8] c"Not enough actual parameters for '-i' action\0A\00"
@.str.4 = [3 x i8] c"-c\00"
@__const.parse_command_line.resources = [4 x i8] c"CPU\00"
@.str.5 = [46 x i8] c"Not enough actual parameters for '-c' action\0A\00"
@.str.6 = [3 x i8] c"-d\00"
@__const.parse_command_line.resources.7 = [8 x i8] c"Display\00"
@.str.8 = [46 x i8] c"Not enough actual parameters for '-d' action\0A\00"
@.str.9 = [3 x i8] c"-r\00"
@.str.10 = [46 x i8] c"Not enough actual parameters for '-r' action\0A\00"
@.str.11 = [3 x i8] c"-s\00"
@.str.12 = [46 x i8] c"Not enough actual parameters for '-s' action\0A\00"
@.str.13 = [23 x i8] c"Unknown argument '%s'\0A\00"
define void @parse_command_line(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [4 x i8]
%9 = alloca i8*
%10 = alloca [8 x i8]
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 1
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = call i32 (...) @print_help()
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %2
store i32 1, i32* %5
br label %20
20: ; preds = %192, %19
%21 = load i32, i32* %5
%22 = load i32, i32* %3
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %195
24: ; preds = %20
%25 = load i8**, i8*** %4
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %40
32: ; preds = %24
%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 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %43, label %40
40: ; preds = %32, %24
%41 = call i32 (...) @print_help()
%42 = call i32 @exit(i32 0)
unreachable
43: ; preds = %32
%44 = load i8**, i8*** %4
%45 = load i32, i32* %5
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8*, i8** %44, i64 %46
%48 = load i8*, i8** %47
%49 = call i32 @strcmp(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %76, label %51
51: ; preds = %43
%52 = load i32, i32* %5
%53 = add nsw i32 %52, 2
%54 = load i32, i32* %3
%55 = icmp slt i32 %53, %54
br i1 %55, label %56, label %73
56: ; preds = %51
%57 = load i8**, i8*** %4
%58 = load i32, i32* %5
%59 = add nsw i32 %58, 1
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8*, i8** %57, i64 %60
%62 = load i8*, i8** %61
store i8* %62, i8** %6
%63 = load i8**, i8*** %4
%64 = load i32, i32* %5
%65 = add nsw i32 %64, 2
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8*, i8** %63, i64 %66
%68 = load i8*, i8** %67
store i8* %68, i8** %7
%69 = load i8*, i8** %7
%70 = load i8*, i8** %6
%71 = call i32 @action(i8* %69, i8* %70, i32 1)
%72 = call i32 @exit(i32 0)
unreachable
73: ; preds = %51
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%75 = call i32 @exit(i32 1)
unreachable
76: ; preds = %43
%77 = load i8**, i8*** %4
%78 = load i32, i32* %5
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8*, i8** %77, i64 %79
%81 = load i8*, i8** %80
%82 = call i32 @strcmp(i8* %81, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%83 = icmp ne i32 %82, 0
br i1 %83, label %104, label %84
84: ; preds = %76
%85 = load i32, i32* %5
%86 = add nsw i32 %85, 1
%87 = load i32, i32* %3
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %101
89: ; preds = %84
%90 = bitcast [4 x i8]* %8 to i8*
%91 = load i8**, i8*** %4
%92 = load i32, i32* %5
%93 = add nsw i32 %92, 1
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i8*, i8** %91, i64 %94
%96 = load i8*, i8** %95
store i8* %96, i8** %9
%97 = load i8*, i8** %9
%98 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%99 = call i32 @action(i8* %97, i8* %98, i32 1)
%100 = call i32 @exit(i32 0)
unreachable
101: ; preds = %84
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0))
%103 = call i32 @exit(i32 1)
unreachable
104: ; preds = %76
%105 = load i8**, i8*** %4
%106 = load i32, i32* %5
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8*, i8** %105, i64 %107
%109 = load i8*, i8** %108
%110 = call i32 @strcmp(i8* %109, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%111 = icmp ne i32 %110, 0
br i1 %111, label %132, label %112
112: ; preds = %104
%113 = load i32, i32* %5
%114 = add nsw i32 %113, 1
%115 = load i32, i32* %3
%116 = icmp slt i32 %114, %115
br i1 %116, label %117, label %129
117: ; preds = %112
%118 = bitcast [8 x i8]* %10 to i8*
%119 = load i8**, i8*** %4
%120 = load i32, i32* %5
%121 = add nsw i32 %120, 1
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8*, i8** %119, i64 %122
%124 = load i8*, i8** %123
store i8* %124, i8** %11
%125 = load i8*, i8** %11
%126 = getelementptr inbounds [8 x i8], [8 x i8]* %10, i64 0, i64 0
%127 = call i32 @action(i8* %125, i8* %126, i32 1)
%128 = call i32 @exit(i32 0)
unreachable
129: ; preds = %112
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0))
%131 = call i32 @exit(i32 1)
unreachable
132: ; preds = %104
%133 = load i8**, i8*** %4
%134 = load i32, i32* %5
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8*, i8** %133, i64 %135
%137 = load i8*, i8** %136
%138 = call i32 @strcmp(i8* %137, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%139 = icmp ne i32 %138, 0
br i1 %139, label %158, label %140
140: ; preds = %132
%141 = load i32, i32* %5
%142 = add nsw i32 %141, 1
%143 = load i32, i32* %3
%144 = icmp slt i32 %142, %143
br i1 %144, label %145, label %155
145: ; preds = %140
%146 = load i8**, i8*** %4
%147 = load i32, i32* %5
%148 = add nsw i32 %147, 1
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds i8*, i8** %146, i64 %149
%151 = load i8*, i8** %150
store i8* %151, i8** %12
%152 = load i8*, i8** %12
%153 = call i32 @action(i8* %152, i8* null, i32 2)
%154 = call i32 @exit(i32 0)
unreachable
155: ; preds = %140
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
%157 = call i32 @exit(i32 1)
unreachable
158: ; preds = %132
%159 = load i8**, i8*** %4
%160 = load i32, i32* %5
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds i8*, i8** %159, i64 %161
%163 = load i8*, i8** %162
%164 = call i32 @strcmp(i8* %163, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%165 = icmp ne i32 %164, 0
br i1 %165, label %184, label %166
166: ; preds = %158
%167 = load i32, i32* %5
%168 = add nsw i32 %167, 1
%169 = load i32, i32* %3
%170 = icmp slt i32 %168, %169
br i1 %170, label %171, label %181
171: ; preds = %166
%172 = load i8**, i8*** %4
%173 = load i32, i32* %5
%174 = add nsw i32 %173, 1
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds i8*, i8** %172, i64 %175
%177 = load i8*, i8** %176
store i8* %177, i8** %13
%178 = load i8*, i8** %13
%179 = call i32 @action(i8* %178, i8* null, i32 3)
%180 = call i32 @exit(i32 0)
unreachable
181: ; preds = %166
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
%183 = call i32 @exit(i32 1)
unreachable
184: ; preds = %158
%185 = load i8**, i8*** %4
%186 = load i32, i32* %5
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i8*, i8** %185, i64 %187
%189 = load i8*, i8** %188
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8* %189)
%191 = call i32 @exit(i32 1)
unreachable
192: ; No predecessors!
%193 = load i32, i32* %5
%194 = add nsw i32 %193, 1
store i32 %194, i32* %5
br label %20
195: ; preds = %20
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [7 x i8] c"--help\00"
@.str.2 = [3 x i8] c"-i\00"
@.str.4 = [3 x i8] c"-c\00"
@.str.6 = [3 x i8] c"-d\00"
@.str.9 = [3 x i8] c"-r\00"
@.str.11 = [3 x i8] c"-s\00"
@.str.13 = [23 x i8] c"Unknown argument '%s'\0A\00"
@str = [45 x i8] c"Not enough actual parameters for '-i' action\00"
@str.14 = [45 x i8] c"Not enough actual parameters for '-c' action\00"
@str.15 = [45 x i8] c"Not enough actual parameters for '-d' action\00"
@str.16 = [45 x i8] c"Not enough actual parameters for '-r' action\00"
@str.17 = [45 x i8] c"Not enough actual parameters for '-s' action\00"
define void @parse_command_line(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i64
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 (...) @print_help()
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %9
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14, %9
%18 = tail call i32 (...) @print_help()
%19 = tail call i32 @exit(i32 0)
unreachable
20: ; preds = %14
%21 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %35
23: ; preds = %20
%24 = icmp ugt i32 %0, 3
br i1 %24, label %25, label %32
25: ; preds = %23
%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 @action(i8* %29, i8* %27, i32 1)
%31 = tail call i32 @exit(i32 0)
unreachable
32: ; preds = %23
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%34 = tail call i32 @exit(i32 1)
unreachable
35: ; preds = %20
%36 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %49
38: ; preds = %35
%39 = icmp ugt i32 %0, 2
br i1 %39, label %40, label %46
40: ; preds = %38
%41 = bitcast i32* %3 to i8*
store i32 5591107, i32* %3
%42 = getelementptr inbounds i8*, i8** %1, i64 2
%43 = load i8*, i8** %42
%44 = call i32 @action(i8* %43, i8* %41, i32 1)
%45 = call i32 @exit(i32 0)
unreachable
46: ; preds = %38
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.14, i64 0, i64 0))
%48 = tail call i32 @exit(i32 1)
unreachable
49: ; preds = %35
%50 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %63
52: ; preds = %49
%53 = icmp ugt i32 %0, 2
br i1 %53, label %54, label %60
54: ; preds = %52
%55 = bitcast i64* %4 to i8*
store i64 34165590552963396, i64* %4
%56 = getelementptr inbounds i8*, i8** %1, i64 2
%57 = load i8*, i8** %56
%58 = call i32 @action(i8* %57, i8* %55, i32 1)
%59 = call i32 @exit(i32 0)
unreachable
60: ; preds = %52
%61 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.15, i64 0, i64 0))
%62 = tail call i32 @exit(i32 1)
unreachable
63: ; preds = %49
%64 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %76
66: ; preds = %63
%67 = icmp ugt i32 %0, 2
br i1 %67, label %68, label %73
68: ; preds = %66
%69 = getelementptr inbounds i8*, i8** %1, i64 2
%70 = load i8*, i8** %69
%71 = tail call i32 @action(i8* %70, i8* null, i32 2)
%72 = tail call i32 @exit(i32 0)
unreachable
73: ; preds = %66
%74 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.16, i64 0, i64 0))
%75 = tail call i32 @exit(i32 1)
unreachable
76: ; preds = %63
%77 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %89
79: ; preds = %76
%80 = icmp ugt i32 %0, 2
br i1 %80, label %81, label %86
81: ; preds = %79
%82 = getelementptr inbounds i8*, i8** %1, i64 2
%83 = load i8*, i8** %82
%84 = tail call i32 @action(i8* %83, i8* null, i32 3)
%85 = tail call i32 @exit(i32 0)
unreachable
86: ; preds = %79
%87 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.17, i64 0, i64 0))
%88 = tail call i32 @exit(i32 1)
unreachable
89: ; preds = %76
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8* %11)
%91 = tail call i32 @exit(i32 1)
unreachable
}