#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*/ Help();
int /*<<< orphan*/ License();
int /*<<< orphan*/ exit(int);
scalar_t__ strcmp(char const *, char *);
void ValidateCmd(int argc, const char **argv) {
  if (argc == 2 && (strcmp(argv[1], "-l") || strcmp(argv[1], "--license"))) {
    License();
    exit(0);
  }
  if (argc > 5 || argc < 5) {
    Help();
    exit(1);
  }
  if (!strcmp(argv[3], "to") || !strcmp(argv[3], "TO") ||
      !strcmp(argv[3], "To")) {
    ;
  } else {
    Help();
    exit(0);
  }
}


x86 assembly (clang, -O0):
<ValidateCmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    11a3 <ValidateCmd+0x63>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe98(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1195 <ValidateCmd+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe7d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11a3 <ValidateCmd+0x63>
mov    $0x0,%al
call   1050 <License@plt>
xor    %edi,%edi
call   1060 <exit@plt>
cmpl   $0x5,-0x4(%rbp)
jg     11b7 <ValidateCmd+0x77>
cmpl   $0x5,-0x4(%rbp)
jge    11c8 <ValidateCmd+0x88>
mov    $0x0,%al
call   1030 <Help@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe36(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1222 <ValidateCmd+0xe2>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe1b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1222 <ValidateCmd+0xe2>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xe00(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1227 <ValidateCmd+0xe7>
jmp    1235 <ValidateCmd+0xf5>
mov    $0x0,%al
call   1030 <Help@plt>
xor    %edi,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ValidateCmd>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x5,%edi
jne    118a <ValidateCmd+0x4a>
mov    0x18(%rbx),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1188 <ValidateCmd+0x48>
mov    0x18(%rbx),%rdi
lea    0xea7(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1188 <ValidateCmd+0x48>
mov    0x18(%rbx),%rdi
lea    0xe95(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11d8 <ValidateCmd+0x98>
pop    %rbx
ret
cmp    $0x2,%edi
jne    11b9 <ValidateCmd+0x79>
mov    0x8(%rbx),%rdi
lea    0xe66(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11ca <ValidateCmd+0x8a>
mov    0x8(%rbx),%rdi
lea    0xe54(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11ca <ValidateCmd+0x8a>
xor    %eax,%eax
call   1030 <Help@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1050 <License@plt>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <Help@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-l\00"
@.str.1 = [10 x i8] c"--license\00"
@.str.2 = [3 x i8] c"to\00"
@.str.3 = [3 x i8] c"TO\00"
@.str.4 = [3 x i8] c"To\00"
define void @ValidateCmd(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 eq i32 %5, 2
br i1 %6, label %7, label %22
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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br i1 %12, label %19, label %13
13: ; preds = %7
%14 = load i8**, i8*** %4
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %13, %7
%20 = call i32 (...) @License()
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %13, %2
%23 = load i32, i32* %3
%24 = icmp sgt i32 %23, 5
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp slt i32 %26, 5
br i1 %27, label %28, label %31
28: ; preds = %25, %22
%29 = call i32 (...) @Help()
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %25
%32 = load i8**, i8*** %4
%33 = getelementptr inbounds i8*, i8** %32, i64 3
%34 = load i8*, i8** %33
%35 = call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp ne i64 %35, 0
br i1 %36, label %37, label %49
37: ; preds = %31
%38 = load i8**, i8*** %4
%39 = getelementptr inbounds i8*, i8** %38, i64 3
%40 = load i8*, i8** %39
%41 = call i64 @strcmp(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %49
43: ; preds = %37
%44 = load i8**, i8*** %4
%45 = getelementptr inbounds i8*, i8** %44, i64 3
%46 = load i8*, i8** %45
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%48 = icmp ne i64 %47, 0
br i1 %48, label %50, label %49
49: ; preds = %43, %37, %31
br label %53
50: ; preds = %43
%51 = call i32 (...) @Help()
%52 = call i32 @exit(i32 0)
unreachable
53: ; preds = %49
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"-l\00"
@.str.1 = [10 x i8] c"--license\00"
@.str.2 = [3 x i8] c"to\00"
@.str.3 = [3 x i8] c"TO\00"
@.str.4 = [3 x i8] c"To\00"
define void @ValidateCmd(i32 %0, i8** nocapture %1) {
switch i32 %0, label %15 [
i32 2, label %3
i32 5, label %18
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = load i8*, i8** %4
%10 = tail call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %8, %3
%13 = tail call i32 (...) @License()
%14 = tail call i32 @exit(i32 0)
unreachable
15: ; preds = %8, %2
%16 = tail call i32 (...) @Help()
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = getelementptr inbounds i8*, i8** %1, i64 3
%20 = load i8*, i8** %19
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %34, label %23
23: ; preds = %18
%24 = load i8*, i8** %19
%25 = tail call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %34, label %27
27: ; preds = %23
%28 = load i8*, i8** %19
%29 = tail call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %34, label %31
31: ; preds = %27
%32 = tail call i32 (...) @Help()
%33 = tail call i32 @exit(i32 0)
unreachable
34: ; preds = %18, %23, %27
ret void
}