#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 */
struct file_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close_sequential_reads(struct file_data *);
int /*<<< orphan*/ exit(int);
int getopt(int, char **, char *);
int initialize_sequential_reads(struct file_data **, char *);
scalar_t__ optind;
int print_file(struct file_data *, int, int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  struct file_data *filed = NULL;
  int ch;
  int output_fasta = 0;
  int output_qual = 0;
  int output_extras = 0;
  while ((ch = getopt(argc, argv, "Fqeh")) != -1) {
    switch (ch) {
    case 'F':
      output_fasta = 1;
      break;
    case 'q':
      output_qual = 1;
      break;
    case 'e':
      output_extras = 1;
      break;
    case 'h':
      usage();
      break;
    case '?':
    default:
      usage();
    }
  }
  argc -= optind;
  argv += optind;
  if (argc != 1) {
    usage();
  }
  if (initialize_sequential_reads(&filed, argv[0]) == -1) {
    printf("File %s does not exists", argv[0]);
    exit(-1);
  }
  int res = print_file(filed, output_fasta, output_qual, output_extras);
  close_sequential_reads(filed);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe4f(%rip),%rdx
call   1070 <getopt@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     125b <main+0xeb>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
sub    $0x3f,%eax
je     124a <main+0xda>
jmp    11d6 <main+0x66>
mov    -0x30(%rbp),%eax
sub    $0x46,%eax
je     121a <main+0xaa>
jmp    11e7 <main+0x77>
mov    -0x30(%rbp),%eax
sub    $0x65,%eax
je     1232 <main+0xc2>
jmp    11f8 <main+0x88>
mov    -0x30(%rbp),%eax
sub    $0x68,%eax
je     123e <main+0xce>
jmp    1209 <main+0x99>
mov    -0x30(%rbp),%eax
sub    $0x71,%eax
je     1226 <main+0xb6>
jmp    124f <main+0xdf>
movl   $0x1,-0x20(%rbp)
jmp    1256 <main+0xe6>
movl   $0x1,-0x24(%rbp)
jmp    1256 <main+0xe6>
movl   $0x1,-0x28(%rbp)
jmp    1256 <main+0xe6>
mov    $0x0,%al
call   1060 <usage@plt>
jmp    1256 <main+0xe6>
jmp    124f <main+0xdf>
mov    $0x0,%al
call   1060 <usage@plt>
jmp    11a3 <main+0x33>
mov    0x2d86(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    0x2d72(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1296 <main+0x126>
mov    $0x0,%al
call   1060 <usage@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    -0x18(%rbp),%rdi
call   1080 <initialize_sequential_reads@plt>
cmp    $0xffffffff,%eax
jne    12cc <main+0x15c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd48(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
call   1040 <print_file@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <close_sequential_reads@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%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,%ebp
movq   $0x0,(%rsp)
lea    0xe71(%rip),%r13
xor    %r14d,%r14d
xor    %r12d,%r12d
xor    %r15d,%r15d
jmp    11a7 <main+0x37>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <usage@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
call   1070 <getopt@plt>
cmp    $0x67,%eax
jle    11d0 <main+0x60>
cmp    $0x68,%eax
je     11a0 <main+0x30>
cmp    $0x71,%eax
jne    11a0 <main+0x30>
mov    $0x1,%r14d
jmp    11a7 <main+0x37>
nopl   0x0(%rax,%rax,1)
cmp    $0xffffffff,%eax
je     11ef <main+0x7f>
cmp    $0x46,%eax
je     11e7 <main+0x77>
cmp    $0x65,%eax
jne    11a0 <main+0x30>
mov    $0x1,%r15d
jmp    11a7 <main+0x37>
mov    $0x1,%r12d
jmp    11a7 <main+0x37>
mov    0x2df2(%rip),%rax
mov    (%rax),%r13
sub    %r13d,%ebp
cmp    $0x1,%ebp
je     1208 <main+0x98>
xor    %eax,%eax
call   1060 <usage@plt>
mov    (%rbx,%r13,8),%rsi
mov    %rsp,%rdi
call   1080 <initialize_sequential_reads@plt>
cmp    $0xffffffff,%eax
je     1247 <main+0xd7>
mov    (%rsp),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    %r15d,%ecx
call   1040 <print_file@plt>
mov    %eax,%ebx
mov    (%rsp),%rdi
call   1050 <close_sequential_reads@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx,%r13,8),%rsi
lea    0xdb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
%struct.file_data = type { i32 }
@.str = [5 x i8] c"Fqeh\00"
@optind = global i64 0
@.str.1 = [24 x i8] c"File %s does not exists\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.file_data*
%7 = alloca i32
%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 %struct.file_data* null, %struct.file_data** %6
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
br label %12
12: ; preds = %27, %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @getopt(i32 %13, i8** %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %15, i32* %7
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %28
17: ; preds = %12
%18 = load i32, i32* %7
switch i32 %18, label %25 [
i32 70, label %19
i32 113, label %20
i32 101, label %21
i32 104, label %22
i32 63, label %24
]
19: ; preds = %17
store i32 1, i32* %8
br label %27
20: ; preds = %17
store i32 1, i32* %9
br label %27
21: ; preds = %17
store i32 1, i32* %10
br label %27
22: ; preds = %17
%23 = call i32 (...) @usage()
br label %27
24: ; preds = %17
br label %25
25: ; preds = %17, %24
%26 = call i32 (...) @usage()
br label %27
27: ; preds = %25, %22, %21, %20, %19
br label %12
28: ; preds = %12
%29 = load i64, i64* @optind
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = sub nsw i64 %31, %29
%33 = trunc i64 %32 to i32
store i32 %33, i32* %4
%34 = load i64, i64* @optind
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 %34
store i8** %36, i8*** %5
%37 = load i32, i32* %4
%38 = icmp ne i32 %37, 1
br i1 %38, label %39, label %41
39: ; preds = %28
%40 = call i32 (...) @usage()
br label %41
41: ; preds = %39, %28
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 0
%44 = load i8*, i8** %43
%45 = call i32 @initialize_sequential_reads(%struct.file_data** %6, i8* %44)
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %53
47: ; preds = %41
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 0
%50 = load i8*, i8** %49
%51 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %50)
%52 = call i32 @exit(i32 -1)
unreachable
53: ; preds = %41
%54 = load %struct.file_data*, %struct.file_data** %6
%55 = load i32, i32* %8
%56 = load i32, i32* %9
%57 = load i32, i32* %10
%58 = call i32 @print_file(%struct.file_data* %54, i32 %55, i32 %56, i32 %57)
store i32 %58, i32* %11
%59 = load %struct.file_data*, %struct.file_data** %6
%60 = call i32 @close_sequential_reads(%struct.file_data* %59)
%61 = load i32, i32* %11
ret i32 %61
}

LLVM IR (-O2):
%struct.file_data = type { i32 }
@.str = [5 x i8] c"Fqeh\00"
@optind = global i64 0
@.str.1 = [24 x i8] c"File %s does not exists\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.file_data*
%4 = bitcast %struct.file_data** %3 to i8*
store %struct.file_data* null, %struct.file_data** %3
br label %5
5: ; preds = %14, %2
%6 = phi i32 [ 0, %2 ], [ 1, %14 ]
%7 = phi i32 [ 0, %2 ], [ %10, %14 ]
%8 = phi i32 [ 0, %2 ], [ %13, %14 ]
br label %9
9: ; preds = %14, %5
%10 = phi i32 [ %7, %5 ], [ 1, %14 ]
%11 = phi i32 [ %8, %5 ], [ %13, %14 ]
br label %12
12: ; preds = %14, %9
%13 = phi i32 [ %11, %9 ], [ 1, %14 ]
br label %14
14: ; preds = %20, %12
%15 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
switch i32 %15, label %18 [
i32 -1, label %21
i32 70, label %5
i32 113, label %9
i32 101, label %12
i32 104, label %16
]
16: ; preds = %14
%17 = tail call i32 (...) @usage()
br label %20
18: ; preds = %14
%19 = tail call i32 (...) @usage()
br label %20
20: ; preds = %18, %16
br label %14
21: ; preds = %14
%22 = load i64, i64* @optind
%23 = trunc i64 %22 to i32
%24 = sub i32 %0, %23
%25 = getelementptr inbounds i8*, i8** %1, i64 %22
%26 = icmp eq i32 %24, 1
br i1 %26, label %29, label %27
27: ; preds = %21
%28 = tail call i32 (...) @usage()
br label %29
29: ; preds = %27, %21
%30 = load i8*, i8** %25
%31 = call i32 @initialize_sequential_reads(%struct.file_data** %3, i8* %30)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = load i8*, i8** %25
%35 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %34)
%36 = call i32 @exit(i32 -1)
unreachable
37: ; preds = %29
%38 = load %struct.file_data*, %struct.file_data** %3
%39 = call i32 @print_file(%struct.file_data* %38, i32 %6, i32 %10, i32 %13)
%40 = load %struct.file_data*, %struct.file_data** %3
%41 = call i32 @close_sequential_reads(%struct.file_data* %40)
ret i32 %39
}