#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*/ printSyntax(char *, char, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int argCheck(int argc, char **argv, char id, char *startmon, char *stdwlan) {
  int inst = 1;
  if (argc >= 2) {
    if (!strcmp(argv[1], "N") || !strcmp(argv[1], "n")) {
      inst = 0;
      if (argc == 3) {
        sprintf(startmon, "%s %s ", startmon, argv[2]);
        sprintf(stdwlan, " %s ", argv[2]);
      } else
        strcat(startmon, stdwlan);
    } else {
      sprintf(startmon, "%s %s ", startmon, argv[1]);
      sprintf(stdwlan, " %s ", argv[1]);
      if (argc == 3 && (!strcmp(argv[2], "N") || !strcmp(argv[2], "n")))
        inst = 0;
    }
  } else {
    strcat(startmon, stdwlan);
    printSyntax(argv[0], id, stdwlan);
  }
  return inst;
}


x86 assembly (clang, -O0):
<argCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
cmpl   $0x2,-0x4(%rbp)
jl     1294 <argCheck+0x154>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe84(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     11a7 <argCheck+0x67>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe69(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1207 <argCheck+0xc7>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    11f5 <argCheck+0xb5>
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xe1d(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    1202 <argCheck+0xc2>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <strcat@plt>
jmp    128f <argCheck+0x14f>
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xde6(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xdce(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
cmpl   $0x3,-0x4(%rbp)
jne    128a <argCheck+0x14a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xda8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
je     1283 <argCheck+0x143>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd8d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    128a <argCheck+0x14a>
movl   $0x0,-0x2c(%rbp)
jmp    128f <argCheck+0x14f>
jmp    12b7 <argCheck+0x177>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x11(%rbp),%al
mov    -0x28(%rbp),%rdx
movsbl %al,%esi
call   1030 <printSyntax@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argCheck>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r13
mov    %rsi,%r12
cmp    $0x2,%edi
jl     11fb <argCheck+0xbb>
mov    %edi,%ebx
mov    0x8(%r12),%r15
lea    0xe95(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1220 <argCheck+0xe0>
lea    0xe80(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1220 <argCheck+0xe0>
lea    0xe6b(%rip),%rsi
mov    %r13,%rdi
mov    %r13,%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    0x8(%r12),%rdx
lea    0xe51(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    $0x1,%r15d
cmp    $0x3,%ebx
jne    1267 <argCheck+0x127>
mov    0x10(%r12),%rbx
lea    0xe26(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1264 <argCheck+0x124>
lea    0xe15(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1267 <argCheck+0x127>
jmp    1264 <argCheck+0x124>
mov    %edx,%ebp
mov    %r13,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    (%r12),%rdi
movsbl %bpl,%esi
mov    %r14,%rdx
call   1030 <printSyntax@plt>
mov    $0x1,%r15d
jmp    1267 <argCheck+0x127>
cmp    $0x3,%ebx
jne    1259 <argCheck+0x119>
mov    0x10(%r12),%rcx
lea    0xdd3(%rip),%rsi
xor    %r15d,%r15d
mov    %r13,%rdi
mov    %r13,%rdx
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    0x10(%r12),%rdx
lea    0xdb9(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <sprintf@plt>
jmp    1267 <argCheck+0x127>
mov    %r13,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
xor    %r15d,%r15d
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"N\00"
@.str.1 = [2 x i8] c"n\00"
@.str.2 = [7 x i8] c"%s %s \00"
@.str.3 = [5 x i8] c" %s \00"
define i32 @argCheck(i32 %0, i8** %1, i8 signext %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
store i32 1, i32* %11
%12 = load i32, i32* %6
%13 = icmp sge i32 %12, 2
br i1 %13, label %14, label %75
14: ; preds = %5
%15 = load i8**, i8*** %7
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load i8**, i8*** %7
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %46, label %26
26: ; preds = %20, %14
store i32 0, i32* %11
%27 = load i32, i32* %6
%28 = icmp eq i32 %27, 3
br i1 %28, label %29, label %41
29: ; preds = %26
%30 = load i8*, i8** %9
%31 = load i8*, i8** %9
%32 = load i8**, i8*** %7
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %31, i8* %34)
%36 = load i8*, i8** %10
%37 = load i8**, i8*** %7
%38 = getelementptr inbounds i8*, i8** %37, i64 2
%39 = load i8*, i8** %38
%40 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %39)
br label %45
41: ; preds = %26
%42 = load i8*, i8** %9
%43 = load i8*, i8** %10
%44 = call i32 @strcat(i8* %42, i8* %43)
br label %45
45: ; preds = %41, %29
br label %74
46: ; preds = %20
%47 = load i8*, i8** %9
%48 = load i8*, i8** %9
%49 = load i8**, i8*** %7
%50 = getelementptr inbounds i8*, i8** %49, i64 1
%51 = load i8*, i8** %50
%52 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %47, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %48, i8* %51)
%53 = load i8*, i8** %10
%54 = load i8**, i8*** %7
%55 = getelementptr inbounds i8*, i8** %54, i64 1
%56 = load i8*, i8** %55
%57 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %53, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* %56)
%58 = load i32, i32* %6
%59 = icmp eq i32 %58, 3
br i1 %59, label %60, label %73
60: ; preds = %46
%61 = load i8**, i8*** %7
%62 = getelementptr inbounds i8*, i8** %61, i64 2
%63 = load i8*, i8** %62
%64 = call i32 @strcmp(i8* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %72
66: ; preds = %60
%67 = load i8**, i8*** %7
%68 = getelementptr inbounds i8*, i8** %67, i64 2
%69 = load i8*, i8** %68
%70 = call i32 @strcmp(i8* %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%71 = icmp ne i32 %70, 0
br i1 %71, label %73, label %72
72: ; preds = %66, %60
store i32 0, i32* %11
br label %73
73: ; preds = %72, %66, %46
br label %74
74: ; preds = %73, %45
br label %85
75: ; preds = %5
%76 = load i8*, i8** %9
%77 = load i8*, i8** %10
%78 = call i32 @strcat(i8* %76, i8* %77)
%79 = load i8**, i8*** %7
%80 = getelementptr inbounds i8*, i8** %79, i64 0
%81 = load i8*, i8** %80
%82 = load i8, i8* %8
%83 = load i8*, i8** %10
%84 = call i32 @printSyntax(i8* %81, i8 signext %82, i8* %83)
br label %85
85: ; preds = %75, %74
%86 = load i32, i32* %11
ret i32 %86
}

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