// File: /workspace/github_cpp_makefile_star2_O1/Infinidat[P]slimfastq/config.cpp
// Function: Config::init(int, char**)
void Config::init(int argc, char **argv) {
    if (initialized)
        croak("Internal error: 2nd Config init");

    initialized = true;

    std::string usr, fil;
    bool overwrite = false;
    bool statistics = false;

    if (argc == 1) usage();
    // TODO? long options
    // const char* short_opt = "POvhd 1234 u:f:s:p:l:";
    const char* short_opt = "qPsvhdO 1234 u:f:l:";
    for ( int opt = getopt(argc, argv, short_opt);
          opt != -1;
          opt     = getopt(argc, argv, short_opt))
        switch (opt) {
        case 'u': usr = optarg ; break;
        case 'f': fil = optarg ; break;

        case 'l': level = strtoll(optarg, 0, 0);  break;
        case '1': case '2' : case '3': case '4':
            level = opt - '0'; break;

        case 'd': encode     = false; break;
        case 'O': overwrite  = true ; break;
        case 'P': profiling  = true ; break;
        case 'q': quiet      = true ; break;
        case 'v':
            printf("Version %s\nInternal format version=%u\n", user_version, version);
            exit(0);
        case 'h':
            usage();
        case 's': statistics = true; encode = false; break;

        default:
            croak("Ilagal args: use -h for help");
        }

    while (optind < argc) {
        // DWIM guessing ...
        char *file = argv[optind ++];
        FILE* fh = fopen(file, "rb");
        if (! fh) {
            if  (not encode and not usr.length())
                usr = file;
            else if (encode and not fil.length())
                fil = file;
            else {
                fprintf(stderr, "What am I suppose to do with '%s'?\n (please specify explicitly with -f/-u prefix)\n(Note: not an existing file)\n",
                        file);
                exit(1);
            }
            continue;
        }
        const char* sfqstamp = "whoami=slimfastq" ;
        char initline[20];
        BZERO(initline);
        size_t cnt = fread(initline, 1, 19, fh);
        if (cnt and
            not fil.length() and
            0 == strncmp(initline, sfqstamp, strlen(sfqstamp))) {
            fil = file;
            encode = !! usr.length();
        }
        else if (cnt and
                 not usr.length() and
                 initline[0] == '@') {
            usr = file;
        }
        else if (not usr.length() and
                 not encode and
                 (not cnt or overwrite)) {
            usr = file;
        }
        else if (encode and
                 usr.length() and
                 not fil.length() and
                 (not cnt or overwrite)) {
            fil = file;
        }
        else {
            fprintf(stderr, "What am I suppose to do with '%s'?\n (please specify explicitly with -f/-u prefix)\n(Note: file exists!)\n", file);
            exit(1);
        }
    }
    check_op(fil.length(), 'f');

    const char* wr_flags = overwrite ? "wb" : "wbx" ;
    if (encode) {
        FILE* fh = fopen(fil.c_str(), wr_flags);
        check_fh(fh, fil, false);
        FilerSave::init(fh);
        m_info_filer = new FilerSave(42);
        set_info("whoami", "slimfastq");
        set_info("version", version);
        set_info("config.level", range_level(level));

        if (usr.length()) {
            set_info("orig.filename", usr.c_str());
            f_usr = fopen(usr.c_str(), "rb") ;
            check_fh(f_usr, usr, true);
            fseek(f_usr, 0L, SEEK_END);
            set_info("orig.size", ftell(f_usr));
            fseek(f_usr, 0L, SEEK_SET);
          }
        else {
            set_info("orig.filename", "<< stdin >>");
            f_usr = stdin ;
        }
    }
    else {
        FILE* fh = fopen(fil.c_str(), "rb");
        check_fh(fh, fil, true);
        fseek(fh, 0L, SEEK_END);
        UINT64 file_size = ftell(fh);
        fseek(fh, 0L, SEEK_SET);

        FilerLoad::init(fh);
        load_info();
        if (statistics)
            statistics_dump();

        level = range_level(get_long("config.level", 2));

        f_usr = usr.length() ? fopen(usr.c_str(), wr_flags) : stdout;
        check_fh(f_usr, usr);

        UINT64 comp_size = get_long("comp.size", 0);
        if (comp_size > 0 and
            comp_size != file_size)
            croak("expected compressed file size to be %lld", comp_size);

        decoder_version = conf.get_long("version");
        if (decoder_version and
            decoder_version > version)
            croak("%s was compressed with slimfastq version %d. My version is %d. Please upgrade me before decoing",
                  fil.c_str(), decoder_version, version);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
cmpb $0x1, 0xc434(%rip)      # 0x101e0
je 0x4553
movl %esi, %ebp
movb $0x1, 0xc425(%rip)      # 0x101e0
leaq 0x18(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x38(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
cmpl $0x1, %esi
je 0x4515
movq %rdx, %r13
movq %rdi, %rbx
leaq 0x6b3d(%rip), %r15      # 0xa92e
movl %ebp, %edi
movq %rdx, %rsi
movq %r15, %rdx
callq 0x20b0
movq $0x0, 0x58(%rsp)
leaq 0x6222(%rip), %r14      # 0xa030
movq $0x0, 0x48(%rsp)
movq %rbx, (%rsp)
movq %r13, 0x50(%rsp)
cmpl $0x4f, %eax
jg 0x3e38
leal -0x31(%rax), %ecx
cmpl $0x4, %ecx
jae 0x3e57
addl $-0x30, %eax
movl %eax, 0x4(%rbx)
jmp 0x3ed8
leal -0x64(%rax), %ecx
cmpl $0x12, %ecx
ja 0x3e69
movslq (%r14,%rcx,4), %rax
addq %r14, %rax
leaq 0x28(%rsp), %r12
jmpq *%rax
movb $0x0, 0xc(%rbx)
jmp 0x3ed8
cmpl $0x4f, %eax
jne 0x3eea
movb $0x1, %al
movq %rax, 0x48(%rsp)
jmp 0x3ed8
cmpl $0x50, %eax
jne 0x4507
movb $0x1, 0xd(%rbx)
jmp 0x3ed8
movb $0x0, 0xc(%rbx)
movb $0x1, %al
movq %rax, 0x58(%rsp)
jmp 0x3ed8
movq 0xc12c(%rip), %rax      # 0xffb8
movq (%rax), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2080
jmp 0x3e30
movb $0x1, 0xe(%rbx)
jmp 0x3ed8
leaq 0x8(%rsp), %r12
movq 0xc10c(%rip), %rax      # 0xffb8
movq (%rax), %r13
movq 0x8(%r12), %rbx
movq %r13, %rdi
callq 0x20f0
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq (%rsp), %rbx
movq %r13, %rcx
movq 0x50(%rsp), %r13
movq %rax, %r8
callq 0x2290
movl %ebp, %edi
movq %r13, %rsi
movq %r15, %rdx
callq 0x20b0
jmp 0x3e20
cmpl $-0x1, %eax
jne 0x4507
movq 0xc0de(%rip), %rbx      # 0xffd8
movl (%rbx), %eax
cmpl %ebp, %eax
movq 0x48(%rsp), %r14
jge 0x40bf
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
cltq
movq (%r13,%rax,8), %r13
movq %r13, %rdi
leaq 0x6a67(%rip), %rsi      # 0xa986
callq 0x2200
testq %rax, %rax
je 0x4004
pxor %xmm0, %xmm0
movdqa %xmm0, 0x60(%rsp)
movl $0x0, 0x70(%rsp)
movl $0x1, %esi
movl $0x13, %edx
leaq 0x60(%rsp), %rdi
movq %rax, %rcx
callq 0x2270
testq %rax, %rax
je 0x3f99
movq 0x30(%rsp), %r15
testq %r15, %r15
jne 0x3f83
movdqa 0x60(%rsp), %xmm0
pcmpeqb 0x609d(%rip), %xmm0     # 0xa010
pmovmskb %xmm0, %ecx
cmpl $0xffff, %ecx           # imm = 0xFFFF
je 0x408f
movq 0x10(%rsp), %r12
testq %r12, %r12
jne 0x3f99
cmpb $0x40, 0x60(%rsp)
leaq 0x8(%rsp), %r15
je 0x3fe2
movq 0x10(%rsp), %r12
testq %r12, %r12
je 0x4065
testq %r12, %r12
je 0x4543
movq (%rsp), %rcx
cmpb $0x0, 0xc(%rcx)
je 0x4543
testq %rax, %rax
sete %al
movq 0x30(%rsp), %r12
testq %r12, %r12
jne 0x4543
orb %r14b, %al
leaq 0x28(%rsp), %r15
testb $0x1, %al
je 0x4543
movq %r13, %rdi
callq 0x20f0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x2290
movq 0x50(%rsp), %r13
jmp 0x4059
movq (%rsp), %rax
movb 0xc(%rax), %al
testb %al, %al
jne 0x4026
movq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r15
testq %r12, %r12
je 0x4039
testb %al, %al
je 0x454b
movq 0x30(%rsp), %r12
leaq 0x28(%rsp), %r15
testq %r12, %r12
jne 0x454b
movq %r13, %rdi
callq 0x20f0
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x2290
movq 0x50(%rsp), %r13
movl (%rbx), %eax
cmpl %ebp, %eax
jl 0x3f09
jmp 0x40bf
testq %rax, %rax
sete %cl
movq (%rsp), %rdx
cmpb $0x0, 0xc(%rdx)
jne 0x3fa7
orb %r14b, %cl
testb $0x1, %cl
je 0x3fa7
leaq 0x8(%rsp), %r15
jmp 0x3fe2
movq %r13, %rdi
callq 0x20f0
leaq 0x28(%rsp), %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r13, %rcx
movq %rax, %r8
callq 0x2290
cmpq $0x0, 0x10(%rsp)
movq (%rsp), %rax
setne 0xc(%rax)
jmp 0x3ffd
cmpl $0x0, 0x30(%rsp)
je 0x4558
leaq 0x69a1(%rip), %rax      # 0xaa72
leaq 0x699d(%rip), %r14      # 0xaa75
testb $0x1, 0x48(%rsp)
cmovneq %rax, %r14
movq 0x28(%rsp), %rdi
movq (%rsp), %rax
cmpb $0x1, 0xc(%rax)
jne 0x42f0
movq %r14, %rsi
callq 0x2200
movq %rax, %r14
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe8(%rsp), %rdi
callq 0x48ae
leaq 0xe8(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x45d6
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x4152
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %r14, %rdi
callq 0x4e90
movq (%rsp), %rbx
movl $0x4040, %edi           # imm = 0x4040
callq 0x21b0
movq %rax, %r14
movq %rax, %rdi
movl $0x2a, %esi
callq 0x509a
movq %r14, 0x18(%rbx)
leaq 0x68f6(%rip), %rsi      # 0xaa79
leaq 0x6876(%rip), %rdx      # 0xaa00
movq %rbx, %rdi
callq 0x3c06
movslq (%rbx), %rdx
leaq 0x693d(%rip), %rsi      # 0xaad9
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20a0
leaq 0x68ce(%rip), %rsi      # 0xaa80
movq (%rsp), %rdi
movq %rbx, %rdx
movq (%rsp), %rbx
callq 0x3c06
movl 0x4(%rbx), %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
cmpl $0x4, %ecx
movl $0x4, %edx
cmovll %ecx, %edx
leaq 0x68f7(%rip), %rsi      # 0xaad9
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20a0
leaq 0x6890(%rip), %rsi      # 0xaa88
movq (%rsp), %rdi
movq %rbx, %rdx
movq (%rsp), %rbx
callq 0x3c06
cmpq $0x0, 0x10(%rsp)
je 0x4499
movq 0x8(%rsp), %rdx
leaq 0x5e81(%rip), %rsi      # 0xa0a1
movq %rbx, %rdi
callq 0x3c06
movq 0x8(%rsp), %rdi
leaq 0x6752(%rip), %rsi      # 0xa986
callq 0x2200
movq %rax, %r14
movq %rax, 0x10(%rbx)
leaq 0xd8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xc8(%rsp), %rdi
callq 0x48ae
leaq 0xc8(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x45d6
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x4296
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x21c0
movq (%rsp), %r14
movq 0x10(%r14), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21f0
movq 0x10(%r14), %rdi
callq 0x2030
leaq 0x681f(%rip), %rsi      # 0xaad9
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x20a0
leaq 0x67c2(%rip), %rsi      # 0xaa95
movq %r14, %rdi
movq %rbx, %rdx
callq 0x3c06
movq 0x10(%r14), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21f0
jmp 0x44bd
leaq 0x668f(%rip), %rsi      # 0xa986
callq 0x2200
movq %rax, %r12
leaq 0xb8(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0xa8(%rsp), %rdi
callq 0x48ae
leaq 0xa8(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x45d6
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x4355
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %r12, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x21f0
movq %r12, %rdi
callq 0x2030
movq %rax, %r15
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21f0
movq %r12, %rdi
callq 0x4ed4
movq (%rsp), %rbx
callq 0x386e
testb $0x1, 0x58(%rsp)
jne 0x455d
leaq 0x66ea(%rip), %rsi      # 0xaa88
movl $0x2, %edx
callq 0x3b08
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
cmpl $0x4, %ecx
movl $0x4, %eax
cmovll %ecx, %eax
movl %eax, 0x4(%rbx)
cmpq $0x0, 0x10(%rsp)
je 0x43db
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x2200
movq %rax, %r14
jmp 0x43e5
movq 0xbbc6(%rip), %rax      # 0xffa8
movq (%rax), %r14
movq %r14, 0x10(%rbx)
leaq 0x98(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0x88(%rsp), %rdi
callq 0x48ae
leaq 0x88(%rsp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x45d6
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x443d
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x21c0
leaq 0x6667(%rip), %rsi      # 0xaaab
xorl %edx, %edx
callq 0x3b08
movq (%rsp), %rbx
testq %rax, %rax
je 0x445d
cmpq %r15, %rax
jne 0x4562
leaq 0x661c(%rip), %rsi      # 0xaa80
xorl %edx, %edx
callq 0x3b08
movl %eax, 0x8(%rbx)
testl %eax, %eax
setne %dl
movl (%rbx), %ecx
cmpl %eax, %ecx
setl %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x44bd
movq 0x28(%rsp), %rsi
leaq 0x664e(%rip), %rdi      # 0xaade
movl %eax, %edx
xorl %eax, %eax
callq 0x2320
leaq 0x5c01(%rip), %rsi      # 0xa0a1
leaq 0x65f8(%rip), %rdx      # 0xaa9f
movq %rbx, %rdi
callq 0x3c06
movq 0xbb12(%rip), %rax      # 0xffc8
movq (%rax), %rax
movq %rax, 0x10(%rbx)
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x44d9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x44f5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x645b(%rip), %rdi      # 0xa969
xorl %eax, %eax
callq 0x2320
leaq 0x5bde(%rip), %rdi      # 0xa0fa
xorl %eax, %eax
callq 0x2070
jmp 0x453c
movl (%rbx), %edx
leaq 0x6414(%rip), %rdi      # 0xa942
leaq 0x6609(%rip), %rsi      # 0xab3e
xorl %eax, %eax
callq 0x2070
xorl %edi, %edi
callq 0x2210
movq %r13, %rdi
callq 0x2424
movq %r13, %rdi
callq 0x2448
callq 0x2490
callq 0x246c
callq 0x37e2
leaq 0x654c(%rip), %rdi      # 0xaab5
movq %rax, %rsi
xorl %eax, %eax
callq 0x2320
movq %rax, %rbx
movl $0x4040, %esi           # imm = 0x4040
movq %r14, %rdi
callq 0x21c0
jmp 0x4596
jmp 0x4593
jmp 0x4593
jmp 0x4593
jmp 0x4593
jmp 0x4593
jmp 0x4593
jmp 0x4593
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x45b2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21c0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x45ce
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x22c0