#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*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, float);
int getopt(int, char **, char *);
int /*<<< orphan*/ isprint(float);
char *optarg;
scalar_t__ opterr;
int optind;
float optopt;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ processing_data(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  int hflag = 0;
  char *file_input = NULL;
  int index;
  int c;
  int heap_mode = 0;
  int stack_mode = 0;
  opterr = 0;
  while ((c = getopt(argc, argv, "hf:")) != -1)
    switch (c) {
    case 'h':
      hflag = 1;
      break;
    case 'f':
      file_input = optarg;
      break;
    case '?':
      if (optopt == 'f')
        fprintf(stderr, "Option -%c requires input file\n", optopt);
      else if (isprint(optopt))
        fprintf(stderr, "Unknown option `-%c'.\n", optopt);
      else
        fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt);
      return 1;
    default:
      abort();
    }
  for (index = optind; index < argc; index++) {
    printf("Non-option argument %s\n", argv[index]);
    if (!strcmp(argv[index], "secret_mode")) {
      printf("You found the super secret mode!\n");
      return 0;
    }
  }
  if (hflag) {
    printf("Helptext: ");
    printf("One can use one of the following options:\n");
    printf("-h\t\tshow this help text\n");
    printf("-f <file>\tdo calc based on a file input\n");
    printf("???\t\tmore options still under development\n");
    return 0;
  }
  if (file_input) {
    processing_data(file_input);
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    0x2e16(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe45(%rip),%rdx
call   1090 <getopt@plt>
mov    %eax,-0x28(%rbp)
cmp    $0xffffffff,%eax
je     12e7 <main+0x177>
mov    -0x28(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0x3f,%eax
je     1225 <main+0xb5>
jmp    11e4 <main+0x74>
mov    -0x34(%rbp),%eax
sub    $0x66,%eax
je     1212 <main+0xa2>
jmp    11f5 <main+0x85>
mov    -0x34(%rbp),%eax
sub    $0x68,%eax
jne    12db <main+0x16b>
jmp    1206 <main+0x96>
movl   $0x1,-0x14(%rbp)
jmp    12e2 <main+0x172>
mov    0x2ddf(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    12e2 <main+0x172>
mov    0x2db4(%rip),%rax
movss  (%rax),%xmm0
movss  0xdc8(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    126c <main+0xfc>
jp     126c <main+0xfc>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
mov    0x2d89(%rip),%rax
movss  (%rax),%xmm0
lea    0xda6(%rip),%rsi
call   1060 <fprintf@plt>
jmp    12cf <main+0x15f>
mov    0x2d6d(%rip),%rax
movss  (%rax),%xmm0
call   1080 <isprint@plt>
cmp    $0x0,%eax
je     12aa <main+0x13a>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
mov    0x2d4b(%rip),%rax
movss  (%rax),%xmm0
lea    0xd88(%rip),%rsi
call   1060 <fprintf@plt>
jmp    12ca <main+0x15a>
mov    0x2d17(%rip),%rax
mov    (%rax),%edi
mov    0x2d26(%rip),%rax
movss  (%rax),%xmm0
lea    0xd7a(%rip),%rsi
call   1060 <fprintf@plt>
jmp    12cf <main+0x15f>
movl   $0x1,-0x4(%rbp)
jmp    13ea <main+0x27a>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11b1 <main+0x41>
mov    0x2cea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1367 <main+0x1f7>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd4f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd4d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    1354 <main+0x1e4>
lea    0xd44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ea <main+0x27a>
jmp    1359 <main+0x1e9>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12f3 <main+0x183>
cmpl   $0x0,-0x14(%rbp)
je     13c3 <main+0x253>
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ea <main+0x27a>
cmpq   $0x0,-0x20(%rbp)
je     13e3 <main+0x273>
mov    -0x20(%rbp),%rdi
call   1070 <processing_data@plt>
movl   $0x0,-0x4(%rbp)
jmp    13ea <main+0x27a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%r15d
mov    0x2e28(%rip),%rax
movq   $0x0,(%rax)
xor    %r14d,%r14d
lea    0xe5b(%rip),%r12
mov    0x2e48(%rip),%r13
xor    %ebp,%ebp
mov    %ebp,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%ebp
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %r12,%rdx
call   10a0 <getopt@plt>
mov    $0x1,%ecx
cmp    $0x68,%eax
je     11c0 <main+0x40>
cmp    $0xffffffff,%eax
je     11f7 <main+0x77>
cmp    $0x3f,%eax
je     12a8 <main+0x128>
cmp    $0x66,%eax
jne    133b <main+0x1bb>
mov    0x0(%r13),%r14
jmp    11b2 <main+0x32>
mov    %r14,(%rsp)
mov    0x2dd6(%rip),%rax
movslq (%rax),%rax
cmp    %r15d,%eax
jge    125b <main+0xdb>
lea    (%rbx,%rax,8),%rbx
sub    %eax,%r15d
lea    0xe49(%rip),%r12
lea    0xe5a(%rip),%r13
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%r14,8),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx,%r14,8),%rdi
mov    %r13,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
je     1309 <main+0x189>
add    $0x1,%r14
cmp    %r14d,%r15d
jne    1230 <main+0xb0>
test   %ebp,%ebp
je     12f7 <main+0x177>
lea    0xe1b(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe16(%rip),%rdi
call   1040 <puts@plt>
lea    0xe34(%rip),%rdi
call   1040 <puts@plt>
lea    0xe40(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5c(%rip),%rdi
call   1040 <puts@plt>
jmp    132a <main+0x1aa>
mov    0x2d31(%rip),%rbx
movss  (%rbx),%xmm0
ucomiss 0xd46(%rip),%xmm0
jne    12d8 <main+0x158>
jp     12d8 <main+0x158>
mov    0x2d03(%rip),%rax
mov    (%rax),%edi
lea    0xd3a(%rip),%rsi
movss  0xd2a(%rip),%xmm0
jmp    1320 <main+0x1a0>
call   1090 <isprint@plt>
mov    0x2ce4(%rip),%rcx
mov    (%rcx),%edi
movss  (%rbx),%xmm0
test   %eax,%eax
je     1319 <main+0x199>
lea    0xd33(%rip),%rsi
jmp    1320 <main+0x1a0>
xor    %ebx,%ebx
mov    (%rsp),%rdi
test   %rdi,%rdi
je     132a <main+0x1aa>
call   1080 <processing_data@plt>
jmp    132a <main+0x1aa>
lea    0xe14(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
jmp    132a <main+0x1aa>
lea    0xd1f(%rip),%rsi
call   1070 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@opterr = global i64 0
@.str = [4 x i8] c"hf:\00"
@optarg = global i8* null
@optopt = global float 0.000000e+00
@stderr = global i32 0
@.str.1 = [32 x i8] c"Option -%c requires input file\0A\00"
@.str.2 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.3 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@optind = global i32 0
@.str.4 = [24 x i8] c"Non-option argument %s\0A\00"
@.str.5 = [12 x i8] c"secret_mode\00"
@.str.6 = [34 x i8] c"You found the super secret mode!\0A\00"
@.str.7 = [11 x i8] c"Helptext: \00"
@.str.8 = [43 x i8] c"One can use one of the following options:\0A\00"
@.str.9 = [25 x i8] c"-h\09\09show this help text\0A\00"
@.str.10 = [41 x i8] c"-f <file>\09do calc based on a file input\0A\00"
@.str.11 = [43 x i8] c"???\09\09more options still under development\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* null, i8** %7
store i32 0, i32* %10
store i32 0, i32* %11
store i64 0, i64* @opterr
br label %12
12: ; preds = %45, %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @getopt(i32 %13, i8** %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %15, i32* %9
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %46
17: ; preds = %12
%18 = load i32, i32* %9
switch i32 %18, label %43 [
i32 104, label %19
i32 102, label %20
i32 63, label %22
]
19: ; preds = %17
store i32 1, i32* %6
br label %45
20: ; preds = %17
%21 = load i8*, i8** @optarg
store i8* %21, i8** %7
br label %45
22: ; preds = %17
%23 = load float, float* @optopt
%24 = fcmp oeq float %23, 1.020000e+02
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load i32, i32* @stderr
%27 = load float, float* @optopt
%28 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), float %27)
br label %42
29: ; preds = %22
%30 = load float, float* @optopt
%31 = call i32 @isprint(float %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = load i32, i32* @stderr
%35 = load float, float* @optopt
%36 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), float %35)
br label %41
37: ; preds = %29
%38 = load i32, i32* @stderr
%39 = load float, float* @optopt
%40 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), float %39)
br label %41
41: ; preds = %37, %33
br label %42
42: ; preds = %41, %25
store i32 1, i32* %3
br label %88
43: ; preds = %17
%44 = call i32 (...) @abort()
unreachable
45: ; preds = %20, %19
br label %12
46: ; preds = %12
%47 = load i32, i32* @optind
store i32 %47, i32* %8
br label %48
48: ; preds = %69, %46
%49 = load i32, i32* %8
%50 = load i32, i32* %4
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %72
52: ; preds = %48
%53 = load i8**, i8*** %5
%54 = load i32, i32* %8
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %53, i64 %55
%57 = load i8*, i8** %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %57)
%59 = load i8**, i8*** %5
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8*, i8** %59, i64 %61
%63 = load i8*, i8** %62
%64 = call i32 @strcmp(i8* %63, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%65 = icmp ne i32 %64, 0
br i1 %65, label %68, label %66
66: ; preds = %52
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %3
br label %88
68: ; preds = %52
br label %69
69: ; preds = %68
%70 = load i32, i32* %8
%71 = add nsw i32 %70, 1
store i32 %71, i32* %8
br label %48
72: ; preds = %48
%73 = load i32, i32* %6
%74 = icmp ne i32 %73, 0
br i1 %74, label %75, label %81
75: ; preds = %72
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.8, i64 0, i64 0))
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0))
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0))
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %3
br label %88
81: ; preds = %72
%82 = load i8*, i8** %7
%83 = icmp ne i8* %82, null
br i1 %83, label %84, label %87
84: ; preds = %81
%85 = load i8*, i8** %7
%86 = call i32 @processing_data(i8* %85)
store i32 0, i32* %3
br label %88
87: ; preds = %81
store i32 0, i32* %3
br label %88
88: ; preds = %87, %84, %75, %66, %42
%89 = load i32, i32* %3
ret i32 %89
}

LLVM IR (-O2):
@opterr = global i64 0
@.str = [4 x i8] c"hf:\00"
@optarg = global i8* null
@optopt = global float 0.000000e+00
@stderr = global i32 0
@.str.1 = [32 x i8] c"Option -%c requires input file\0A\00"
@.str.2 = [23 x i8] c"Unknown option `-%c'.\0A\00"
@.str.3 = [34 x i8] c"Unknown option character `\\x%x'.\0A\00"
@optind = global i32 0
@.str.4 = [24 x i8] c"Non-option argument %s\0A\00"
@.str.5 = [12 x i8] c"secret_mode\00"
@.str.7 = [11 x i8] c"Helptext: \00"
@str = [42 x i8] c"One can use one of the following options:\00"
@str.12 = [24 x i8] c"-h\09\09show this help text\00"
@str.13 = [40 x i8] c"-f <file>\09do calc based on a file input\00"
@str.14 = [42 x i8] c"???\09\09more options still under development\00"
@str.15 = [33 x i8] c"You found the super secret mode!\00"
define i32 @main(i32 %0, i8** %1) {
store i64 0, i64* @opterr
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %10, %9 ], [ null, %2 ]
%5 = phi i32 [ %7, %9 ], [ 0, %2 ]
br label %6
6: ; preds = %3, %6
%7 = phi i32 [ 1, %6 ], [ %5, %3 ]
%8 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
switch i32 %8, label %26 [
i32 -1, label %28
i32 104, label %6
i32 102, label %9
i32 63, label %11
]
9: ; preds = %6
%10 = load i8*, i8** @optarg
br label %3
11: ; preds = %6
%12 = load float, float* @optopt
%13 = fcmp oeq float %12, 1.020000e+02
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), float 1.020000e+02)
br label %59
17: ; preds = %11
%18 = tail call i32 @isprint(float %12)
%19 = icmp eq i32 %18, 0
%20 = load i32, i32* @stderr
%21 = load float, float* @optopt
br i1 %19, label %24, label %22
22: ; preds = %17
%23 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), float %21)
br label %59
24: ; preds = %17
%25 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), float %21)
br label %59
26: ; preds = %6
%27 = tail call i32 (...) @abort()
unreachable
28: ; preds = %6
%29 = load i32, i32* @optind
%30 = icmp slt i32 %29, %0
br i1 %30, label %31, label %47
31: ; preds = %28
%32 = sext i32 %29 to i64
br label %36
33: ; preds = %36
%34 = trunc i64 %44 to i32
%35 = icmp eq i32 %34, %0
br i1 %35, label %47, label %36
36: ; preds = %31, %33
%37 = phi i64 [ %32, %31 ], [ %44, %33 ]
%38 = getelementptr inbounds i8*, i8** %1, i64 %37
%39 = load i8*, i8** %38
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %39)
%41 = load i8*, i8** %38
%42 = tail call i32 @strcmp(i8* dereferenceable(1) %41, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
%44 = add nsw i64 %37, 1
br i1 %43, label %45, label %33
45: ; preds = %36
%46 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.15, i64 0, i64 0))
br label %59
47: ; preds = %33, %28
%48 = icmp eq i32 %7, 0
br i1 %48, label %55, label %49
49: ; preds = %47
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%51 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.12, i64 0, i64 0))
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.13, i64 0, i64 0))
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.14, i64 0, i64 0))
br label %59
55: ; preds = %47
%56 = icmp eq i8* %4, null
br i1 %56, label %59, label %57
57: ; preds = %55
%58 = tail call i32 @processing_data(i8* %4)
br label %59
59: ; preds = %55, %14, %24, %22, %57, %49, %45
%60 = phi i32 [ 0, %45 ], [ 0, %49 ], [ 0, %57 ], [ 1, %22 ], [ 1, %24 ], [ 1, %14 ], [ 0, %55 ]
ret i32 %60
}