#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 atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char getopt(int, char **, char *);
char *optarg;
int optopt;
int /*<<< orphan*/ printHelpDialog();
int /*<<< orphan*/ stderr;
void get_arg(int argc, char **argv, char **inputfile, int *read_len,
             int *ntiles, int *minQ, char **outputfile, int *ptrf) {
  char tmp;
  if (argc != 11 && argc != 9 && argc != 7 && argc != 3 && argc != 12 &&
      argc != 10 && argc != 8 && argc != 4) {
    printHelpDialog();
  }
  while ((tmp = getopt(argc, argv, "hi:l:t:q:o:f")) != -1) {
    switch (tmp) {
    case 'h':
      printHelpDialog();
      break;
    case 'i':
      *inputfile = optarg;
      break;
    case 'l':
      *read_len = atoi(optarg);
      break;
    case 't':
      *ntiles = atoi(optarg);
      break;
    case 'q':
      *minQ = atoi(optarg);
      break;
    case 'f':
      *ptrf = 1;
      break;
    case 'o':
      *outputfile = optarg;
      break;
    default:
      fprintf(stderr, "%s: option `-%c' is invalid: ignored\n", argv[0],
              optopt);
      printHelpDialog();
      break;
    }
  }
  if (*read_len == 0) {
    fprintf(stderr, "read length was not properly initialized. \n");
    printHelpDialog();
  }
  if (*inputfile == NULL) {
    fprintf(stderr, "Input file was not properly initialized. \n");
    printHelpDialog();
  }
  if (*inputfile == NULL) {
    fprintf(stderr, "Output file was not properly initialized. \n");
    printHelpDialog();
  }
}


x86 assembly (clang, -O0):
<get_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0xb,-0x4(%rbp)
je     11be <get_arg+0x7e>
cmpl   $0x9,-0x4(%rbp)
je     11be <get_arg+0x7e>
cmpl   $0x7,-0x4(%rbp)
je     11be <get_arg+0x7e>
cmpl   $0x3,-0x4(%rbp)
je     11be <get_arg+0x7e>
cmpl   $0xc,-0x4(%rbp)
je     11be <get_arg+0x7e>
cmpl   $0xa,-0x4(%rbp)
je     11be <get_arg+0x7e>
cmpl   $0x8,-0x4(%rbp)
je     11be <get_arg+0x7e>
cmpl   $0x4,-0x4(%rbp)
je     11be <get_arg+0x7e>
mov    $0x0,%al
call   1040 <printHelpDialog@plt>
jmp    11c3 <get_arg+0x83>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe6b(%rip),%rdx
call   1050 <getopt@plt>
mov    %al,-0x31(%rbp)
movsbl %al,%eax
cmp    $0xffffffff,%eax
je     12dd <get_arg+0x19d>
movsbl -0x31(%rbp),%eax
add    $0xffffff9a,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0xe,%eax
ja     12aa <get_arg+0x16a>
mov    -0x40(%rbp),%rax
lea    0xdfa(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1040 <printHelpDialog@plt>
jmp    12d8 <get_arg+0x198>
mov    0x2dd6(%rip),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    12d8 <get_arg+0x198>
mov    0x2dc0(%rip),%rax
mov    (%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    12d8 <get_arg+0x198>
mov    0x2da4(%rip),%rax
mov    (%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
jmp    12d8 <get_arg+0x198>
mov    0x2d88(%rip),%rax
mov    (%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
jmp    12d8 <get_arg+0x198>
mov    0x18(%rbp),%rax
movl   $0x1,(%rax)
jmp    12d8 <get_arg+0x198>
mov    0x2d5d(%rip),%rax
mov    (%rax),%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
jmp    12d8 <get_arg+0x198>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    0x2d1f(%rip),%rax
mov    (%rax),%ecx
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <printHelpDialog@plt>
jmp    11c3 <get_arg+0x83>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1308 <get_arg+0x1c8>
mov    0x2cdf(%rip),%rax
mov    (%rax),%edi
lea    0xd75(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <printHelpDialog@plt>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1334 <get_arg+0x1f4>
mov    0x2cb3(%rip),%rax
mov    (%rax),%edi
lea    0xd75(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <printHelpDialog@plt>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1360 <get_arg+0x220>
mov    0x2c87(%rip),%rax
mov    (%rax),%edi
lea    0xd74(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <printHelpDialog@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x20(%rsp)
mov    %r8,0x18(%rsp)
mov    %rcx,%r13
mov    %rdx,(%rsp)
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x68(%rsp),%rax
mov    %rax,0x10(%rsp)
mov    0x60(%rsp),%rax
mov    %rax,0x8(%rsp)
lea    -0x7(%rbp),%eax
cmp    $0x6,%eax
jb     118f <get_arg+0x4f>
lea    -0x3(%rbp),%eax
cmp    $0x2,%eax
jb     118f <get_arg+0x4f>
xor    %eax,%eax
call   1040 <printHelpDialog@plt>
lea    0xea6(%rip),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <getopt@plt>
cmp    $0xff,%al
je     1264 <get_arg+0x124>
lea    0xe8d(%rip),%r14
lea    0xe4a(%rip),%r12
mov    0x2e3b(%rip),%r15
jmp    11fa <get_arg+0xba>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
mov    0x2e0e(%rip),%rax
mov    (%rax),%ecx
lea    0xe6e(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <printHelpDialog@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <getopt@plt>
cmp    $0xff,%al
je     1264 <get_arg+0x124>
movsbl %al,%eax
add    $0xffffff9a,%eax
cmp    $0xe,%eax
ja     11bf <get_arg+0x7f>
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
mov    0x10(%rsp),%rax
movl   $0x1,(%rax)
jmp    11e9 <get_arg+0xa9>
mov    (%r15),%rax
mov    (%rsp),%rcx
mov    %rax,(%rcx)
jmp    11e9 <get_arg+0xa9>
mov    (%r15),%rdi
call   1060 <atoi@plt>
mov    %eax,0x0(%r13)
jmp    11e9 <get_arg+0xa9>
mov    (%r15),%rax
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx)
jmp    11e9 <get_arg+0xa9>
mov    (%r15),%rdi
call   1060 <atoi@plt>
mov    0x20(%rsp),%rcx
mov    %eax,(%rcx)
jmp    11e9 <get_arg+0xa9>
mov    (%r15),%rdi
call   1060 <atoi@plt>
mov    0x18(%rsp),%rcx
mov    %eax,(%rcx)
jmp    11e9 <get_arg+0xa9>
cmpl   $0x0,0x0(%r13)
jne    1289 <get_arg+0x149>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
lea    0xdf4(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <printHelpDialog@plt>
mov    (%rsp),%rbp
cmpq   $0x0,0x0(%rbp)
jne    12b9 <get_arg+0x179>
mov    0x2d35(%rip),%rbx
mov    (%rbx),%edi
lea    0xdf7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <printHelpDialog@plt>
cmpq   $0x0,0x0(%rbp)
je     12c8 <get_arg+0x188>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%edi
lea    0xdf5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printHelpDialog@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"hi:l:t:q:o:f\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [38 x i8] c"%s: option `-%c' is invalid: ignored\0A\00"
@optopt = global i32 0
@.str.2 = [44 x i8] c"read length was not properly initialized. \0A\00"
@.str.3 = [43 x i8] c"Input file was not properly initialized. \0A\00"
@.str.4 = [44 x i8] c"Output file was not properly initialized. \0A\00"
define void @get_arg(i32 %0, i8** %1, i8** %2, i32* %3, i32* %4, i32* %5, i8** %6, i32* %7) {
%9 = alloca i32
%10 = alloca i8**
%11 = alloca i8**
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i8**
%16 = alloca i32*
%17 = alloca i8
store i32 %0, i32* %9
store i8** %1, i8*** %10
store i8** %2, i8*** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32* %5, i32** %14
store i8** %6, i8*** %15
store i32* %7, i32** %16
%18 = load i32, i32* %9
%19 = icmp ne i32 %18, 11
br i1 %19, label %20, label %43
20: ; preds = %8
%21 = load i32, i32* %9
%22 = icmp ne i32 %21, 9
br i1 %22, label %23, label %43
23: ; preds = %20
%24 = load i32, i32* %9
%25 = icmp ne i32 %24, 7
br i1 %25, label %26, label %43
26: ; preds = %23
%27 = load i32, i32* %9
%28 = icmp ne i32 %27, 3
br i1 %28, label %29, label %43
29: ; preds = %26
%30 = load i32, i32* %9
%31 = icmp ne i32 %30, 12
br i1 %31, label %32, label %43
32: ; preds = %29
%33 = load i32, i32* %9
%34 = icmp ne i32 %33, 10
br i1 %34, label %35, label %43
35: ; preds = %32
%36 = load i32, i32* %9
%37 = icmp ne i32 %36, 8
br i1 %37, label %38, label %43
38: ; preds = %35
%39 = load i32, i32* %9
%40 = icmp ne i32 %39, 4
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (...) @printHelpDialog()
br label %43
43: ; preds = %41, %38, %35, %32, %29, %26, %23, %20, %8
br label %44
44: ; preds = %83, %43
%45 = load i32, i32* %9
%46 = load i8**, i8*** %10
%47 = call signext i8 @getopt(i32 %45, i8** %46, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8 %47, i8* %17
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, -1
br i1 %49, label %50, label %84
50: ; preds = %44
%51 = load i8, i8* %17
%52 = sext i8 %51 to i32
switch i32 %52, label %75 [
i32 104, label %53
i32 105, label %55
i32 108, label %58
i32 116, label %62
i32 113, label %66
i32 102, label %70
i32 111, label %72
]
53: ; preds = %50
%54 = call i32 (...) @printHelpDialog()
br label %83
55: ; preds = %50
%56 = load i8*, i8** @optarg
%57 = load i8**, i8*** %11
store i8* %56, i8** %57
br label %83
58: ; preds = %50
%59 = load i8*, i8** @optarg
%60 = call i32 @atoi(i8* %59)
%61 = load i32*, i32** %12
store i32 %60, i32* %61
br label %83
62: ; preds = %50
%63 = load i8*, i8** @optarg
%64 = call i32 @atoi(i8* %63)
%65 = load i32*, i32** %13
store i32 %64, i32* %65
br label %83
66: ; preds = %50
%67 = load i8*, i8** @optarg
%68 = call i32 @atoi(i8* %67)
%69 = load i32*, i32** %14
store i32 %68, i32* %69
br label %83
70: ; preds = %50
%71 = load i32*, i32** %16
store i32 1, i32* %71
br label %83
72: ; preds = %50
%73 = load i8*, i8** @optarg
%74 = load i8**, i8*** %15
store i8* %73, i8** %74
br label %83
75: ; preds = %50
%76 = load i32, i32* @stderr
%77 = load i8**, i8*** %10
%78 = getelementptr inbounds i8*, i8** %77, i64 0
%79 = load i8*, i8** %78
%80 = load i32, i32* @optopt
%81 = call i32 (i32, i8*, ...) @fprintf(i32 %76, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %79, i32 %80)
%82 = call i32 (...) @printHelpDialog()
br label %83
83: ; preds = %75, %72, %70, %66, %62, %58, %55, %53
br label %44
84: ; preds = %44
%85 = load i32*, i32** %12
%86 = load i32, i32* %85
%87 = icmp eq i32 %86, 0
br i1 %87, label %88, label %92
88: ; preds = %84
%89 = load i32, i32* @stderr
%90 = call i32 (i32, i8*, ...) @fprintf(i32 %89, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%91 = call i32 (...) @printHelpDialog()
br label %92
92: ; preds = %88, %84
%93 = load i8**, i8*** %11
%94 = load i8*, i8** %93
%95 = icmp eq i8* %94, null
br i1 %95, label %96, label %100
96: ; preds = %92
%97 = load i32, i32* @stderr
%98 = call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%99 = call i32 (...) @printHelpDialog()
br label %100
100: ; preds = %96, %92
%101 = load i8**, i8*** %11
%102 = load i8*, i8** %101
%103 = icmp eq i8* %102, null
br i1 %103, label %104, label %108
104: ; preds = %100
%105 = load i32, i32* @stderr
%106 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%107 = call i32 (...) @printHelpDialog()
br label %108
108: ; preds = %104, %100
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"hi:l:t:q:o:f\00"
@optarg = global i8* null
@stderr = global i32 0
@.str.1 = [38 x i8] c"%s: option `-%c' is invalid: ignored\0A\00"
@optopt = global i32 0
@.str.2 = [44 x i8] c"read length was not properly initialized. \0A\00"
@.str.3 = [43 x i8] c"Input file was not properly initialized. \0A\00"
@.str.4 = [44 x i8] c"Output file was not properly initialized. \0A\00"
define void @get_arg(i32 %0, i8** %1, i8** nocapture %2, i32* nocapture %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, i8** nocapture writeonly %6, i32* nocapture writeonly %7) {
switch i32 %0, label %9 [
i32 12, label %11
i32 11, label %11
i32 10, label %11
i32 9, label %11
i32 8, label %11
i32 7, label %11
i32 4, label %11
i32 3, label %11
]
9: ; preds = %8
%10 = tail call i32 (...) @printHelpDialog()
br label %11
11: ; preds = %8, %8, %8, %8, %8, %8, %8, %8, %9
%12 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i8 %12, -1
br i1 %13, label %42, label %14
14: ; preds = %11, %39
%15 = phi i8 [ %40, %39 ], [ %12, %11 ]
%16 = sext i8 %15 to i32
switch i32 %16, label %33 [
i32 104, label %17
i32 105, label %19
i32 108, label %21
i32 116, label %24
i32 113, label %27
i32 102, label %30
i32 111, label %31
]
17: ; preds = %14
%18 = tail call i32 (...) @printHelpDialog()
br label %39
19: ; preds = %14
%20 = load i8*, i8** @optarg
store i8* %20, i8** %2
br label %39
21: ; preds = %14
%22 = load i8*, i8** @optarg
%23 = tail call i32 @atoi(i8* %22)
store i32 %23, i32* %3
br label %39
24: ; preds = %14
%25 = load i8*, i8** @optarg
%26 = tail call i32 @atoi(i8* %25)
store i32 %26, i32* %4
br label %39
27: ; preds = %14
%28 = load i8*, i8** @optarg
%29 = tail call i32 @atoi(i8* %28)
store i32 %29, i32* %5
br label %39
30: ; preds = %14
store i32 1, i32* %7
br label %39
31: ; preds = %14
%32 = load i8*, i8** @optarg
store i8* %32, i8** %6
br label %39
33: ; preds = %14
%34 = load i32, i32* @stderr
%35 = load i8*, i8** %1
%36 = load i32, i32* @optopt
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %35, i32 %36)
%38 = tail call i32 (...) @printHelpDialog()
br label %39
39: ; preds = %33, %31, %30, %27, %24, %21, %19, %17
%40 = tail call signext i8 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%41 = icmp eq i8 %40, -1
br i1 %41, label %42, label %14
42: ; preds = %39, %11
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %49
45: ; preds = %42
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%48 = tail call i32 (...) @printHelpDialog()
br label %49
49: ; preds = %45, %42
%50 = load i8*, i8** %2
%51 = icmp eq i8* %50, null
br i1 %51, label %52, label %62
52: ; preds = %49
%53 = load i32, i32* @stderr
%54 = tail call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%55 = tail call i32 (...) @printHelpDialog()
%56 = load i8*, i8** %2
%57 = icmp eq i8* %56, null
br i1 %57, label %58, label %62
58: ; preds = %52
%59 = load i32, i32* @stderr
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%61 = tail call i32 (...) @printHelpDialog()
br label %62
62: ; preds = %49, %58, %52
ret void
}