#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*/ isWhiteCharacter(char const);
int preparePositionParam(int, char const **);
scalar_t__ strcmp(char const *, char *);
int strlen(char const *);
int isSetParams(int argc, const char **argv) {
  if (argc == 1 || argc > 4) {
    return 0;
  }
  if (strcmp(argv[1], "--help") != 0) {
    if (strlen(argv[1]) != 1 ||
        !(!isWhiteCharacter(argv[1][0]) || strcmp(argv[1], ".") == 0 ||
          strcmp(argv[1], "^") == 0 || strcmp(argv[1], ":") == 0)) {
      return 0;
    }
    if (argc >= 3 && strcmp(argv[2], "-d") != 0 &&
        preparePositionParam(argc, argv) == -1) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<isSetParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1163 <isSetParams+0x23>
cmpl   $0x4,-0x8(%rbp)
jle    116f <isSetParams+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1277 <isSetParams+0x137>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe82(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1270 <isSetParams+0x130>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    1216 <isSetParams+0xd6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%edi
call   1060 <isWhiteCharacter@plt>
cmp    $0x0,%eax
je     1222 <isSetParams+0xe2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1222 <isSetParams+0xe2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe20(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1222 <isSetParams+0xe2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe04(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1222 <isSetParams+0xe2>
movl   $0x0,-0x4(%rbp)
jmp    1277 <isSetParams+0x137>
cmpl   $0x3,-0x8(%rbp)
jl     126b <isSetParams+0x12b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdd2(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     126b <isSetParams+0x12b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <preparePositionParam@plt>
cmp    $0xffffffff,%eax
jne    126b <isSetParams+0x12b>
movl   $0x0,-0x4(%rbp)
jmp    1277 <isSetParams+0x137>
jmp    1270 <isSetParams+0x130>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSetParams>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
cmp    $0x1,%edi
je     1203 <isSetParams+0xc3>
mov    %edi,%ebp
cmp    $0x4,%edi
jg     1203 <isSetParams+0xc3>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe97(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11fd <isSetParams+0xbd>
mov    0x8(%rbx),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    1203 <isSetParams+0xc3>
mov    0x8(%rbx),%rax
movsbl (%rax),%edi
call   1060 <isWhiteCharacter@plt>
test   %eax,%eax
je     11d4 <isSetParams+0x94>
mov    0x8(%rbx),%rdi
lea    0xe67(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11d4 <isSetParams+0x94>
mov    0x8(%rbx),%rdi
lea    0xe54(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11d4 <isSetParams+0x94>
mov    0x8(%rbx),%rdi
lea    0xe41(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1203 <isSetParams+0xc3>
cmp    $0x3,%ebp
jl     11fd <isSetParams+0xbd>
mov    0x10(%rbx),%rdi
lea    0xe29(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11fd <isSetParams+0xbd>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <preparePositionParam@plt>
cmp    $0xffffffff,%eax
je     1203 <isSetParams+0xc3>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [2 x i8] c"^\00"
@.str.3 = [2 x i8] c":\00"
@.str.4 = [3 x i8] c"-d\00"
define i32 @isSetParams(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 4
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %68
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %67
18: ; preds = %12
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @strlen(i8* %21)
%23 = icmp ne i32 %22, 1
br i1 %23, label %50, label %24
24: ; preds = %18
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = call i32 @isWhiteCharacter(i8 signext %29)
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %51
32: ; preds = %24
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %51, label %38
38: ; preds = %32
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 1
%41 = load i8*, i8** %40
%42 = call i64 @strcmp(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
br i1 %43, label %51, label %44
44: ; preds = %38
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 1
%47 = load i8*, i8** %46
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %51, label %50
50: ; preds = %44, %18
store i32 0, i32* %3
br label %68
51: ; preds = %44, %38, %32, %24
%52 = load i32, i32* %4
%53 = icmp sge i32 %52, 3
br i1 %53, label %54, label %66
54: ; preds = %51
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 2
%57 = load i8*, i8** %56
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%59 = icmp ne i64 %58, 0
br i1 %59, label %60, label %66
60: ; preds = %54
%61 = load i32, i32* %4
%62 = load i8**, i8*** %5
%63 = call i32 @preparePositionParam(i32 %61, i8** %62)
%64 = icmp eq i32 %63, -1
br i1 %64, label %65, label %66
65: ; preds = %60
store i32 0, i32* %3
br label %68
66: ; preds = %60, %54, %51
br label %67
67: ; preds = %66, %12
store i32 1, i32* %3
br label %68
68: ; preds = %67, %65, %50, %11
%69 = load i32, i32* %3
ret i32 %69
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [2 x i8] c"^\00"
@.str.3 = [2 x i8] c":\00"
@.str.4 = [3 x i8] c"-d\00"
define i32 @isSetParams(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
%4 = icmp sgt i32 %0, 4
%5 = or i1 %3, %4
br i1 %5, label %43, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %42, label %11
11: ; preds = %6
%12 = load i8*, i8** %7
%13 = tail call i32 @strlen(i8* %12)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %43
15: ; preds = %11
%16 = load i8*, i8** %7
%17 = load i8, i8* %16
%18 = tail call i32 @isWhiteCharacter(i8 signext %17)
%19 = icmp eq i32 %18, 0
br i1 %19, label %32, label %20
20: ; preds = %15
%21 = load i8*, i8** %7
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %32, label %24
24: ; preds = %20
%25 = load i8*, i8** %7
%26 = tail call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %32, label %28
28: ; preds = %24
%29 = load i8*, i8** %7
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %43
32: ; preds = %28, %24, %20, %15
%33 = icmp sgt i32 %0, 2
br i1 %33, label %34, label %42
34: ; preds = %32
%35 = getelementptr inbounds i8*, i8** %1, i64 2
%36 = load i8*, i8** %35
%37 = tail call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %34
%40 = tail call i32 @preparePositionParam(i32 %0, i8** %1)
%41 = icmp eq i32 %40, -1
br i1 %41, label %43, label %42
42: ; preds = %32, %34, %39, %6
br label %43
43: ; preds = %39, %11, %28, %2, %42
%44 = phi i32 [ 1, %42 ], [ 0, %2 ], [ 0, %28 ], [ 0, %11 ], [ 0, %39 ]
ret i32 %44
}