// File: tyhsu[P]Ewn/play.cpp
// Function: Play::compare_AI_mode()
void Play::compare_AI_mode()
{
    char mode_name[9][25] = { "evaluate_feature", \
                            "simulate_rand_type1", \
                            "simulate_rand_type2", \
                            "simulate_rand_type3", \
                            "simulate_rand_type4", \
                            "MCTS", \
                            "Random", \
                            "MCTS_simulate_rand_type3", \
                            "MCTS_simulate_rand_type4"};

    int mode_A, mode_B;
    int game_cnt;
    int win_cnt_A1 = 0, win_cnt_A2 = 0, win_cnt_B1 = 0, win_cnt_B2 = 0;
    double max_time_cost_A = 0, max_time_cost_B = 0;
    double total_time_cost_A = 0, total_time_cost_B = 0;
    double avg_move_timer_A1 = 0, avg_move_timer_B1 = 0, avg_move_timer_A2 = 0, avg_move_timer_B2 = 0;
    cout << "Please choose two AIs:" << endl;
    cout << "0)Minimax evaluating with feature" << endl;
    cout << "1)Minimax evaluating with simulation 1" << endl;
    cout << "2)Minimax evaluating with simulation 2" << endl;
    cout << "3)Minimax evaluating with simulation 3" << endl;
    cout << "4)Minimax evaluating with simulation 4" << endl;
    cout << "5)MCTS" << endl;
    cout << "6)Random" << endl;
    cout << "Choose: ";
    cout << "modeA choose: ";
    cin >> mode_A;
    cout << "modeB choose: ";
    cin >> mode_B;
    cout << "Please enter the count of the games: ";
    cin >> game_cnt;

    // modeA plays first, then modeB
    cout << "========== modeA then modeB ==========" << endl;
    for(int i = 0; i < game_cnt ; i++){
        Game init_game = this->game;
        EwnAI ewnAI1(mode_A);
        EwnAI ewnAI2(mode_B);
        while (1) {
            int debug = 0;
            int dice = init_game.roll_dice();

            int game_status;
            if (!init_game.get_is_switch()) {	// the first AI (A)
                cerr << "-";
                cerr.flush();
                clock_t init_time = clock();
                Movement mvmt = ewnAI1.AI_move(init_game, dice);
                game_status = init_game.update_game_status(mvmt);
                double time_cost = (double)(clock() - init_time) / CLOCKS_PER_SEC;
                max_time_cost_A = max(max_time_cost_A, time_cost);
                total_time_cost_A += time_cost;
                avg_move_timer_A1 += 1;
            }
            else {								// the second AI (B)
                cerr << "-";
                cerr.flush();
                clock_t init_time = clock();
                Movement mvmt = ewnAI2.AI_move(init_game, dice);
                game_status = init_game.update_game_status(mvmt);
                double time_cost = (double)(clock() - init_time) / CLOCKS_PER_SEC;
                max_time_cost_B = max(max_time_cost_B, time_cost);
                total_time_cost_B += time_cost;
                avg_move_timer_B1 += 1;
            }
            //update: 0(game continues), 1(A wins), 2(B wins)
            if (game_status!=0) {
                if (game_status==1) {
                    win_cnt_A1 ++ ;
                    cout << "A wins.  " << win_cnt_A1 + win_cnt_B1 << " games." << endl;
                }

                else {
                    win_cnt_B1 ++;
                    cout << "B wins.  " << win_cnt_A1 + win_cnt_B1 << " games." << endl;
                }
                break;
            }
            init_game.switch_player();
        }
    }
    printf("%-25s%-10s%-10s%-10s\n", "mode", "wins", "max_time_cost", "total_time_cost");
    printf("%-25s%-10d%-10lf%-10lf\n", mode_name[mode_A], win_cnt_A1, max_time_cost_A, total_time_cost_A);
    printf("%-25s%-10d%-10lf%-10lf\n", mode_name[mode_B], win_cnt_B1, max_time_cost_B, total_time_cost_B);

    // modeB plays first, then modeA
    cout << "========== modeB then modeA ==========" << endl;
    for (int i = 0; i < game_cnt ; i++){
        Game init_game = this->game;
        EwnAI ewnAI1(mode_B);
        EwnAI ewnAI2(mode_A);
        while (1) {
            int debug = 0;
            int dice = init_game.roll_dice();

            int game_status;
            if (!init_game.get_is_switch()) {	// the first AI (B)
                cerr << "-";
                cerr.flush();
                clock_t init_time = clock();
                Movement mvmt = ewnAI1.AI_move(init_game, dice);
                game_status = init_game.update_game_status(mvmt);
                double time_cost = (double)(clock() - init_time) / CLOCKS_PER_SEC;
                max_time_cost_B = max(max_time_cost_B, time_cost);
                avg_move_timer_B2 += 1;
            }
            else {							// the second AI (A)
                cerr << "-";
                cerr.flush();
                clock_t init_time = clock();
                Movement mvmt = ewnAI2.AI_move(init_game, dice);
                game_status = init_game.update_game_status(mvmt);
                double time_cost = (double)(clock() - init_time) / CLOCKS_PER_SEC;
                max_time_cost_A = max(max_time_cost_A, time_cost);
                avg_move_timer_A2 += 1;
            }
            //update: 0(game continues), 1(B wins), 2(A wins)
            if (game_status!=0) {
                if (game_status==1) {
                    win_cnt_B2 ++ ;
                    cout << "B wins.  " << win_cnt_A2 + win_cnt_B2 << " games." << endl;
                }

                else {
                    win_cnt_A2 ++;
                    cout << "A win.  " << win_cnt_A2 + win_cnt_B2 << " games." <<endl;
                }
                break;
            }
            init_game.switch_player();
        }
    }
    cout << endl << "==================================================" << endl;
    cout << "========== modeA then modeB ==========" << endl;
    printf("%-30s%-10s%-15s%-20s%-20s%s\n", "mode", "wins", "max_time_cost", "total_time_cost", "move_count", "time_cost_per_move(avg)");
    printf("%-30s%-10d%-15lf%-20lf%-20lf%lf\n", mode_name[mode_A], win_cnt_A1, max_time_cost_A, total_time_cost_A, avg_move_timer_A1, total_time_cost_A/avg_move_timer_A1);
    printf("%-30s%-10d%-15lf%-20lf%-20lf%lf\n", mode_name[mode_B], win_cnt_B1, max_time_cost_B, total_time_cost_B, avg_move_timer_B1, total_time_cost_B/avg_move_timer_B1);

    cout << "========== modeB then modeA ==========" << endl;
    printf("%-30s%-10s%-15s%-20s%-20s%s\n", "mode", "wins", "max_time_cost", "total_time_cost", "move_count", "time_cost_per_move(avg)");
    printf("%-30s%-10d%-15lf%-20lf%-20lf%lf\n", mode_name[mode_A], win_cnt_A2, max_time_cost_A, total_time_cost_A, avg_move_timer_A2, total_time_cost_A/avg_move_timer_A2);
    printf("%-30s%-10d%-15lf%-20lf%-20lf%lf\n", mode_name[mode_B], win_cnt_B2, max_time_cost_B, total_time_cost_B, avg_move_timer_B2, total_time_cost_B/avg_move_timer_B2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x12c0, %rsp           # imm = 0x12C0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x11e0(%rbp)
leaq -0xf0(%rbp), %rdi
leaq 0x9798(%rip), %rsi      # 0xd5b0
movl $0xe1, %edx
callq 0x2110
movl $0x0, -0x100(%rbp)
movl $0x0, -0x104(%rbp)
movl $0x0, -0x108(%rbp)
movl $0x0, -0x10c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x118(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x120(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x128(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x130(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x138(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x140(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x148(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x150(%rbp)
movq 0xe11f(%rip), %rdi      # 0x11fc8
leaq 0x9474(%rip), %rsi      # 0xd324
callq 0x2150
movq %rax, %rdi
movq 0xe0f9(%rip), %rsi      # 0x11fb8
callq 0x2190
movq 0xe0fd(%rip), %rdi      # 0x11fc8
leaq 0x9469(%rip), %rsi      # 0xd33b
callq 0x2150
movq %rax, %rdi
movq 0xe0d7(%rip), %rsi      # 0x11fb8
callq 0x2190
movq 0xe0db(%rip), %rdi      # 0x11fc8
leaq 0x9469(%rip), %rsi      # 0xd35d
callq 0x2150
movq %rax, %rdi
movq 0xe0b5(%rip), %rsi      # 0x11fb8
callq 0x2190
movq 0xe0b9(%rip), %rdi      # 0x11fc8
leaq 0x946e(%rip), %rsi      # 0xd384
callq 0x2150
movq %rax, %rdi
movq 0xe093(%rip), %rsi      # 0x11fb8
callq 0x2190
movq 0xe097(%rip), %rdi      # 0x11fc8
leaq 0x9473(%rip), %rsi      # 0xd3ab
callq 0x2150
movq %rax, %rdi
movq 0xe071(%rip), %rsi      # 0x11fb8
callq 0x2190
movq 0xe075(%rip), %rdi      # 0x11fc8
leaq 0x9478(%rip), %rsi      # 0xd3d2
callq 0x2150
movq %rax, %rdi
movq 0xe04f(%rip), %rsi      # 0x11fb8
callq 0x2190
movq 0xe053(%rip), %rdi      # 0x11fc8
leaq 0x947d(%rip), %rsi      # 0xd3f9
callq 0x2150
movq %rax, %rdi
movq 0xe02d(%rip), %rsi      # 0x11fb8
callq 0x2190
movq 0xe031(%rip), %rdi      # 0x11fc8
leaq 0x9462(%rip), %rsi      # 0xd400
callq 0x2150
movq %rax, %rdi
movq 0xe00b(%rip), %rsi      # 0x11fb8
callq 0x2190
movq 0xe00f(%rip), %rdi      # 0x11fc8
leaq 0x90cd(%rip), %rsi      # 0xd08d
callq 0x2150
movq 0xdffc(%rip), %rdi      # 0x11fc8
leaq 0x9436(%rip), %rsi      # 0xd409
callq 0x2150
movq 0xdff9(%rip), %rdi      # 0x11fd8
leaq -0xf4(%rbp), %rsi
callq 0x20a0
movq 0xdfd6(%rip), %rdi      # 0x11fc8
leaq 0x941f(%rip), %rsi      # 0xd418
callq 0x2150
movq 0xdfd3(%rip), %rdi      # 0x11fd8
leaq -0xf8(%rbp), %rsi
callq 0x20a0
movq 0xdfb0(%rip), %rdi      # 0x11fc8
leaq 0x9408(%rip), %rsi      # 0xd427
callq 0x2150
movq 0xdfad(%rip), %rdi      # 0x11fd8
leaq -0xfc(%rbp), %rsi
callq 0x20a0
movq 0xdf8a(%rip), %rdi      # 0x11fc8
leaq 0x9408(%rip), %rsi      # 0xd44d
callq 0x2150
movq %rax, %rdi
movq 0xdf64(%rip), %rsi      # 0x11fb8
callq 0x2190
movl $0x0, -0x154(%rbp)
movl -0x154(%rbp), %eax
cmpl -0xfc(%rbp), %eax
jge 0x44f2
movq -0x11e0(%rbp), %rsi
leaq -0x240(%rbp), %rdi
callq 0xa520
movl -0xf4(%rbp), %esi
leaq -0x4e0(%rbp), %rdi
callq 0x5500
movl -0xf8(%rbp), %esi
leaq -0x780(%rbp), %rdi
callq 0x5500
jmp 0x40ae
jmp 0x40b0
jmp 0x40b2
movl $0x0, -0x790(%rbp)
leaq -0x240(%rbp), %rdi
callq 0xad70
movl %eax, -0x11e4(%rbp)
jmp 0x40d0
movl -0x11e4(%rbp), %eax
movl %eax, -0x794(%rbp)
leaq -0x240(%rbp), %rdi
callq 0xb910
movb %al, -0x11e5(%rbp)
jmp 0x40f0
movb -0x11e5(%rbp), %al
testb $0x1, %al
jne 0x4261
jmp 0x4100
movq 0xdee9(%rip), %rdi      # 0x11ff0
leaq 0x8f19(%rip), %rsi      # 0xd027
callq 0x2150
jmp 0x4115
movq 0xded4(%rip), %rdi      # 0x11ff0
callq 0x20c0
jmp 0x4123
callq 0x20b0
movq %rax, -0x7a0(%rbp)
leaq -0x890(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0xa520
jmp 0x4144
movl -0x794(%rbp), %edx
leaq -0x4e0(%rbp), %rdi
leaq -0x890(%rbp), %rsi
callq 0x5650
movq %rax, -0x11f0(%rbp)
jmp 0x4166
movq -0x11f0(%rbp), %rax
movq %rax, -0x7a8(%rbp)
leaq -0x240(%rbp), %rdi
leaq -0x7a8(%rbp), %rsi
callq 0xb120
movl %eax, -0x11f4(%rbp)
jmp 0x418f
movl -0x11f4(%rbp), %eax
movl %eax, -0x798(%rbp)
callq 0x20b0
movq -0x7a0(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x8ef9(%rip), %xmm1     # 0xd0b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x898(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x898(%rbp), %rsi
callq 0x4d40
movq %rax, -0x1200(%rbp)
jmp 0x41df
movq -0x1200(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x118(%rbp)
movsd -0x898(%rbp), %xmm0
addsd -0x128(%rbp), %xmm0
movsd %xmm0, -0x128(%rbp)
movsd 0x8ea6(%rip), %xmm0     # 0xd0b8
addsd -0x138(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
jmp 0x4383
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x788(%rbp)
movl %eax, -0x78c(%rbp)
jmp 0x44e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x788(%rbp)
movl %eax, -0x78c(%rbp)
leaq -0x780(%rbp), %rdi
callq 0x4c80
jmp 0x44e1
movq 0xdd88(%rip), %rdi      # 0x11ff0
leaq 0x8db8(%rip), %rsi      # 0xd027
callq 0x2150
jmp 0x4276
movq 0xdd73(%rip), %rdi      # 0x11ff0
callq 0x20c0
jmp 0x4284
callq 0x20b0
movq %rax, -0x8a0(%rbp)
leaq -0x990(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0xa520
jmp 0x42a5
movl -0x794(%rbp), %edx
leaq -0x780(%rbp), %rdi
leaq -0x990(%rbp), %rsi
callq 0x5650
movq %rax, -0x1208(%rbp)
jmp 0x42c7
movq -0x1208(%rbp), %rax
movq %rax, -0x8a8(%rbp)
leaq -0x240(%rbp), %rdi
leaq -0x8a8(%rbp), %rsi
callq 0xb120
movl %eax, -0x120c(%rbp)
jmp 0x42f0
movl -0x120c(%rbp), %eax
movl %eax, -0x798(%rbp)
callq 0x20b0
movq -0x8a0(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x8d98(%rip), %xmm1     # 0xd0b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x998(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x998(%rbp), %rsi
callq 0x4d40
movq %rax, -0x1218(%rbp)
jmp 0x4340
movq -0x1218(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0x998(%rbp), %xmm0
addsd -0x130(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
movsd 0x8d45(%rip), %xmm0     # 0xd0b8
addsd -0x140(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
cmpl $0x0, -0x798(%rbp)
je 0x44a2
cmpl $0x1, -0x798(%rbp)
jne 0x4420
movl -0x100(%rbp), %eax
incl %eax
movl %eax, -0x100(%rbp)
movq 0xdc16(%rip), %rdi      # 0x11fc8
leaq 0x90bb(%rip), %rsi      # 0xd474
callq 0x2150
movq %rax, -0x1220(%rbp)
jmp 0x43c7
movq -0x1220(%rbp), %rdi
movl -0x100(%rbp), %esi
movl -0x108(%rbp), %eax
addl %eax, %esi
callq 0x2200
movq %rax, -0x1228(%rbp)
jmp 0x43ea
movq -0x1228(%rbp), %rdi
leaq 0x9086(%rip), %rsi      # 0xd47e
callq 0x2150
movq %rax, -0x1230(%rbp)
jmp 0x4406
movq -0x1230(%rbp), %rdi
movq 0xdba4(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x441b
jmp 0x44a0
movl -0x108(%rbp), %eax
incl %eax
movl %eax, -0x108(%rbp)
movq 0xdb93(%rip), %rdi      # 0x11fc8
leaq 0x904a(%rip), %rsi      # 0xd486
callq 0x2150
movq %rax, -0x1238(%rbp)
jmp 0x444a
movq -0x1238(%rbp), %rdi
movl -0x100(%rbp), %esi
movl -0x108(%rbp), %eax
addl %eax, %esi
callq 0x2200
movq %rax, -0x1240(%rbp)
jmp 0x446d
movq -0x1240(%rbp), %rdi
leaq 0x9003(%rip), %rsi      # 0xd47e
callq 0x2150
movq %rax, -0x1248(%rbp)
jmp 0x4489
movq -0x1248(%rbp), %rdi
movq 0xdb21(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x449e
jmp 0x44a0
jmp 0x44b5
leaq -0x240(%rbp), %rdi
callq 0xb440
jmp 0x44b0
jmp 0x40b0
leaq -0x780(%rbp), %rdi
callq 0x4c80
leaq -0x4e0(%rbp), %rdi
callq 0x4c80
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x4063
leaq -0x4e0(%rbp), %rdi
callq 0x4c80
jmp 0x4c53
leaq 0x8f97(%rip), %rdi      # 0xd490
leaq 0x8b88(%rip), %rsi      # 0xd088
leaq 0x8f9f(%rip), %rdx      # 0xd4a6
leaq 0x8f9d(%rip), %rcx      # 0xd4ab
leaq 0x8fa4(%rip), %r8       # 0xd4b9
movb $0x0, %al
callq 0x2030
movslq -0xf4(%rbp), %rax
leaq -0xf0(%rbp), %rsi
imulq $0x19, %rax, %rax
addq %rax, %rsi
movl -0x100(%rbp), %edx
movsd -0x118(%rbp), %xmm0
movsd -0x128(%rbp), %xmm1
leaq 0x8f7b(%rip), %rdi      # 0xd4c9
movb $0x2, %al
callq 0x2030
movslq -0xf8(%rbp), %rax
leaq -0xf0(%rbp), %rsi
imulq $0x19, %rax, %rax
addq %rax, %rsi
movl -0x108(%rbp), %edx
movsd -0x120(%rbp), %xmm0
movsd -0x130(%rbp), %xmm1
leaq 0x8f42(%rip), %rdi      # 0xd4c9
movb $0x2, %al
callq 0x2030
movq 0xda33(%rip), %rdi      # 0x11fc8
leaq 0x8f45(%rip), %rsi      # 0xd4e1
callq 0x2150
movq %rax, %rdi
movq 0xda0d(%rip), %rsi      # 0x11fb8
callq 0x2190
movl $0x0, -0x99c(%rbp)
movl -0x99c(%rbp), %eax
cmpl -0xfc(%rbp), %eax
jge 0x4a19
movq -0x11e0(%rbp), %rsi
leaq -0xa88(%rbp), %rdi
callq 0xa520
movl -0xf8(%rbp), %esi
leaq -0xd28(%rbp), %rdi
callq 0x5500
movl -0xf4(%rbp), %esi
leaq -0xfc8(%rbp), %rdi
callq 0x5500
jmp 0x4605
jmp 0x4607
jmp 0x4609
movl $0x0, -0xfcc(%rbp)
leaq -0xa88(%rbp), %rdi
callq 0xad70
movl %eax, -0x124c(%rbp)
jmp 0x4627
movl -0x124c(%rbp), %eax
movl %eax, -0xfd0(%rbp)
leaq -0xa88(%rbp), %rdi
callq 0xb910
movb %al, -0x124d(%rbp)
jmp 0x4647
movb -0x124d(%rbp), %al
testb $0x1, %al
jne 0x47a0
jmp 0x4657
movq 0xd992(%rip), %rdi      # 0x11ff0
leaq 0x89c2(%rip), %rsi      # 0xd027
callq 0x2150
jmp 0x466c
movq 0xd97d(%rip), %rdi      # 0x11ff0
callq 0x20c0
jmp 0x467a
callq 0x20b0
movq %rax, -0xfe0(%rbp)
leaq -0x10d0(%rbp), %rdi
leaq -0xa88(%rbp), %rsi
callq 0xa520
jmp 0x469b
movl -0xfd0(%rbp), %edx
leaq -0xd28(%rbp), %rdi
leaq -0x10d0(%rbp), %rsi
callq 0x5650
movq %rax, -0x1258(%rbp)
jmp 0x46bd
movq -0x1258(%rbp), %rax
movq %rax, -0xfe8(%rbp)
leaq -0xa88(%rbp), %rdi
leaq -0xfe8(%rbp), %rsi
callq 0xb120
movl %eax, -0x125c(%rbp)
jmp 0x46e6
movl -0x125c(%rbp), %eax
movl %eax, -0xfd4(%rbp)
callq 0x20b0
movq -0xfe0(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x89a2(%rip), %xmm1     # 0xd0b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x10d8(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x10d8(%rbp), %rsi
callq 0x4d40
movq %rax, -0x1268(%rbp)
jmp 0x4736
movq -0x1268(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x120(%rbp)
movsd 0x8967(%rip), %xmm0     # 0xd0b8
addsd -0x150(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
jmp 0x48aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x788(%rbp)
movl %eax, -0x78c(%rbp)
jmp 0x4a08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x788(%rbp)
movl %eax, -0x78c(%rbp)
leaq -0xfc8(%rbp), %rdi
callq 0x4c80
jmp 0x4a08
movq 0xd849(%rip), %rdi      # 0x11ff0
leaq 0x8879(%rip), %rsi      # 0xd027
callq 0x2150
jmp 0x47b5
movq 0xd834(%rip), %rdi      # 0x11ff0
callq 0x20c0
jmp 0x47c3
callq 0x20b0
movq %rax, -0x10e0(%rbp)
leaq -0x11d0(%rbp), %rdi
leaq -0xa88(%rbp), %rsi
callq 0xa520
jmp 0x47e4
movl -0xfd0(%rbp), %edx
leaq -0xfc8(%rbp), %rdi
leaq -0x11d0(%rbp), %rsi
callq 0x5650
movq %rax, -0x1270(%rbp)
jmp 0x4806
movq -0x1270(%rbp), %rax
movq %rax, -0x10e8(%rbp)
leaq -0xa88(%rbp), %rdi
leaq -0x10e8(%rbp), %rsi
callq 0xb120
movl %eax, -0x1274(%rbp)
jmp 0x482f
movl -0x1274(%rbp), %eax
movl %eax, -0xfd4(%rbp)
callq 0x20b0
movq -0x10e0(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm0
movsd 0x8859(%rip), %xmm1     # 0xd0b0
divsd %xmm1, %xmm0
movsd %xmm0, -0x11d8(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x11d8(%rbp), %rsi
callq 0x4d40
movq %rax, -0x1280(%rbp)
jmp 0x487f
movq -0x1280(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x118(%rbp)
movsd 0x881e(%rip), %xmm0     # 0xd0b8
addsd -0x148(%rbp), %xmm0
movsd %xmm0, -0x148(%rbp)
cmpl $0x0, -0xfd4(%rbp)
je 0x49c9
cmpl $0x1, -0xfd4(%rbp)
jne 0x4947
movl -0x10c(%rbp), %eax
incl %eax
movl %eax, -0x10c(%rbp)
movq 0xd6ef(%rip), %rdi      # 0x11fc8
leaq 0x8ba6(%rip), %rsi      # 0xd486
callq 0x2150
movq %rax, -0x1288(%rbp)
jmp 0x48ee
movq -0x1288(%rbp), %rdi
movl -0x104(%rbp), %esi
movl -0x10c(%rbp), %eax
addl %eax, %esi
callq 0x2200
movq %rax, -0x1290(%rbp)
jmp 0x4911
movq -0x1290(%rbp), %rdi
leaq 0x8b5f(%rip), %rsi      # 0xd47e
callq 0x2150
movq %rax, -0x1298(%rbp)
jmp 0x492d
movq -0x1298(%rbp), %rdi
movq 0xd67d(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x4942
jmp 0x49c7
movl -0x104(%rbp), %eax
incl %eax
movl %eax, -0x104(%rbp)
movq 0xd66c(%rip), %rdi      # 0x11fc8
leaq 0x8ba5(%rip), %rsi      # 0xd508
callq 0x2150
movq %rax, -0x12a0(%rbp)
jmp 0x4971
movq -0x12a0(%rbp), %rdi
movl -0x104(%rbp), %esi
movl -0x10c(%rbp), %eax
addl %eax, %esi
callq 0x2200
movq %rax, -0x12a8(%rbp)
jmp 0x4994
movq -0x12a8(%rbp), %rdi
leaq 0x8adc(%rip), %rsi      # 0xd47e
callq 0x2150
movq %rax, -0x12b0(%rbp)
jmp 0x49b0
movq -0x12b0(%rbp), %rdi
movq 0xd5fa(%rip), %rsi      # 0x11fb8
callq 0x2190
jmp 0x49c5
jmp 0x49c7
jmp 0x49dc
leaq -0xa88(%rbp), %rdi
callq 0xb440
jmp 0x49d7
jmp 0x4607
leaq -0xfc8(%rbp), %rdi
callq 0x4c80
leaq -0xd28(%rbp), %rdi
callq 0x4c80
movl -0x99c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x99c(%rbp)
jmp 0x45ba
leaq -0xd28(%rbp), %rdi
callq 0x4c80
jmp 0x4c53
movq 0xd5a8(%rip), %rdi      # 0x11fc8
movq 0xd591(%rip), %rsi      # 0x11fb8
callq 0x2190
movq %rax, %rdi
leaq 0x8adb(%rip), %rsi      # 0xd511
callq 0x2150
movq %rax, %rdi
movq 0xd573(%rip), %rsi      # 0x11fb8
callq 0x2190
movq 0xd577(%rip), %rdi      # 0x11fc8
leaq 0x89f5(%rip), %rsi      # 0xd44d
callq 0x2150
movq %rax, %rdi
movq 0xd551(%rip), %rsi      # 0x11fb8
callq 0x2190
leaq 0x8ad1(%rip), %rdi      # 0xd544
leaq 0x860e(%rip), %rsi      # 0xd088
leaq 0x8a25(%rip), %rdx      # 0xd4a6
leaq 0x8a23(%rip), %rcx      # 0xd4ab
leaq 0x8a2a(%rip), %r8       # 0xd4b9
leaq 0x8acb(%rip), %r9       # 0xd561
leaq 0x8acf(%rip), %rax      # 0xd56c
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2030
movslq -0xf4(%rbp), %rax
leaq -0xf0(%rbp), %rsi
imulq $0x19, %rax, %rax
addq %rax, %rsi
movl -0x100(%rbp), %edx
movsd -0x118(%rbp), %xmm0
movsd -0x128(%rbp), %xmm1
movsd -0x138(%rbp), %xmm2
movsd -0x128(%rbp), %xmm3
divsd -0x138(%rbp), %xmm3
leaq 0x8a92(%rip), %rdi      # 0xd584
movb $0x4, %al
callq 0x2030
movslq -0xf8(%rbp), %rax
leaq -0xf0(%rbp), %rsi
imulq $0x19, %rax, %rax
addq %rax, %rsi
movl -0x108(%rbp), %edx
movsd -0x120(%rbp), %xmm0
movsd -0x130(%rbp), %xmm1
movsd -0x140(%rbp), %xmm2
movsd -0x130(%rbp), %xmm3
divsd -0x140(%rbp), %xmm3
leaq 0x8a41(%rip), %rdi      # 0xd584
movb $0x4, %al
callq 0x2030
movq 0xd477(%rip), %rdi      # 0x11fc8
leaq 0x8989(%rip), %rsi      # 0xd4e1
callq 0x2150
movq %rax, %rdi
movq 0xd451(%rip), %rsi      # 0x11fb8
callq 0x2190
leaq 0x89d1(%rip), %rdi      # 0xd544
leaq 0x850e(%rip), %rsi      # 0xd088
leaq 0x8925(%rip), %rdx      # 0xd4a6
leaq 0x8923(%rip), %rcx      # 0xd4ab
leaq 0x892a(%rip), %r8       # 0xd4b9
leaq 0x89cb(%rip), %r9       # 0xd561
leaq 0x89cf(%rip), %rax      # 0xd56c
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2030
movslq -0xf4(%rbp), %rax
leaq -0xf0(%rbp), %rsi
imulq $0x19, %rax, %rax
addq %rax, %rsi
movl -0x104(%rbp), %edx
movsd -0x118(%rbp), %xmm0
movsd -0x128(%rbp), %xmm1
movsd -0x148(%rbp), %xmm2
movsd -0x128(%rbp), %xmm3
divsd -0x148(%rbp), %xmm3
leaq 0x8992(%rip), %rdi      # 0xd584
movb $0x4, %al
callq 0x2030
movslq -0xf8(%rbp), %rax
leaq -0xf0(%rbp), %rsi
imulq $0x19, %rax, %rax
addq %rax, %rsi
movl -0x10c(%rbp), %edx
movsd -0x120(%rbp), %xmm0
movsd -0x130(%rbp), %xmm1
movsd -0x150(%rbp), %xmm2
movsd -0x130(%rbp), %xmm3
divsd -0x150(%rbp), %xmm3
leaq 0x8941(%rip), %rdi      # 0xd584
movb $0x4, %al
callq 0x2030
addq $0x12c0, %rsp           # imm = 0x12C0
popq %rbp
retq
movq -0x788(%rbp), %rdi
callq 0x2210
nop