// File: istellartech[P]OpenTsiolkovsky/src/rocket.cpp
// Function: Rocket::flight_simulation()
void Rocket::flight_simulation(){
    // rs : mean RocketNew::rocket_stages, class RocketStage
    using base_stepper_type = odeint::runge_kutta_dopri5<RocketStage::state>;
    auto Stepper = make_dense_output(1.0e-9, 1.0e-9, 1.0, base_stepper_type());

    for (int i = 0; i < rs.size(); i++){  // i is number of the rocket stages
        flag_separation_g = false;
        flag_separation_mass_reduce_g = false;
        flag_dump_g = false;
        flag_impact_g = false;
        if (i == 0){
            rs[i].posECI_init << posECI_init(rs[0].launch_pos_LLH);
            rs[i].velECI_init << velECI_init(rs[0].launch_vel_NED, rs[0].launch_pos_LLH);
            rs[i].previous_stage_separation_time = 0.0; // first stage calcuration start time[s]
        } else {
            rs[i].posECI_init << posECI_init_g;
            rs[i].velECI_init << velECI_init_g;
            rs[i].previous_stage_separation_time = rs[i-1].later_stage_separation_time;
        }
        rs[i].calc_start_time = rs[i].previous_stage_separation_time;
        std::vector<double> time_array;
        time_array = {rs[i].calc_start_time,
                      rs[i].dump_separation_time,
//                      rs[i].previous_stage_separation_time + rs[i].burn_start_time + rs[i].burn_end_time,
                      rs[i].later_stage_separation_time,
                      rs[i].calc_end_time
        };
        sort(time_array.begin(), time_array.end());  // ascending order for ODE
        std::replace_if(time_array.begin(), time_array.end(),
                        [&](double x){return x > rs[i].calc_end_time;},
                        rs[i].calc_end_time); // keep times to the upper limit(calc_end_time)
        double time_step = rs[i].calc_step_time;

        RocketStage::state State = { rs[i].mass_init,
                                     rs[i].posECI_init[0], rs[i].posECI_init[1], rs[i].posECI_init[2],
                                     rs[i].velECI_init[0], rs[i].velECI_init[1], rs[i].velECI_init[2],
        };
        string csv_filename = "./output/" + rs[i].name + "_dynamics_" + to_string(rs[i].num_stage) + ".csv";
        CsvObserver Observer(csv_filename, false);
        Observer.deep_copy(rs[i]);
        flag_duplicate = false;
        for (int j = 0; j < time_array.size() - 1; j++){  // j is number of time_array
            odeint::integrate_const(Stepper, rs[i], State,
                                    time_array[j], time_array[j+1], time_step,
                                    std::ref(Observer));
            CsvObserver Observer(csv_filename, true);
            Observer.deep_copy(rs[i]);
            if (time_array[j+1] == rs[i].later_stage_separation_time && !flag_separation_mass_reduce_g){
                State[0] = State[0] - rs[i+1].mass_init;  // reduce upper stage mass to "ODE x[0]"
                flag_separation_mass_reduce_g = true;
            }
            if (time_array[j+1] == rs[i].dump_separation_time){
                RocketStage temp_fo(rs[i], posECI_dump_init_g, velECI_dump_init_g);
                temp_fo.num_stage = rs[i].num_stage;
                fo.push_back(temp_fo);
                State[0] = State[0] - rs[i].dump_mass;  // reduce dumping mass to "ODE x[0]"
            }
            flag_duplicate = true;
        }
        cout << "                                           \r" << flush;
        cout << fixed << setprecision(6) << to_string(rs[i].num_stage) + " stage impact point [deg]:\t";
        cout << impact_point_g[0] << "\t"<< impact_point_g[1] << endl;
        impact_point_g << 0.0,0.0;
        if (!rs[i].following_stage_exist){
            break;
        }
    }

    // ==== DUMPING PRODUCTS flight simulation ====
    for (int i = 0; i < fo.size(); i++) {  // i is number of the dumping products
        flag_impact_g = false;
        RocketStage::state State = { fo[i].mass_init,
            fo[i].posECI_init[0], fo[i].posECI_init[1], fo[i].posECI_init[2],
            fo[i].velECI_init[0], fo[i].velECI_init[1], fo[i].velECI_init[2],
        };
        string csv_filename = "./output/" + fo[i].name + "_dynamics_" + to_string(fo[i].num_stage) + "_dump" +  ".csv";
        CsvObserver Observer(csv_filename, false);
        Observer.deep_copy(fo[i]);
        odeint::integrate_const(Stepper, fo[i], State,
                                fo[i].calc_start_time, fo[i].calc_end_time, fo[i].calc_step_time,
                                std::ref(Observer));
        cout << "                                           \r" << flush;
        cout << fixed << setprecision(6) << to_string(fo[i].num_stage) + " stage dumping product impact point [deg]:\t";
        cout << impact_point_g[0] << "\t"<< impact_point_g[1] << endl;
        impact_point_g << 0.0,0.0;
    }

    cout << fixed << setprecision(0);
    cout << "max altitude[m]:\t" << max_alt_g << endl;
    cout << "max downrange[m]:\t" << max_downrange_g << endl;
    cout << "Simulation Success!" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x8770, %rsp           # imm = 0x8770
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x7e00(%rbp)
leaq -0xb08(%rbp), %rdi
leaq -0xb09(%rbp), %rsi
callq 0x1f000
leaq -0x778(%rbp), %rdi
movsd 0x3cd3c(%rip), %xmm1    # 0x52e48
movsd 0x3bf2c(%rip), %xmm2    # 0x52040
leaq -0xb08(%rbp), %rsi
movaps %xmm1, %xmm0
callq 0x1efb0
movl $0x0, -0xb10(%rbp)
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rax
movq %rax, -0x7e08(%rbp)
callq 0x1f050
movq %rax, %rcx
movq -0x7e08(%rbp), %rax
cmpq %rcx, %rax
jae 0x17128
movb $0x0, 0x63467(%rip)     # 0x795c8
movb $0x0, 0x63461(%rip)     # 0x795c9
movb $0x0, 0x6345b(%rip)     # 0x795ca
movb $0x0, 0x63455(%rip)     # 0x795cb
cmpl $0x0, -0xb10(%rbp)
jne 0x162d1
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
addq $0x3d0, %rax            # imm = 0x3D0
movq %rax, -0x7e18(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x1f080
movq %rax, %rsi
addq $0x340, %rsi            # imm = 0x340
leaq -0xb60(%rbp), %rdi
callq 0x1f0e0
leaq -0xb48(%rbp), %rdi
leaq -0xb60(%rbp), %rsi
callq 0x4c8f0
movq -0x7e18(%rbp), %rsi
leaq -0xb30(%rbp), %rdi
leaq -0xb48(%rbp), %rdx
callq 0x1f0a0
leaq -0xb30(%rbp), %rdi
callq 0x1e390
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
addq $0x3e8, %rax            # imm = 0x3E8
movq %rax, -0x7e10(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x1f080
movq %rax, %rsi
addq $0x370, %rsi            # imm = 0x370
leaq -0xbb0(%rbp), %rdi
callq 0x1f0e0
movq -0x7e00(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f080
movq %rax, %rsi
addq $0x340, %rsi            # imm = 0x340
leaq -0xbc8(%rbp), %rdi
callq 0x1f0e0
leaq -0xb98(%rbp), %rdi
leaq -0xbb0(%rbp), %rsi
leaq -0xbc8(%rbp), %rdx
callq 0x4c990
movq -0x7e10(%rbp), %rsi
leaq -0xb80(%rbp), %rdi
leaq -0xb98(%rbp), %rdx
callq 0x1f0a0
leaq -0xb80(%rbp), %rdi
callq 0x1e390
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
xorps %xmm0, %xmm0
movsd %xmm0, 0x748(%rax)
jmp 0x16394
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rsi
addq $0x3d0, %rsi            # imm = 0x3D0
leaq -0xbe8(%rbp), %rdi
leaq 0x6329c(%rip), %rdx     # 0x79598
callq 0x1f0a0
leaq -0xbe8(%rbp), %rdi
callq 0x1e390
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rsi
addq $0x3e8, %rsi            # imm = 0x3E8
leaq -0xc08(%rbp), %rdi
leaq 0x63278(%rip), %rdx     # 0x795b0
callq 0x1f0a0
leaq -0xc08(%rbp), %rdi
callq 0x1e390
movq -0x7e00(%rbp), %rdi
movl -0xb10(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
movsd 0x750(%rax), %xmm0
movsd %xmm0, -0x7e20(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movsd -0x7e20(%rbp), %xmm0
movsd %xmm0, 0x748(%rax)
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
movsd 0x748(%rax), %xmm0
movsd %xmm0, -0x7e30(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movsd -0x7e30(%rbp), %xmm0
movsd %xmm0, 0x258(%rax)
leaq -0xc20(%rbp), %rdi
movq %rdi, -0x7e28(%rbp)
callq 0x8470
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
movsd 0x258(%rax), %xmm0
movsd %xmm0, -0xc50(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
movsd 0x650(%rax), %xmm0
movsd %xmm0, -0xc48(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
movsd 0x750(%rax), %xmm0
movsd %xmm0, -0xc40(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e28(%rbp), %rdi
movsd 0x260(%rax), %xmm0
movsd %xmm0, -0xc38(%rbp)
leaq -0xc50(%rbp), %rax
movq %rax, -0xc30(%rbp)
movq $0x4, -0xc28(%rbp)
movq -0xc30(%rbp), %rsi
movq -0xc28(%rbp), %rdx
callq 0x1f160
jmp 0x164ae
leaq -0xc20(%rbp), %rdi
movq %rdi, -0x7e38(%rbp)
callq 0x1f1f0
movq -0x7e38(%rbp), %rdi
movq %rax, -0xc68(%rbp)
callq 0xa790
movq %rax, -0xc70(%rbp)
movq -0xc68(%rbp), %rdi
movq -0xc70(%rbp), %rsi
callq 0x1f1b0
jmp 0x164f0
leaq -0xc20(%rbp), %rdi
movq %rdi, -0x7e40(%rbp)
callq 0x1f1f0
movq -0x7e40(%rbp), %rdi
movq %rax, -0xc78(%rbp)
callq 0xa790
movq -0x7e00(%rbp), %rdi
movq %rax, -0xc80(%rbp)
movq %rdi, -0xc90(%rbp)
leaq -0xb10(%rbp), %rax
movq %rax, -0xc88(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %r8
addq $0x260, %r8             # imm = 0x260
movq -0xc78(%rbp), %rdi
movq -0xc80(%rbp), %rsi
movq -0xc90(%rbp), %rdx
movq -0xc88(%rbp), %rcx
callq 0x179f0
jmp 0x16572
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
movsd 0x268(%rax), %xmm0
movsd %xmm0, -0xc98(%rbp)
leaq -0xd08(%rbp), %rax
movq %rax, -0x7e58(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
movsd 0x280(%rax), %xmm0
movsd %xmm0, -0xd08(%rbp)
leaq -0xd00(%rbp), %rax
movq %rax, -0x7e50(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3d0, %rdi            # imm = 0x3D0
xorl %eax, %eax
movl %eax, %esi
callq 0x1de40
movq %rax, -0x7e48(%rbp)
jmp 0x16603
movq -0x7e00(%rbp), %rdi
movq -0x7e58(%rbp), %rax
movq -0x7e50(%rbp), %rcx
movq -0x7e48(%rbp), %rdx
movsd (%rdx), %xmm0
movsd %xmm0, (%rcx)
addq $0x10, %rax
movq %rax, -0x7e68(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3d0, %rdi            # imm = 0x3D0
movl $0x1, %esi
callq 0x1de40
movq %rax, -0x7e60(%rbp)
jmp 0x1665b
movq -0x7e00(%rbp), %rdi
movq -0x7e58(%rbp), %rax
movq -0x7e68(%rbp), %rcx
movq -0x7e60(%rbp), %rdx
movsd (%rdx), %xmm0
movsd %xmm0, (%rcx)
addq $0x18, %rax
movq %rax, -0x7e78(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3d0, %rdi            # imm = 0x3D0
movl $0x2, %esi
callq 0x1de40
movq %rax, -0x7e70(%rbp)
jmp 0x166b3
movq -0x7e00(%rbp), %rdi
movq -0x7e58(%rbp), %rax
movq -0x7e78(%rbp), %rcx
movq -0x7e70(%rbp), %rdx
movsd (%rdx), %xmm0
movsd %xmm0, (%rcx)
addq $0x20, %rax
movq %rax, -0x7e88(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3e8, %rdi            # imm = 0x3E8
xorl %eax, %eax
movl %eax, %esi
callq 0x1de40
movq %rax, -0x7e80(%rbp)
jmp 0x1670a
movq -0x7e00(%rbp), %rdi
movq -0x7e58(%rbp), %rax
movq -0x7e88(%rbp), %rcx
movq -0x7e80(%rbp), %rdx
movsd (%rdx), %xmm0
movsd %xmm0, (%rcx)
addq $0x28, %rax
movq %rax, -0x7e98(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3e8, %rdi            # imm = 0x3E8
movl $0x1, %esi
callq 0x1de40
movq %rax, -0x7e90(%rbp)
jmp 0x16762
movq -0x7e00(%rbp), %rdi
movq -0x7e58(%rbp), %rax
movq -0x7e98(%rbp), %rcx
movq -0x7e90(%rbp), %rdx
movsd (%rdx), %xmm0
movsd %xmm0, (%rcx)
addq $0x30, %rax
movq %rax, -0x7ea8(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3e8, %rdi            # imm = 0x3E8
movl $0x2, %esi
callq 0x1de40
movq %rax, -0x7ea0(%rbp)
jmp 0x167ba
movq -0x7e58(%rbp), %rcx
movq -0x7ea8(%rbp), %rax
movq -0x7ea0(%rbp), %rdx
movsd (%rdx), %xmm0
movsd %xmm0, (%rax)
movq %rcx, %rax
addq $0x38, %rax
addq $0x70, %rcx
movq %rcx, -0x7eb8(%rbp)
movq %rax, -0x7eb0(%rbp)
movq -0x7eb0(%rbp), %rax
movq -0x7eb8(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x7eb0(%rbp)
jne 0x167f0
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rdx
addq $0x210, %rdx            # imm = 0x210
leaq 0x3d2db(%rip), %rsi     # 0x53b14
leaq -0xd88(%rbp), %rdi
callq 0xad30
jmp 0x16847
leaq 0x3d2d0(%rip), %rdx     # 0x53b1e
leaq -0xd68(%rbp), %rdi
leaq -0xd88(%rbp), %rsi
callq 0xace0
jmp 0x16863
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movl 0x250(%rax), %esi
leaq -0xda8(%rbp), %rdi
callq 0x1d990
jmp 0x1688a
leaq -0xd48(%rbp), %rdi
leaq -0xd68(%rbp), %rsi
leaq -0xda8(%rbp), %rdx
callq 0x1f220
jmp 0x168a6
leaq 0x3ba5f(%rip), %rdx     # 0x5230c
leaq -0xd28(%rbp), %rdi
leaq -0xd48(%rbp), %rsi
callq 0xace0
jmp 0x168c2
leaq -0xd48(%rbp), %rdi
callq 0x68a8
leaq -0xda8(%rbp), %rdi
callq 0x68a8
leaq -0xd68(%rbp), %rdi
callq 0x68a8
leaq -0xd88(%rbp), %rdi
callq 0x68a8
leaq -0x1e90(%rbp), %rdi
leaq -0xd28(%rbp), %rsi
xorl %edx, %edx
callq 0x1f2f0
jmp 0x16909
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rsi
leaq -0x1e90(%rbp), %rdi
callq 0x1e460
jmp 0x1692d
movb $0x0, 0x62cec(%rip)     # 0x79620
movl $0x0, -0x1e94(%rbp)
movslq -0x1e94(%rbp), %rax
movq %rax, -0x7ec0(%rbp)
leaq -0xc20(%rbp), %rdi
callq 0x8620
movq %rax, %rcx
movq -0x7ec0(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x16e38
leaq -0x2608(%rbp), %rdi
leaq -0x778(%rbp), %rsi
movl $0x770, %edx            # imm = 0x770
callq 0x63b0
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rsi
leaq -0x34d0(%rbp), %rdi
callq 0x1f580
jmp 0x169ab
movslq -0x1e94(%rbp), %rsi
leaq -0xc20(%rbp), %rdi
movq %rdi, -0x7ee0(%rbp)
callq 0x8600
movq -0x7ee0(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x7ed8(%rbp)
movl -0x1e94(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x8600
movsd (%rax), %xmm0
movsd %xmm0, -0x7ed0(%rbp)
movsd -0xc98(%rbp), %xmm0
movsd %xmm0, -0x7ec8(%rbp)
leaq -0x1e90(%rbp), %rdi
callq 0x1ff50
movsd -0x7ed8(%rbp), %xmm0
movsd -0x7ed0(%rbp), %xmm1
movsd -0x7ec8(%rbp), %xmm2
movq %rax, -0x34d8(%rbp)
movq -0x34d8(%rbp), %rdx
movq %rsp, %rdi
movl $0xee, %ecx
leaq -0x2608(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x34d0(%rbp), %rdi
leaq -0xd08(%rbp), %rsi
callq 0x1f470
jmp 0x16a5d
leaq -0x34d0(%rbp), %rdi
callq 0xb260
leaq -0x45c0(%rbp), %rdi
leaq -0xd28(%rbp), %rsi
movl $0x1, %edx
callq 0x1f2f0
jmp 0x16a83
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, %rsi
leaq -0x45c0(%rbp), %rdi
callq 0x1e460
jmp 0x16aa7
movl -0x1e94(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq -0xc20(%rbp), %rdi
callq 0x8600
movq -0x7e00(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x7ee8(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movsd -0x7ee8(%rbp), %xmm0
ucomisd 0x750(%rax), %xmm0
jne 0x16c7d
jp 0x16c7d
testb $0x1, 0x62ac8(%rip)     # 0x795c9
jne 0x16c7d
leaq -0xd08(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1ff80
movq -0x7e00(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x7ef8(%rbp)
movl -0xb10(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x1f080
movsd -0x7ef8(%rbp), %xmm0
subsd 0x280(%rax), %xmm0
movsd %xmm0, -0x7ef0(%rbp)
leaq -0xd08(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1ff80
movsd -0x7ef0(%rbp), %xmm0
movsd %xmm0, (%rax)
movb $0x1, 0x62a53(%rip)     # 0x795c9
jmp 0x16c7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x17117
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x16c04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x16bf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x16bec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
leaq -0xd48(%rbp), %rdi
callq 0x68a8
leaq -0xda8(%rbp), %rdi
callq 0x68a8
leaq -0xd68(%rbp), %rdi
callq 0x68a8
leaq -0xd88(%rbp), %rdi
callq 0x68a8
jmp 0x17117
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x1710b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x170ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
leaq -0x34d0(%rbp), %rdi
callq 0xb260
jmp 0x170ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x16e27
movl -0x1e94(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq -0xc20(%rbp), %rdi
callq 0x8600
movq -0x7e00(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x7f00(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movsd -0x7f00(%rbp), %xmm0
ucomisd 0x650(%rax), %xmm0
jne 0x16e00
jp 0x16e00
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq %rax, -0x7f08(%rbp)
leaq 0x628ff(%rip), %rsi     # 0x795f0
leaq -0x5498(%rbp), %rdi
callq 0x1f0e0
jmp 0x16cff
leaq 0x62902(%rip), %rsi     # 0x79608
leaq -0x54b0(%rbp), %rdi
callq 0x1f0e0
jmp 0x16d14
movq -0x7f08(%rbp), %rsi
leaq -0x5480(%rbp), %rdi
leaq -0x5498(%rbp), %rdx
leaq -0x54b0(%rbp), %rcx
callq 0x15610
jmp 0x16d37
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
movl 0x250(%rax), %eax
movl %eax, -0x5230(%rbp)
addq $0x18, %rdi
leaq -0x5480(%rbp), %rsi
callq 0x1db00
jmp 0x16d6f
leaq -0xd08(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1ff80
movq -0x7e00(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x7f18(%rbp)
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movsd -0x7f18(%rbp), %xmm0
subsd 0x658(%rax), %xmm0
movsd %xmm0, -0x7f10(%rbp)
leaq -0xd08(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1ff80
movsd -0x7f10(%rbp), %xmm0
movsd %xmm0, (%rax)
leaq -0x5480(%rbp), %rdi
callq 0xb260
jmp 0x16e00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
leaq -0x5480(%rbp), %rdi
callq 0xb260
jmp 0x16e27
movb $0x1, 0x62819(%rip)     # 0x79620
leaq -0x45c0(%rbp), %rdi
callq 0x1ffb0
movl -0x1e94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e94(%rbp)
jmp 0x1693e
leaq -0x45c0(%rbp), %rdi
callq 0x1ffb0
jmp 0x170ff
movq 0x62171(%rip), %rdi     # 0x78fb0
leaq 0x3cce3(%rip), %rsi     # 0x53b29
callq 0x6460
movq %rax, -0x7f20(%rbp)
jmp 0x16e54
movq -0x7f20(%rbp), %rdi
movq 0x6215e(%rip), %rsi     # 0x78fc0
callq 0x64c0
jmp 0x16e69
movq 0x62140(%rip), %rdi     # 0x78fb0
leaq 0x9189(%rip), %rsi      # 0x20000
callq 0x6190
movq %rax, -0x7f28(%rbp)
jmp 0x16e85
movl $0x6, %edi
callq 0x20030
movl %eax, -0x7f2c(%rbp)
jmp 0x16e97
movq -0x7f28(%rbp), %rdi
movl -0x7f2c(%rbp), %eax
movl %eax, -0x54b4(%rbp)
movl -0x54b4(%rbp), %esi
callq 0x66a0
movq %rax, -0x7f38(%rbp)
jmp 0x16ebe
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
movl 0x250(%rax), %esi
leaq -0x54f8(%rbp), %rdi
callq 0x1d990
jmp 0x16ee5
leaq 0x3cc6a(%rip), %rdx     # 0x53b56
leaq -0x54d8(%rbp), %rdi
leaq -0x54f8(%rbp), %rsi
callq 0xace0
jmp 0x16f01
movq -0x7f38(%rbp), %rdi
leaq -0x54d8(%rbp), %rsi
callq 0x6410
jmp 0x16f16
leaq -0x54d8(%rbp), %rdi
callq 0x68a8
leaq -0x54f8(%rbp), %rdi
callq 0x68a8
leaq 0x626ab(%rip), %rdi     # 0x795e0
xorl %eax, %eax
movl %eax, %esi
callq 0x20050
movq %rax, -0x7f40(%rbp)
jmp 0x16f47
movq -0x7f40(%rbp), %rax
movsd (%rax), %xmm0
movq 0x62057(%rip), %rdi     # 0x78fb0
callq 0x6830
movq %rax, -0x7f48(%rbp)
jmp 0x16f67
movq -0x7f48(%rbp), %rdi
leaq 0x3cbfb(%rip), %rsi     # 0x53b70
callq 0x6460
movq %rax, -0x7f50(%rbp)
jmp 0x16f83
leaq 0x62656(%rip), %rdi     # 0x795e0
movl $0x1, %esi
callq 0x20050
movq %rax, -0x7f58(%rbp)
jmp 0x16f9d
movq -0x7f50(%rbp), %rdi
movq -0x7f58(%rbp), %rax
movsd (%rax), %xmm0
callq 0x6830
movq %rax, -0x7f60(%rbp)
jmp 0x16fbd
movq -0x7f60(%rbp), %rdi
movq 0x61f8d(%rip), %rsi     # 0x78f58
callq 0x64c0
jmp 0x16fd2
movq $0x0, -0x5520(%rbp)
leaq 0x625fc(%rip), %rsi     # 0x795e0
leaq -0x5518(%rbp), %rdi
leaq -0x5520(%rbp), %rdx
callq 0x200e0
jmp 0x16ff9
movq $0x0, -0x5528(%rbp)
leaq -0x5518(%rbp), %rdi
leaq -0x5528(%rbp), %rsi
callq 0x20120
jmp 0x17019
leaq -0x5518(%rbp), %rdi
callq 0x20290
movq -0x7e00(%rbp), %rdi
movslq -0xb10(%rbp), %rsi
callq 0x1f080
testb $0x1, 0x740(%rax)
jne 0x170ad
movl $0x2, -0x552c(%rbp)
jmp 0x170b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x1707f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
leaq -0x54d8(%rbp), %rdi
callq 0x68a8
leaq -0x54f8(%rbp), %rdi
callq 0x68a8
jmp 0x170ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
leaq -0x5518(%rbp), %rdi
callq 0x20290
jmp 0x170ff
movl $0x0, -0x552c(%rbp)
leaq -0x1e90(%rbp), %rdi
callq 0x1ffb0
leaq -0xd28(%rbp), %rdi
callq 0x68a8
leaq -0xc20(%rbp), %rdi
callq 0x83f0
movl -0x552c(%rbp), %eax
testl %eax, %eax
je 0x170e9
jmp 0x170e7
jmp 0x17128
jmp 0x170eb
movl -0xb10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb10(%rbp)
jmp 0x1612d
leaq -0x1e90(%rbp), %rdi
callq 0x1ffb0
leaq -0xd28(%rbp), %rdi
callq 0x68a8
leaq -0xc20(%rbp), %rdi
callq 0x83f0
jmp 0x179e4
movl $0x0, -0x5530(%rbp)
movq -0x7e00(%rbp), %rdi
movslq -0x5530(%rbp), %rax
movq %rax, -0x7f68(%rbp)
addq $0x18, %rdi
callq 0x1f050
movq %rax, %rcx
movq -0x7f68(%rbp), %rax
cmpq %rcx, %rax
jae 0x1791c
movq -0x7e00(%rbp), %rdi
movb $0x0, 0x6245a(%rip)     # 0x795cb
leaq -0x55a0(%rbp), %rax
movq %rax, -0x7f80(%rbp)
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq -0x7e00(%rbp), %rdi
movsd 0x280(%rax), %xmm0
movsd %xmm0, -0x55a0(%rbp)
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3d0, %rdi            # imm = 0x3D0
xorl %eax, %eax
movl %eax, %esi
callq 0x1de40
movq -0x7e00(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x5598(%rbp)
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3d0, %rdi            # imm = 0x3D0
movl $0x1, %esi
callq 0x1de40
movq -0x7e00(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x5590(%rbp)
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3d0, %rdi            # imm = 0x3D0
movl $0x2, %esi
callq 0x1de40
movq -0x7e00(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x5588(%rbp)
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3e8, %rdi            # imm = 0x3E8
xorl %eax, %eax
movl %eax, %esi
callq 0x1de40
movq -0x7e00(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x5580(%rbp)
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3e8, %rdi            # imm = 0x3E8
movl $0x1, %esi
callq 0x1de40
movq -0x7e00(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x5578(%rbp)
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq %rax, %rdi
addq $0x3e8, %rdi            # imm = 0x3E8
movl $0x2, %esi
callq 0x1de40
movq -0x7f80(%rbp), %rcx
movsd (%rax), %xmm0
movsd %xmm0, -0x5570(%rbp)
movq %rcx, %rax
addq $0x38, %rax
addq $0x70, %rcx
movq %rcx, -0x7f78(%rbp)
movq %rax, -0x7f70(%rbp)
movq -0x7f70(%rbp), %rax
movq -0x7f78(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x7f70(%rbp)
jne 0x17307
movq -0x7e00(%rbp), %rdi
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq %rax, %rdx
addq $0x210, %rdx            # imm = 0x210
leaq 0x3c7c0(%rip), %rsi     # 0x53b14
leaq -0x5640(%rbp), %rdi
movq %rdi, -0x7f88(%rbp)
callq 0xad30
movq -0x7f88(%rbp), %rsi
leaq 0x3c7a9(%rip), %rdx     # 0x53b1e
leaq -0x5620(%rbp), %rdi
callq 0xace0
jmp 0x17383
movq -0x7e00(%rbp), %rdi
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movl 0x250(%rax), %esi
leaq -0x5660(%rbp), %rdi
callq 0x1d990
jmp 0x173ae
leaq -0x5600(%rbp), %rdi
leaq -0x5620(%rbp), %rsi
leaq -0x5660(%rbp), %rdx
callq 0x1f220
jmp 0x173ca
leaq 0x3c7a1(%rip), %rdx     # 0x53b72
leaq -0x55e0(%rbp), %rdi
leaq -0x5600(%rbp), %rsi
callq 0xace0
jmp 0x173e6
leaq 0x3af1f(%rip), %rdx     # 0x5230c
leaq -0x55c0(%rbp), %rdi
leaq -0x55e0(%rbp), %rsi
callq 0xace0
jmp 0x17402
leaq -0x55e0(%rbp), %rdi
callq 0x68a8
leaq -0x5600(%rbp), %rdi
callq 0x68a8
leaq -0x5660(%rbp), %rdi
callq 0x68a8
leaq -0x5620(%rbp), %rdi
callq 0x68a8
leaq -0x5640(%rbp), %rdi
callq 0x68a8
leaq -0x6740(%rbp), %rdi
leaq -0x55c0(%rbp), %rsi
xorl %edx, %edx
callq 0x1f2f0
jmp 0x17455
movq -0x7e00(%rbp), %rdi
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq %rax, %rsi
leaq -0x6740(%rbp), %rdi
callq 0x1e460
jmp 0x1747d
leaq -0x6eb0(%rbp), %rdi
leaq -0x778(%rbp), %rsi
movl $0x770, %edx            # imm = 0x770
callq 0x63b0
movq -0x7e00(%rbp), %rdi
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq %rax, %rsi
leaq -0x7d70(%rbp), %rdi
callq 0x1f580
jmp 0x174bd
movq -0x7e00(%rbp), %rdi
addq $0x18, %rdi
movq %rdi, -0x7fa8(%rbp)
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq -0x7fa8(%rbp), %rdi
movsd 0x258(%rax), %xmm0
movsd %xmm0, -0x7fa0(%rbp)
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movq -0x7fa8(%rbp), %rdi
movsd 0x260(%rax), %xmm0
movsd %xmm0, -0x7f98(%rbp)
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movsd 0x268(%rax), %xmm0
movsd %xmm0, -0x7f90(%rbp)
leaq -0x6740(%rbp), %rdi
callq 0x1ff50
movsd -0x7fa0(%rbp), %xmm0
movsd -0x7f98(%rbp), %xmm1
movsd -0x7f90(%rbp), %xmm2
movq %rax, -0x7d78(%rbp)
movq -0x7d78(%rbp), %rdx
movq %rsp, %rdi
movl $0xee, %ecx
leaq -0x6eb0(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x7d70(%rbp), %rdi
leaq -0x55a0(%rbp), %rsi
callq 0x1f470
jmp 0x1758a
leaq -0x7d70(%rbp), %rdi
callq 0xb260
movq 0x61a13(%rip), %rdi     # 0x78fb0
leaq 0x3c585(%rip), %rsi     # 0x53b29
callq 0x6460
movq %rax, -0x7fb0(%rbp)
jmp 0x175b2
movq -0x7fb0(%rbp), %rdi
movq 0x61a00(%rip), %rsi     # 0x78fc0
callq 0x64c0
jmp 0x175c7
movq 0x619e2(%rip), %rdi     # 0x78fb0
leaq 0x8a2b(%rip), %rsi      # 0x20000
callq 0x6190
movq %rax, -0x7fb8(%rbp)
jmp 0x175e3
movl $0x6, %edi
callq 0x20030
movl %eax, -0x7fbc(%rbp)
jmp 0x175f5
movq -0x7fb8(%rbp), %rdi
movl -0x7fbc(%rbp), %eax
movl %eax, -0x7d7c(%rbp)
movl -0x7d7c(%rbp), %esi
callq 0x66a0
movq %rax, -0x7fc8(%rbp)
jmp 0x1761c
movq -0x7e00(%rbp), %rdi
addq $0x18, %rdi
movslq -0x5530(%rbp), %rsi
callq 0x1f080
movl 0x250(%rax), %esi
leaq -0x7dc0(%rbp), %rdi
callq 0x1d990
jmp 0x17647
leaq 0x3c52a(%rip), %rdx     # 0x53b78
leaq -0x7da0(%rbp), %rdi
leaq -0x7dc0(%rbp), %rsi
callq 0xace0
jmp 0x17663
movq -0x7fc8(%rbp), %rdi
leaq -0x7da0(%rbp), %rsi
callq 0x6410
jmp 0x17678
leaq -0x7da0(%rbp), %rdi
callq 0x68a8
leaq -0x7dc0(%rbp), %rdi
callq 0x68a8
leaq 0x61f49(%rip), %rdi     # 0x795e0
xorl %eax, %eax
movl %eax, %esi
callq 0x20050
movq %rax, -0x7fd0(%rbp)
jmp 0x176a9
movq -0x7fd0(%rbp), %rax
movsd (%rax), %xmm0
movq 0x618f5(%rip), %rdi     # 0x78fb0
callq 0x6830
movq %rax, -0x7fd8(%rbp)
jmp 0x176c9
movq -0x7fd8(%rbp), %rdi
leaq 0x3c499(%rip), %rsi     # 0x53b70
callq 0x6460
movq %rax, -0x7fe0(%rbp)
jmp 0x176e5
leaq 0x61ef4(%rip), %rdi     # 0x795e0
movl $0x1, %esi
callq 0x20050
movq %rax, -0x7fe8(%rbp)
jmp 0x176ff
movq -0x7fe0(%rbp), %rdi
movq -0x7fe8(%rbp), %rax
movsd (%rax), %xmm0
callq 0x6830
movq %rax, -0x7ff0(%rbp)
jmp 0x1771f
movq -0x7ff0(%rbp), %rdi
movq 0x6182b(%rip), %rsi     # 0x78f58
callq 0x64c0
jmp 0x17734
movq $0x0, -0x7de8(%rbp)
leaq 0x61e9a(%rip), %rsi     # 0x795e0
leaq -0x7de0(%rbp), %rdi
leaq -0x7de8(%rbp), %rdx
callq 0x200e0
jmp 0x1775b
movq $0x0, -0x7df0(%rbp)
leaq -0x7de0(%rbp), %rdi
leaq -0x7df0(%rbp), %rsi
callq 0x20120
jmp 0x1777b
leaq -0x7de0(%rbp), %rdi
callq 0x20290
leaq -0x6740(%rbp), %rdi
callq 0x1ffb0
leaq -0x55c0(%rbp), %rdi
callq 0x68a8
movl -0x5530(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5530(%rbp)
jmp 0x17132
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x17845
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x17839
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x1782d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x17821
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
leaq -0x55e0(%rbp), %rdi
callq 0x68a8
leaq -0x5600(%rbp), %rdi
callq 0x68a8
leaq -0x5660(%rbp), %rdi
callq 0x68a8
leaq -0x5620(%rbp), %rdi
callq 0x68a8
leaq -0x5640(%rbp), %rdi
callq 0x68a8
jmp 0x179e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x1790b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x178ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
leaq -0x7d70(%rbp), %rdi
callq 0xb260
jmp 0x178ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
jmp 0x178d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
leaq -0x7da0(%rbp), %rdi
callq 0x68a8
leaq -0x7dc0(%rbp), %rdi
callq 0x68a8
jmp 0x178ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xc58(%rbp)
movl %eax, -0xc5c(%rbp)
leaq -0x7de0(%rbp), %rdi
callq 0x20290
leaq -0x6740(%rbp), %rdi
callq 0x1ffb0
leaq -0x55c0(%rbp), %rdi
callq 0x68a8
jmp 0x179e4
movq 0x6168d(%rip), %rdi     # 0x78fb0
leaq 0x86d6(%rip), %rsi      # 0x20000
callq 0x6190
movq %rax, -0x7ff8(%rbp)
xorl %edi, %edi
callq 0x20030
movq -0x7ff8(%rbp), %rdi
movl %eax, -0x7df4(%rbp)
movl -0x7df4(%rbp), %esi
callq 0x66a0
movq 0x61654(%rip), %rdi     # 0x78fb0
leaq 0x3c241(%rip), %rsi     # 0x53ba4
callq 0x6460
movq %rax, %rdi
movsd 0x61c65(%rip), %xmm0    # 0x795d8
callq 0x6830
movq %rax, %rdi
movq 0x615d6(%rip), %rsi     # 0x78f58
callq 0x64c0
movq 0x61622(%rip), %rdi     # 0x78fb0
leaq 0x3c221(%rip), %rsi     # 0x53bb6
callq 0x6460
movq %rax, %rdi
movsd 0x61c2b(%rip), %xmm0    # 0x795d0
callq 0x6830
movq %rax, %rdi
movq 0x615a4(%rip), %rsi     # 0x78f58
callq 0x64c0
movq 0x615f0(%rip), %rdi     # 0x78fb0
leaq 0x3c202(%rip), %rsi     # 0x53bc9
callq 0x6460
movq %rax, %rdi
movq 0x61582(%rip), %rsi     # 0x78f58
callq 0x64c0
addq $0x8770, %rsp           # imm = 0x8770
popq %rbp
retq
movq -0xc58(%rbp), %rdi
callq 0x67a0