// File: JenTus[P]TCEM/src_TCEM/main.cc
// Function: readOptions(int, char**)
AnyOption* readOptions(int argc, char* argv[]) {
    
    AnyOption *opt = new AnyOption();
    
    // ignore POSIX style options
    opt->noPOSIX();
    opt->setVerbose(); /* print warnings about unknown options */
    opt->autoUsagePrint(true); /* print usage for bad options */
    
    opt->addUsage("");
    opt->addUsage("Usage: ");
    opt->addUsage("");
    opt->addUsage("-help Prints this help ");
    opt->addUsage(" -c <config_file> Specify config file ");
    opt->addUsage(" -x <input_file> Specify input file name");
    opt->addUsage(" -r Specify red nodes");
    opt->addUsage(" -b Specify blue nodes");
    opt->addUsage("");
    
//    opt->setOption("probGraphFile");
    opt->setOption("outputFolder");
    
//    opt->setOption("n");
//    opt->setOption("m");
    //opt->setOption("nrItems");
    //opt->setOption("k");
    //opt->setOption("kr");
    //opt->setOption("kb");
//    opt->setOption("attentionConstraint");

    opt->setOption("epsilon");
    opt->setOption("ell");

    opt->setCommandFlag("help");
    opt->setCommandOption("c");
    opt->setCommandOption("x"); // to specify input file
    opt->setCommandOption("r");
    opt->setCommandOption("b");
    opt->setCommandOption("p"); // if comparing with the input, specify a filename
    opt->processCommandArgs(argc, argv);


    if(opt->getFlag( "help" )) {
        opt->printUsage();
        delete opt;
        exit(0);
    }
    
    const char* configFile = opt->getValue("c");
    if (configFile == NULL) {
        cout << "Config file not mentioned" << endl;
        opt->printUsage();
        delete opt;
        exit(0);
    }
    
    cout << "Config file : " << configFile << endl;
    opt->processFile(configFile);
    opt->processCommandArgs( argc, argv );
    cout << endl << endl;
    return opt;
}

// Assembly:
subq $0x48, %rsp
movl %edi, 0x44(%rsp)
movq %rsi, 0x38(%rsp)
movl $0xb0, %edi
callq 0x4380
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
callq 0x1ec40
jmp 0x4a79
movq 0x10(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0x1f630
movq 0x30(%rsp), %rdi
callq 0x1f670
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x1f7a0
movq 0x30(%rsp), %rdi
leaq 0x1f776(%rip), %rsi     # 0x24228
callq 0x21c40
movq 0x30(%rsp), %rdi
leaq 0x1f541(%rip), %rsi     # 0x24004
callq 0x21c40
movq 0x30(%rsp), %rdi
leaq 0x1f754(%rip), %rsi     # 0x24228
callq 0x21c40
movq 0x30(%rsp), %rdi
leaq 0x1f527(%rip), %rsi     # 0x2400c
callq 0x21c40
movq 0x30(%rsp), %rdi
leaq 0x1f52e(%rip), %rsi     # 0x24024
callq 0x21c40
movq 0x30(%rsp), %rdi
leaq 0x1f544(%rip), %rsi     # 0x2404b
callq 0x21c40
movq 0x30(%rsp), %rdi
leaq 0x1f55c(%rip), %rsi     # 0x24074
callq 0x21c40
movq 0x30(%rsp), %rdi
leaq 0x1f561(%rip), %rsi     # 0x2408a
callq 0x21c40
movq 0x30(%rsp), %rdi
leaq 0x1f6ee(%rip), %rsi     # 0x24228
callq 0x21c40
movq 0x30(%rsp), %rdi
leaq 0x1f556(%rip), %rsi     # 0x240a1
callq 0x1fd30
movq 0x30(%rsp), %rdi
leaq 0x1f552(%rip), %rsi     # 0x240ae
callq 0x1fd30
movq 0x30(%rsp), %rdi
leaq 0x1f549(%rip), %rsi     # 0x240b6
callq 0x1fd30
movq 0x30(%rsp), %rdi
leaq 0x1f53c(%rip), %rsi     # 0x240ba
callq 0x1fa90
movq 0x30(%rsp), %rdi
leaq 0x1fd6d(%rip), %rsi     # 0x248fc
callq 0x1f840
movq 0x30(%rsp), %rdi
leaq 0x1f51f(%rip), %rsi     # 0x240bf
callq 0x1f840
movq 0x30(%rsp), %rdi
leaq 0x1f4fb(%rip), %rsi     # 0x240ac
callq 0x1f840
movq 0x30(%rsp), %rdi
leaq 0x1f59c(%rip), %rsi     # 0x2415e
callq 0x1f840
movq 0x30(%rsp), %rdi
leaq 0x1f4ea(%rip), %rsi     # 0x240bd
callq 0x1f840
movq 0x30(%rsp), %rdi
movl 0x44(%rsp), %esi
movq 0x38(%rsp), %rdx
callq 0x204b0
movq 0x30(%rsp), %rdi
leaq 0x1f4c3(%rip), %rsi     # 0x240ba
callq 0x20f50
testb $0x1, %al
jne 0x4c02
jmp 0x4c54
movq 0x30(%rsp), %rdi
callq 0x21b90
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x4c30
movq 0x8(%rsp), %rdi
callq 0x1ee80
movq 0x8(%rsp), %rdi
callq 0x4350
xorl %edi, %edi
callq 0x4430
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
callq 0x4350
jmp 0x4d43
movq 0x30(%rsp), %rdi
leaq 0x1fc9c(%rip), %rsi     # 0x248fc
callq 0x20e40
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x4cc6
movq 0x2a35f(%rip), %rdi     # 0x2efd8
leaq 0x1f441(%rip), %rsi     # 0x240c1
callq 0x4370
movq %rax, %rdi
movq 0x2a339(%rip), %rsi     # 0x2efc8
callq 0x43c0
movq 0x30(%rsp), %rdi
callq 0x21b90
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x4cbf
movq (%rsp), %rdi
callq 0x1ee80
movq (%rsp), %rdi
callq 0x4350
xorl %edi, %edi
callq 0x4430
movq 0x2a30b(%rip), %rdi     # 0x2efd8
leaq 0x1f407(%rip), %rsi     # 0x240db
callq 0x4370
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x4370
movq %rax, %rdi
movq 0x2a2d8(%rip), %rsi     # 0x2efc8
callq 0x43c0
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x21430
movq 0x30(%rsp), %rdi
movl 0x44(%rsp), %esi
movq 0x38(%rsp), %rdx
callq 0x204b0
movq 0x2a2ba(%rip), %rdi     # 0x2efd8
movq 0x2a2a3(%rip), %rsi     # 0x2efc8
callq 0x43c0
movq %rax, %rdi
movq 0x2a294(%rip), %rsi     # 0x2efc8
callq 0x43c0
movq 0x30(%rsp), %rax
addq $0x48, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x4680
nopl (%rax)