// File: /workspace/github_cpp_makefile_star2_O1/sus304[P]ForRocket/src/ForRocket.cpp
// Function: main
int main(int argc, char* argv[]) {
    // arg parse
    //////////////////////////////////////////////
    bool enable_msg = true;
    bool enable_minimum_damp = false;

    std::vector<int> json_index;
    for (int i=1; i < argc; ++i) {
        std::string str = argv[i];
        if (str.rfind(".json") != std::string::npos) {
            json_index.push_back(i);
            continue;
        }
        if (str.find("--") != std::string::npos) {
            if (str == "--help") {
                std::cout << "ForRocket v" << program_ver << " (release: " << release_date << ")"  << std::endl;
                forrocket::DisplayHelp();
                return 0;
            }
            if (str == "--version") {
                std::cout << "ForRocket version:" << program_ver << " (release: " << release_date << ")" << std::endl;
                return 0;
            }
            if (str == "--quite") {
                enable_msg = false;
            }
        }
        if (str.find("-") != std::string::npos) {
            if (str.find('h') != std::string::npos) {
                std::cout << "ForRocket v" << program_ver << " (release: " << release_date << ")"  << std::endl;
                forrocket::DisplayHelp();
                return 0;
            }
            if (str.find('v') != std::string::npos) {
                std::cout << "ForRocket version:" << program_ver << " (release: " << release_date << ")"  << std::endl;
                return 0;
            }
            if (str.find('q') != std::string::npos) {
                enable_msg = false;
            }
            if (str.find('m') != std::string::npos) {
                enable_minimum_damp = true;
            }
        }
    }
    
    if (json_index.size() == 0) {
        std::cerr << "Error! missing argument json file.";
        return 1;
    }
    if (json_index.size() != 1) {
        std::cerr << "Error! too many argument json file.";
        return 1;
    }

    if (enable_msg) std::cout << "ForRocket v" << program_ver << " Contact." << std::endl;
    
    // Timer Start
    auto start = std::chrono::system_clock::now();

    // Solver Run
    //////////////////////////////////////////////
    if (enable_msg) std::cout << "Solver Start." << std::endl;
    forrocket::TrajectorySolver solver(argv[json_index[0]]);
    solver.Solve();
    if (enable_msg) std::cout << "Solver Terminate." << std::endl;
    if (enable_msg) std::cout << "Export Result ..." << std::endl;
    solver.DumpResult(enable_minimum_damp);
    if (enable_msg) std::cout << "Export Compleate." << std::endl;

    // Timer Stop
    auto end = std::chrono::system_clock::now();
    auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
    if (enable_msg) {
        if (msec > 10000) {
            std::cout << "Running Time: " << msec / 1000 << " sec" << std::endl;
        } else {
            std::cout << "Running Time: " << msec << " msec" << std::endl;
        }
    }

    if (enable_msg) std::cout << "Good Day." << std::endl;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %r14
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x1, 0x10(%rsp)
xorl %r13d, %r13d
cmpl $0x2, %edi
setge %r12b
jl 0x35e80
movl %edi, %ebp
movb $0x1, %al
movl %eax, 0xc(%rsp)
movq $0x0, 0x18(%rsp)
leaq 0x60(%rsp), %r15
leaq 0x161a(%rip), %r13      # 0x37038
movl $0x1, %eax
cltq
movq (%r14,%rax,8), %rsi
movq %r15, %rdi
leaq 0x17(%rsp), %rdx
callq 0x3632e
movl $0x5, %ecx
movq %r15, %rdi
movq %r13, %rsi
movq $-0x1, %rdx
callq 0x5480
cmpq $-0x1, %rax
je 0x35a7c
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x35bcc
movl 0x10(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x28(%rsp)
movl $0x4, %ebx
jmp 0x35e40
movl $0x2, %ecx
movq %r15, %rdi
leaq 0x7ca2(%rip), %rsi      # 0x3d72d
xorl %edx, %edx
callq 0x55c0
cmpq $-0x1, %rax
je 0x35ae5
movq %r15, %rdi
leaq 0x7c8e(%rip), %rsi      # 0x3d730
callq 0x5110
testl %eax, %eax
je 0x35be5
movq %r15, %rdi
leaq 0x7c96(%rip), %rsi      # 0x3d74f
callq 0x5110
testl %eax, %eax
je 0x35c91
movq %r15, %rdi
leaq 0x7c9c(%rip), %rsi      # 0x3d76c
callq 0x5110
testl %eax, %eax
movl 0xc(%rsp), %ecx
movzbl %cl, %ecx
cmovel %eax, %ecx
movl %ecx, 0xc(%rsp)
xorl %ebx, %ebx
movl $0x1, %ecx
movq %r15, %rdi
leaq 0x7c38(%rip), %rsi      # 0x3d72e
xorl %edx, %edx
callq 0x55c0
cmpq $-0x1, %rax
je 0x35e40
movq %r15, %rdi
movl $0x68, %esi
xorl %edx, %edx
callq 0x5430
cmpq $-0x1, %rax
je 0x35d38
movl $0xb, %edx
movq 0x1349c(%rip), %rdi     # 0x48fc8
leaq 0x7c04(%rip), %rsi      # 0x3d737
callq 0x53b0
movq 0x13cf9(%rip), %rsi     # 0x49838
movq 0x13cfa(%rip), %rdx     # 0x49840
movq 0x1347b(%rip), %rdi     # 0x48fc8
callq 0x53b0
movq %rax, %rbx
movl $0xb, %edx
movq %rax, %rdi
leaq 0x7bdf(%rip), %rsi      # 0x3d743
callq 0x53b0
movq 0x13ce8(%rip), %rsi     # 0x49858
movq 0x13ce9(%rip), %rdx     # 0x49860
movq %rbx, %rdi
callq 0x53b0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7813(%rip), %rsi      # 0x3d3a4
callq 0x53b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5250
movl $0x1, %ebx
callq 0x7290
jmp 0x35e40
movl $0x4, %ebx
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x363a0
jmp 0x35e40
movl $0xb, %edx
movq 0x133d7(%rip), %rdi     # 0x48fc8
leaq 0x7b3f(%rip), %rsi      # 0x3d737
callq 0x53b0
movq 0x13c34(%rip), %rsi     # 0x49838
movq 0x13c35(%rip), %rdx     # 0x49840
movq 0x133b6(%rip), %rdi     # 0x48fc8
callq 0x53b0
movq %rax, %rbx
movl $0xb, %edx
movq %rax, %rdi
leaq 0x7b1a(%rip), %rsi      # 0x3d743
callq 0x53b0
movq 0x13c23(%rip), %rsi     # 0x49858
movq 0x13c24(%rip), %rdx     # 0x49860
movq %rbx, %rdi
callq 0x53b0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x774e(%rip), %rsi      # 0x3d3a4
callq 0x53b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5250
movl $0x1, %ebx
callq 0x7290
jmp 0x35e40
movl $0x12, %edx
movq 0x1332b(%rip), %rdi     # 0x48fc8
leaq 0x7ab5(%rip), %rsi      # 0x3d759
callq 0x53b0
movq 0x13b88(%rip), %rsi     # 0x49838
movq 0x13b89(%rip), %rdx     # 0x49840
movq 0x1330a(%rip), %rdi     # 0x48fc8
callq 0x53b0
movq %rax, %rbx
movl $0xb, %edx
movq %rax, %rdi
leaq 0x7a6e(%rip), %rsi      # 0x3d743
callq 0x53b0
movq 0x13b77(%rip), %rsi     # 0x49858
movq 0x13b78(%rip), %rdx     # 0x49860
movq %rbx, %rdi
callq 0x53b0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x76a2(%rip), %rsi      # 0x3d3a4
callq 0x53b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movl $0x1, %ebx
movq %rax, %rdi
callq 0x5250
jmp 0x35e40
movq %r15, %rdi
movl $0x76, %esi
xorl %edx, %edx
callq 0x5430
cmpq $-0x1, %rax
je 0x35df5
movl $0x12, %edx
movq 0x1326b(%rip), %rdi     # 0x48fc8
leaq 0x79f5(%rip), %rsi      # 0x3d759
callq 0x53b0
movq 0x13ac8(%rip), %rsi     # 0x49838
movq 0x13ac9(%rip), %rdx     # 0x49840
movq 0x1324a(%rip), %rdi     # 0x48fc8
callq 0x53b0
movq %rax, %rbx
movl $0xb, %edx
movq %rax, %rdi
leaq 0x79ae(%rip), %rsi      # 0x3d743
callq 0x53b0
movq 0x13ab7(%rip), %rsi     # 0x49858
movq 0x13ab8(%rip), %rdx     # 0x49860
movq %rbx, %rdi
callq 0x53b0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x75e2(%rip), %rsi      # 0x3d3a4
callq 0x53b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movl $0x1, %ebx
movq %rax, %rdi
callq 0x5250
jmp 0x35e40
xorl %ebx, %ebx
movq %r15, %rdi
movl $0x71, %esi
xorl %edx, %edx
callq 0x5430
cmpq $-0x1, %rax
movl 0xc(%rsp), %eax
movzbl %al, %eax
cmovnel %ebx, %eax
movl %eax, 0xc(%rsp)
movq %r15, %rdi
movl $0x6d, %esi
xorl %edx, %edx
callq 0x5430
cmpq $-0x1, %rax
movq 0x18(%rsp), %rax
movzbl %al, %eax
movl $0x1, %ecx
cmovnel %ecx, %eax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x35e5c
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5350
testb $0x3, %bl
jne 0x35e77
movl 0x10(%rsp), %eax
incl %eax
movl %eax, 0x10(%rsp)
cmpl %ebp, %eax
setl %r12b
jl 0x35a23
xorl %r13d, %r13d
movl 0xc(%rsp), %ebp
jmp 0x35e8c
movb $0x1, %bpl
movq $0x0, 0x18(%rsp)
testb $0x1, %r12b
jne 0x36290
movq 0x28(%rsp), %rax
subq 0x20(%rsp), %rax
sarq $0x2, %rax
cmpq $0x1, %rax
je 0x35ec4
testq %rax, %rax
jne 0x35f8e
movl $0x22, %edx
leaq 0x78b5(%rip), %rsi      # 0x3d774
jmp 0x35f9a
testb $0x1, %bpl
je 0x35fb1
movq 0x130f3(%rip), %rdi     # 0x48fc8
leaq 0x785b(%rip), %rsi      # 0x3d737
movl $0xb, %edx
callq 0x53b0
movq 0x1394b(%rip), %rsi     # 0x49838
movq 0x1394c(%rip), %rdx     # 0x49840
movq 0x130cd(%rip), %rdi     # 0x48fc8
callq 0x53b0
movq %rax, %rbx
leaq 0x78b1(%rip), %rsi      # 0x3d7bb
movl $0x9, %edx
movq %rax, %rdi
callq 0x53b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5250
callq 0x5070
movq %rax, %rbx
movq 0x1307b(%rip), %r15     # 0x48fc8
leaq 0x7871(%rip), %rsi      # 0x3d7c5
movl $0xd, %edx
movq %r15, %rdi
callq 0x53b0
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq 0x13049(%rip), %rdi     # 0x48fc8
callq 0x5040
movq %rax, %rdi
callq 0x5250
jmp 0x35fb9
movl $0x23, %edx
leaq 0x77fd(%rip), %rsi      # 0x3d797
movl $0x1, %r13d
movq 0x13049(%rip), %rdi     # 0x48ff0
callq 0x53b0
jmp 0x36290
callq 0x5070
movq %rax, %rbx
movq 0x20(%rsp), %rax
movslq (%rax), %rax
movq (%r14,%rax,8), %rsi
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x3632e
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x31a54
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x35ffe
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5350
leaq 0x60(%rsp), %rdi
callq 0x3300e
testb $0x1, %bpl
je 0x3609e
movq 0x12faf(%rip), %r14     # 0x48fc8
leaq 0x77b3(%rip), %rsi      # 0x3d7d3
movl $0x11, %edx
movq %r14, %rdi
callq 0x53b0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq 0x12f7d(%rip), %rdi     # 0x48fc8
callq 0x5040
movq %rax, %rdi
callq 0x5250
movq 0x12f69(%rip), %r14     # 0x48fc8
leaq 0x777f(%rip), %rsi      # 0x3d7e5
movl $0x11, %edx
movq %r14, %rdi
callq 0x53b0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq 0x12f37(%rip), %rdi     # 0x48fc8
callq 0x5040
movq %rax, %rdi
callq 0x5250
movzbl 0x18(%rsp), %esi
andl $0x1, %esi
leaq 0x60(%rsp), %rdi
callq 0x3322c
testb $0x1, %bpl
je 0x360fc
movq 0x12f0b(%rip), %r14     # 0x48fc8
leaq 0x7733(%rip), %rsi      # 0x3d7f7
movl $0x11, %edx
movq %r14, %rdi
callq 0x53b0
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq 0x12ed9(%rip), %rdi     # 0x48fc8
callq 0x5040
movq %rax, %rdi
callq 0x5250
callq 0x5070
movq %rax, %rcx
subq %rbx, %rcx
movabsq $0x431bde82d7b634db, %rdx # imm = 0x431BDE82D7B634DB
movq %rcx, %rax
imulq %rdx
testb $0x1, %bpl
je 0x36258
movq %rdx, %rbx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x12, %rbx
addq %rax, %rbx
movabsq $0x2541b2640, %rax      # imm = 0x2541B2640
cmpq %rax, %rcx
jl 0x361ad
movq 0x12e80(%rip), %rdi     # 0x48fc8
leaq 0x76ba(%rip), %rsi      # 0x3d809
movl $0xe, %edx
callq 0x53b0
shrq $0x3, %rbx
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
movq %rbx, %rax
mulq %rcx
shrq $0x4, %rdx
movq 0x12e50(%rip), %rdi     # 0x48fc8
movq %rdx, %rsi
callq 0x5320
movq %rax, %rbx
leaq 0x768e(%rip), %rsi      # 0x3d818
movl $0x4, %edx
movq %rax, %rdi
callq 0x53b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5330
jmp 0x361ff
movq 0x12e14(%rip), %rdi     # 0x48fc8
leaq 0x764e(%rip), %rsi      # 0x3d809
movl $0xe, %edx
callq 0x53b0
movq 0x12dfc(%rip), %rdi     # 0x48fc8
movq %rbx, %rsi
callq 0x5320
movq %rax, %rbx
leaq 0x763f(%rip), %rsi      # 0x3d81d
movl $0x5, %edx
movq %rax, %rdi
callq 0x53b0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq %rbx, %rdi
callq 0x5040
movq %rax, %rdi
callq 0x5250
movq 0x12daf(%rip), %rbx     # 0x48fc8
leaq 0x7603(%rip), %rsi      # 0x3d823
movl $0x9, %edx
movq %rbx, %rdi
callq 0x53b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x5330
movsbl %al, %esi
movq 0x12d7d(%rip), %rdi     # 0x48fc8
callq 0x5040
movq %rax, %rdi
callq 0x5250
leaq 0xe8(%rsp), %rdi
callq 0x33866
leaq 0x88(%rsp), %rbx
movq %rbx, %rdi
callq 0x33946
movq -0x28(%rbx), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x36290
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5350
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x362a7
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movl %r13d, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3630f
movq 0x50(%rsp), %rsi
jmp 0x36307
jmp 0x362eb
jmp 0x362eb
jmp 0x362dc
jmp 0x362eb
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3636c
jmp 0x3630f
movq %rax, %rbx
jmp 0x3630f
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x3630f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5350
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x36326
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq %rbx, %rdi
callq 0x55e0