#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int getopt(int, char **, char *);
int /*<<< orphan*/ ignoreall();
int /*<<< orphan*/ ignorecase();
int /*<<< orphan*/ ignorespace();
int /*<<< orphan*/ noopt();
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int iflag = 0, sflag = 0, opt;
  if (argc > 3) {
    (void)fprintf(stderr, "Usage: %s [-s] [-i] \n", argv[0]);
    exit(EXIT_FAILURE);
  }
  while ((opt = getopt(argc, argv, "si ")) != -1) {
    switch (opt) {
    case 'i':
      iflag = 1;
      break;
    case 's':
      sflag = 1;
      break;
    default:
      (void)fprintf(stderr,
                    "Error in argument handling! Can not continue...\n");
      exit(EXIT_FAILURE);
    }
  }
  if (iflag == 1 && sflag == 1) {
    (void)ignoreall();
  }
  if (iflag == 1 && sflag == 0) {
    (void)ignorecase();
  }
  if (iflag == 0 && sflag == 1) {
    (void)ignorespace();
  } else {
    (void)noopt();
  }
  (void)fprintf(stderr, "An internal flag Error has occured...\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    11ca <main+0x5a>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe4b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    11cf <main+0x5f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe39(%rip),%rdx
call   1060 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     1255 <main+0xe5>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
sub    $0x69,%eax
je     1213 <main+0xa3>
jmp    1202 <main+0x92>
mov    -0x20(%rbp),%eax
sub    $0x73,%eax
je     121f <main+0xaf>
jmp    122b <main+0xbb>
movl   $0x1,-0x14(%rbp)
jmp    1250 <main+0xe0>
movl   $0x1,-0x18(%rbp)
jmp    1250 <main+0xe0>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
lea    0xddf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
jmp    11cf <main+0x5f>
cmpl   $0x1,-0x14(%rbp)
jne    1270 <main+0x100>
cmpl   $0x1,-0x18(%rbp)
jne    1270 <main+0x100>
mov    $0x0,%al
call   1090 <ignoreall@plt>
cmpl   $0x1,-0x14(%rbp)
jne    128b <main+0x11b>
cmpl   $0x0,-0x18(%rbp)
jne    128b <main+0x11b>
mov    $0x0,%al
call   1050 <ignorecase@plt>
cmpl   $0x0,-0x14(%rbp)
jne    12ab <main+0x13b>
cmpl   $0x1,-0x18(%rbp)
jne    12ab <main+0x13b>
mov    $0x0,%al
call   1070 <ignorespace@plt>
jmp    12b2 <main+0x142>
mov    $0x0,%al
call   1030 <noopt@plt>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
lea    0xd89(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2d08(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x3,%edi
jg     1259 <main+0xe9>
mov    %edi,%ebp
xor    %r15d,%r15d
mov    $0x1,%r12b
lea    0xe80(%rip),%r14
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %ecx,%r13d
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <getopt@plt>
mov    $0x1,%ecx
cmp    $0x69,%eax
je     11a0 <main+0x30>
cmp    $0x73,%eax
jne    11ca <main+0x5a>
mov    $0x1,%r15b
xor    %r12d,%r12d
mov    %r13d,%ecx
jmp    11a0 <main+0x30>
cmp    $0xffffffff,%eax
jne    11e9 <main+0x79>
cmp    $0x1,%r13d
setne  %al
not    %r15b
or     %r15b,%al
test   $0x1,%al
jne    11fb <main+0x8b>
xor    %eax,%eax
call   1090 <ignoreall@plt>
jmp    122d <main+0xbd>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
lea    0xe21(%rip),%rsi
jmp    1244 <main+0xd4>
cmp    $0x1,%r13d
setne  %al
not    %r12b
or     %al,%r12b
test   $0x1,%r12b
jne    1217 <main+0xa7>
xor    %eax,%eax
call   1050 <ignorecase@plt>
jmp    122d <main+0xbd>
test   %r13d,%r13d
setne  %al
or     %r15b,%al
test   $0x1,%al
jne    122d <main+0xbd>
xor    %eax,%eax
call   1070 <ignorespace@plt>
jmp    1234 <main+0xc4>
xor    %eax,%eax
call   1030 <noopt@plt>
mov    0x2da5(%rip),%rax
mov    (%rax),%edi
lea    0xe07(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
mov    0x2d80(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xd94(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    124b <main+0xdb>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s [-s] [-i] \0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [4 x i8] c"si \00"
@.str.2 = [49 x i8] c"Error in argument handling! Can not continue...\0A\00"
@.str.3 = [39 x i8] c"An internal flag Error has occured...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 3
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
br label %20
20: ; preds = %34, %19
%21 = load i32, i32* %4
%22 = load i8**, i8*** %5
%23 = call i32 @getopt(i32 %21, i8** %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 %23, i32* %8
%24 = icmp ne i32 %23, -1
br i1 %24, label %25, label %35
25: ; preds = %20
%26 = load i32, i32* %8
switch i32 %26, label %29 [
i32 105, label %27
i32 115, label %28
]
27: ; preds = %25
store i32 1, i32* %6
br label %34
28: ; preds = %25
store i32 1, i32* %7
br label %34
29: ; preds = %25
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32, i32* @EXIT_FAILURE
%33 = call i32 @exit(i32 %32)
unreachable
34: ; preds = %28, %27
br label %20
35: ; preds = %20
%36 = load i32, i32* %6
%37 = icmp eq i32 %36, 1
br i1 %37, label %38, label %43
38: ; preds = %35
%39 = load i32, i32* %7
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (...) @ignoreall()
br label %43
43: ; preds = %41, %38, %35
%44 = load i32, i32* %6
%45 = icmp eq i32 %44, 1
br i1 %45, label %46, label %51
46: ; preds = %43
%47 = load i32, i32* %7
%48 = icmp eq i32 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 (...) @ignorecase()
br label %51
51: ; preds = %49, %46, %43
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %51
%55 = load i32, i32* %7
%56 = icmp eq i32 %55, 1
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 (...) @ignorespace()
br label %61
59: ; preds = %54, %51
%60 = call i32 (...) @noopt()
br label %61
61: ; preds = %59, %57
%62 = load i32, i32* @stderr
%63 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%64 = load i32, i32* @EXIT_FAILURE
%65 = call i32 @exit(i32 %64)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: %s [-s] [-i] \0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [4 x i8] c"si \00"
@.str.2 = [49 x i8] c"Error in argument handling! Can not continue...\0A\00"
@.str.3 = [39 x i8] c"An internal flag Error has occured...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 3
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %13, %10
%11 = phi i32 [ 1, %10 ], [ %16, %13 ]
%12 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
switch i32 %12, label %17 [
i32 -1, label %22
i32 105, label %10
i32 115, label %13
]
13: ; preds = %10, %2
%14 = phi i1 [ false, %2 ], [ true, %10 ]
%15 = phi i1 [ true, %2 ], [ false, %10 ]
%16 = phi i32 [ 0, %2 ], [ %11, %10 ]
br label %10
17: ; preds = %10
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* @EXIT_FAILURE
%21 = tail call i32 @exit(i32 %20)
unreachable
22: ; preds = %10
%23 = icmp eq i32 %11, 1
%24 = and i1 %23, %14
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = tail call i32 (...) @ignoreall()
br label %36
27: ; preds = %22
%28 = and i1 %23, %15
br i1 %28, label %29, label %31
29: ; preds = %27
%30 = tail call i32 (...) @ignorecase()
br label %36
31: ; preds = %27
%32 = icmp eq i32 %11, 0
%33 = and i1 %32, %14
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = tail call i32 (...) @ignorespace()
br label %38
36: ; preds = %29, %25, %31
%37 = tail call i32 (...) @noopt()
br label %38
38: ; preds = %36, %34
%39 = load i32, i32* @stderr
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%41 = load i32, i32* @EXIT_FAILURE
%42 = tail call i32 @exit(i32 %41)
unreachable
}