#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_SUCCESS;
double atof(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
void parse_args(int argc, char *argv[], char **if_name, double *e) {
  size_t if_name_len;
  if ((argc == 2) && (strcmp(argv[1], "-v") == 0)) {
    printf("%s v."
           "0.1"
           "\n",
           argv[0]);
    exit(EXIT_SUCCESS);
  }
  if (argc != 3) {
    fprintf(stderr,
            "Divide FastQ file into length-based buckets.\n"
            "Each bucket contains all reads with length in the range [a,b]\n"
            "defined by the value e such that floor(e * a) = floor(e * b)\n"
            "and the interval is maximal."
            "\n\n"
            "  Usage: %s <inputfilename> <e>\n"
            "    (show program version: %s -v)\n\n"
            "  Output: (for each range) <a>.<b>.<inputfilename>\n",
            argv[0], argv[0]);
    exit(EXIT_FAILURE);
  }
  *if_name = argv[1];
  *e = atof(argv[2]);
  if (*e < 0.0 || *e > 1.0) {
    fprintf(stderr, "e must be between 0 and 1\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<parse_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    11b0 <parse_args+0x60>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe88(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11b0 <parse_args+0x60>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e27(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
cmpl   $0x3,-0x4(%rbp)
je     11ed <parse_args+0x9d>
mov    0x2e1f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xe3d(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
ja     123c <parse_args+0xec>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xdce(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1261 <parse_args+0x111>
mov    0x2d9d(%rip),%rax
mov    (%rax),%edi
lea    0xf06(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2d7e(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_args>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    1190 <parse_args+0x40>
mov    %rcx,%r14
mov    0x8(%rbx),%rax
mov    %rax,(%rdx)
mov    0x10(%rbx),%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%r14)
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     11e6 <parse_args+0x96>
ucomisd 0xe7a(%rip),%xmm0
ja     11e6 <parse_args+0x96>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
cmp    $0x2,%edi
jne    11c7 <parse_args+0x77>
mov    0x8(%rbx),%rdi
lea    0xe68(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11c7 <parse_args+0x77>
mov    (%rbx),%rsi
lea    0xe57(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
mov    0x2e12(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rcx
lea    0xe3b(%rip),%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    11fd <parse_args+0xad>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
lea    0xf5c(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-v\00"
@.str.1 = [10 x i8] c"%s v.0.1\0A\00"
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str.2 = [317 x i8] c"Divide FastQ file into length-based buckets.\0AEach bucket contains all reads with length in the range [a,b]\0Adefined by the value e such that floor(e * a) = floor(e * b)\0Aand the interval is maximal.\0A\0A Usage: %s <inputfilename> <e>\0A (show program version: %s -v)\0A\0A Output: (for each range) <a>.<b>.<inputfilename>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [27 x i8] c"e must be between 0 and 1\0A\00"
define void @parse_args(i32 %0, i8** %1, i8** %2, double* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca double*
%9 = alloca i64
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store double* %3, double** %8
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %25
12: ; preds = %4
%13 = load i8**, i8*** %6
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = load i8**, i8*** %6
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = load i32, i32* @EXIT_SUCCESS
%24 = call i32 @exit(i32 %23)
unreachable
25: ; preds = %12, %4
%26 = load i32, i32* %5
%27 = icmp ne i32 %26, 3
br i1 %27, label %28, label %39
28: ; preds = %25
%29 = load i32, i32* @stderr
%30 = load i8**, i8*** %6
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = load i8**, i8*** %6
%34 = getelementptr inbounds i8*, i8** %33, i64 0
%35 = load i8*, i8** %34
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([317 x i8], [317 x i8]* @.str.2, i64 0, i64 0), i8* %32, i8* %35)
%37 = load i32, i32* @EXIT_FAILURE
%38 = call i32 @exit(i32 %37)
unreachable
39: ; preds = %25
%40 = load i8**, i8*** %6
%41 = getelementptr inbounds i8*, i8** %40, i64 1
%42 = load i8*, i8** %41
%43 = load i8**, i8*** %7
store i8* %42, i8** %43
%44 = load i8**, i8*** %6
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = call double @atof(i8* %46)
%48 = load double*, double** %8
store double %47, double* %48
%49 = load double*, double** %8
%50 = load double, double* %49
%51 = fcmp olt double %50, 0.000000e+00
br i1 %51, label %56, label %52
52: ; preds = %39
%53 = load double*, double** %8
%54 = load double, double* %53
%55 = fcmp ogt double %54, 1.000000e+00
br i1 %55, label %56, label %61
56: ; preds = %52, %39
%57 = load i32, i32* @stderr
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%59 = load i32, i32* @EXIT_FAILURE
%60 = call i32 @exit(i32 %59)
unreachable
61: ; preds = %52
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"-v\00"
@.str.1 = [10 x i8] c"%s v.0.1\0A\00"
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str.2 = [317 x i8] c"Divide FastQ file into length-based buckets.\0AEach bucket contains all reads with length in the range [a,b]\0Adefined by the value e such that floor(e * a) = floor(e * b)\0Aand the interval is maximal.\0A\0A Usage: %s <inputfilename> <e>\0A (show program version: %s -v)\0A\0A Output: (for each range) <a>.<b>.<inputfilename>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.3 = [27 x i8] c"e must be between 0 and 1\0A\00"
define void @parse_args(i32 %0, i8** nocapture %1, i8** nocapture writeonly %2, double* nocapture writeonly %3) {
switch i32 %0, label %15 [
i32 2, label %5
i32 3, label %21
]
5: ; preds = %4
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8*, i8** %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_SUCCESS
%14 = tail call i32 @exit(i32 %13)
unreachable
15: ; preds = %5, %4
%16 = load i32, i32* @stderr
%17 = load i8*, i8** %1
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([317 x i8], [317 x i8]* @.str.2, i64 0, i64 0), i8* %17, i8* %17)
%19 = load i32, i32* @EXIT_FAILURE
%20 = tail call i32 @exit(i32 %19)
unreachable
21: ; preds = %4
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
store i8* %23, i8** %2
%24 = getelementptr inbounds i8*, i8** %1, i64 2
%25 = load i8*, i8** %24
%26 = tail call double @atof(i8* %25)
store double %26, double* %3
%27 = fcmp olt double %26, 0.000000e+00
%28 = fcmp ogt double %26, 1.000000e+00
%29 = or i1 %27, %28
br i1 %29, label %30, label %35
30: ; preds = %21
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%33 = load i32, i32* @EXIT_FAILURE
%34 = tail call i32 @exit(i32 %33)
unreachable
35: ; preds = %21
ret void
}