// File: /workspace/github_c_makefile_star2_O1/skeeto[P]goblin-com/src/main.c
// Function: main
int
main(void)
{
    int w, h;
    display_init();
    device_terminal_size(&w, &h);
    if (w < DISPLAY_WIDTH || h < DISPLAY_HEIGHT) {
        display_free();
        printf("Goblin-COM requires a terminal of at least %dx%d characters!\n"
               "I see %dx%d\n"
               "Press enter to exit ...\n",
               DISPLAY_WIDTH, DISPLAY_HEIGHT, w, h);
        fflush(stdout);
        getchar();
        exit(EXIT_FAILURE);
    }
    device_entropy(&rand_state, sizeof(rand_state));
    device_title("Goblin-COM");

    panel_t loading;
    uint8_t loading_message[] = "Initializing world ...";
    panel_center_init(&loading, sizeof(loading_message), 1);
    display_push(&loading);
    panel_puts(&loading, 0, 0, FONT_DEFAULT, (char *)loading_message);
    display_refresh();
    game_t *game;
    FILE *save = fopen(PERSIST_FILE, "rb");
    if (save) {
        game = game_load(save);
        fclose(save);
        game->speed = SPEED_FACTOR;
        unlink(PERSIST_FILE);
    } else {
        game = game_create(xorshift(&rand_state));
        game->speed = SPEED_FACTOR;
    }
    atexit_save_game = game;
    atexit(atexit_save);
    display_pop_free();

    panel_t sidemenu;
    panel_init(&sidemenu, DISPLAY_WIDTH - SIDEMENU_WIDTH, 0,
               SIDEMENU_WIDTH, DISPLAY_HEIGHT);
    display_push(&sidemenu);

    panel_t terrain;
    panel_init(&terrain, 0, 0, MAP_WIDTH, MAP_HEIGHT);
    display_push(&terrain);

    panel_t buildings;
    panel_init(&buildings, 0, 0, MAP_WIDTH, MAP_HEIGHT);
    display_push(&buildings);

    panel_t units;
    panel_init(&units, 0, 0, MAP_WIDTH, MAP_HEIGHT);
    display_push(&units);

    /* Main Loop */
    bool running = true;
    while (running) {
        yield_t diff;
        for (int i = 0; running && i < game->speed; i++) {
            diff = game_step(game);
            enum game_event event;
            while ((event = game_event_pop(game)) != EVENT_NONE) {
                sidemenu_draw(&sidemenu, game, diff);
                display_refresh();
                switch (event) {
                case EVENT_LOSE:
                    atexit_save_game = NULL;
                    running = false;
                    ui_gameover(game, &terrain);
                break;
                case EVENT_PROGRESS_1:
                    ui_halfway(game, &terrain);
                    break;
                case EVENT_WIN:
                    atexit_save_game = NULL;
                    running = false;
                    ui_win(game, &terrain);
                    break;
                case EVENT_BATTLE:
                    ui_apology(game, &terrain);
                    break;
                case EVENT_NONE:
                    break;
                }
            }
        }

        sidemenu_draw(&sidemenu, game, diff);
        map_draw_terrain(game->map, &terrain);
        panel_clear(&buildings);
        map_draw_buildings(game->map, &buildings);
        panel_clear(&units);
        game_draw_units(game, &units, false);
        display_refresh();
        uint64_t wait = device_uepoch() % PERIOD;
        if (device_kbhit(wait)) {
            int key = device_getch();
            switch (key) {
            case 'b':
                ui_build(game, &terrain);
                break;
            case 's':
                ui_squads(game, &terrain, &units);
                break;
            case 'h':
                ui_heroes(game, &terrain);
                break;
            case 't':
                ui_story(game, &terrain);
                break;
            case 'p':
                ui_help(game, &terrain);
                break;
            case '>':
            case '.':
                if (game->speed < SPEED_MAX)
                    game->speed *= SPEED_FACTOR;
                break;
            case '<':
            case ',':
                game->speed /= SPEED_FACTOR;
                if (game->speed == 0)
                    game->speed = 1;
                break;
            case 'R':
                display_invalidate();
                break;
            case 'q':
                running = !popup_quit(true);
                break;
            case 'Q':
                running = !popup_quit(false);
                if (!running)
                    atexit_save_game = NULL;
                break;
            default:
                break;
            }
        }
    };

    atexit_save();
    atexit_save_game = NULL;
    game_free(game);

    display_pop(); // units
    display_pop(); // buildings
    display_pop(); // terrain
    display_pop(); // sidemenu
    panel_free(&units);
    panel_free(&buildings);
    panel_free(&terrain);
    panel_free(&sidemenu);
    display_free();
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a7a8, %rsp          # imm = 0x1A7A8
callq 0x30cc
leaq 0x3c(%rsp), %rbx
leaq 0x1c(%rsp), %rsi
movq %rbx, %rdi
callq 0x615c
cmpl $0x50, (%rbx)
jl 0x291a
cmpl $0x17, 0x1c(%rsp)
jle 0x291a
leaq 0x11e29(%rip), %rdi     # 0x131e8
movl $0x8, %esi
callq 0x619c
leaq 0x5d0a(%rip), %rdi      # 0x70da
callq 0x614b
movapd 0x6203(%rip), %xmm0     # 0x75e0
leaq 0xc0(%rsp), %rbx
movapd %xmm0, (%rbx)
movabsq $0x2e2e2e20646c72, %rax # imm = 0x2E2E2E20646C72
movq %rax, 0xf(%rbx)
leaq 0x16b90(%rsp), %r14
movq %r14, %rdi
movl $0x17, %esi
movl $0x1, %edx
callq 0x345f
movq %r14, %rdi
callq 0x33e8
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x10007, %ecx          # imm = 0x10007
movq %rbx, %r8
callq 0x353e
callq 0x323c
leaq 0x5cac(%rip), %rdi      # 0x70e5
leaq 0x5cb2(%rip), %rsi      # 0x70f2
callq 0x1210
testq %rax, %rax
je 0x1475
movq %rax, %r14
movq %rax, %rdi
callq 0x4908
movq %rax, %rbx
movq %r14, %rdi
callq 0x10b0
movl $0x6, 0x10(%rbx)
leaq 0x5c77(%rip), %rdi      # 0x70e5
callq 0x1040
jmp 0x1493
leaq 0x11d6c(%rip), %rdi     # 0x131e8
callq 0x59cc
movq %rax, %rdi
callq 0x47a9
movq %rax, %rbx
movl $0x6, 0x10(%rax)
movq %rbx, 0xb3e6(%rip)      # 0xc880
leaq 0x14bd(%rip), %rdi      # 0x295e
callq 0x6240
callq 0x341f
leaq 0xb748(%rsp), %r14
movq %r14, %rdi
movl $0x3c, %esi
xorl %edx, %edx
movl $0x14, %ecx
movl $0x18, %r8d
callq 0x3166
movq %r14, %rdi
callq 0x33e8
leaq 0x7b30(%rsp), %rbp
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x3c, %ecx
movl $0x18, %r8d
callq 0x3166
movq %rbp, %rdi
callq 0x33e8
leaq 0x12f78(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x3c, %ecx
movl $0x18, %r8d
callq 0x3166
movq %r15, %rdi
callq 0x33e8
leaq 0xf360(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x3c, %ecx
movl $0x18, %r8d
callq 0x3166
movq %r15, %rdi
callq 0x33e8
leaq 0x3cc(%rbx), %rax
movq %rax, 0x28(%rsp)
leaq 0x2c8(%rbx), %rax
movq %rax, 0x20(%rsp)
movb $0x1, %al
leaq 0x5a99(%rip), %r13      # 0x7004
testb $0x1, %al
movl %eax, (%rsp)
je 0x1682
cmpl $0x0, 0x10(%rbx)
jle 0x1682
xorl %r12d, %r12d
movq %rbx, %rdi
callq 0x5188
movq %rax, 0x40(%rsp)
movl %edx, 0x18(%rsp)
movq %rbx, %rdi
callq 0x4f3e
testl %eax, %eax
je 0x166f
movl %eax, %r15d
movq %r14, %rdi
movq %rbx, %rsi
movq 0x40(%rsp), %rdx
movl 0x18(%rsp), %ecx
callq 0x29ab
callq 0x323c
decl %r15d
cmpl $0x3, %r15d
ja 0x165c
movslq (%r13,%r15,4), %rax
addq %r13, %rax
jmpq *%rax
movq $0x0, 0xb29e(%rip) # 0xc880
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x987d(%rip), %rdx      # 0xae6c
jmp 0x164b
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x9b95(%rip), %rdx      # 0xb193
movl $0x10, %ecx
callq 0x2c37
jmp 0x165c
cmpb $0x0, 0x1dec(%rbx)
jne 0x162a
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xafbb(%rip), %rdx      # 0xc5db
movl $0xe, %ecx
callq 0x2c37
movb $0x1, 0x1dec(%rbx)
jmp 0x165c
movq $0x0, 0xb242(%rip) # 0xc880
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0xa470(%rip), %rdx      # 0xbabb
movl $0x10, %ecx
callq 0x2c37
movl $0x0, (%rsp)
movq %rbx, %rdi
callq 0x4f3e
movl %eax, %r15d
testl %eax, %eax
jne 0x15a7
testb $0x1, (%rsp)
je 0x1682
incl %r12d
cmpl 0x10(%rbx), %r12d
jl 0x1583
movq %r14, %rdi
movq %rbx, %rsi
movq 0x40(%rsp), %rdx
movl 0x18(%rsp), %ecx
callq 0x29ab
movq 0x38(%rbx), %rdi
movq %rbp, %rsi
callq 0x441c
leaq 0x12f78(%rsp), %r15
movq %r15, %rdi
callq 0x3ac5
movq 0x38(%rbx), %rdi
movq %r15, %rsi
callq 0x4641
leaq 0xf360(%rsp), %r15
movq %r15, %rdi
callq 0x3ac5
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x578a
callq 0x323c
callq 0x6128
movq %rax, %rdi
movabsq $-0x456d8a7abe346c9, %rcx # imm = 0xFBA92758541CB937
mulq %rcx
shrq $0x10, %rdx
imulq $0x1046a, %rdx, %rax    # imm = 0x1046A
subq %rax, %rdi
callq 0x60b0
testb %al, %al
je 0x2864
callq 0x5ffc
cmpl $0x61, %eax
leaq 0x2f0(%rsp), %r12
jg 0x176c
cmpl $0x3d, %eax
jg 0x179b
cmpl $0x2c, %eax
je 0x173e
cmpl $0x2e, %eax
je 0x1ec2
cmpl $0x3c, %eax
jne 0x2864
movslq 0x10(%rbx), %rax
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
addl $0x5, %eax
cmpl $0xb, %eax
movl $0x1, %eax
cmovbl %eax, %ecx
movl %ecx, 0x10(%rbx)
jmp 0x2864
leal -0x70(%rax), %ecx
cmpl $0x4, %ecx
ja 0x17c0
leaq 0x5899(%rip), %rdx      # 0x7014
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x8d5b(%rip), %rdx      # 0xa4ec
movl $0x13, %ecx
jmp 0x1eef
cmpl $0x3e, %eax
je 0x1ec2
cmpl $0x51, %eax
je 0x2041
cmpl $0x52, %eax
jne 0x2864
callq 0x3440
jmp 0x2864
cmpl $0x68, %eax
je 0x2060
cmpl $0x62, %eax
jne 0x2864
movq %r12, %rdi
movl $0x38, %esi
movl $0x14, %edx
callq 0x345f
movq %r12, %rdi
callq 0x33e8
movq %r12, %rdi
movl $0x7, %esi
callq 0x3b2b
movq %r12, %r14
xorl %r12d, %r12d
movl $0x19, %esi
leaq 0x3f10(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4ddb
leaq 0xe0(%rsp), %rdi
xorl %esi, %esi
movl $0x5, %edx
movl $0x1, %ecx
callq 0x4ddb
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
leaq 0x5a0e(%rip), %rcx      # 0x7253
movq %r15, %r8
xorl %eax, %eax
callq 0x373c
movq %r14, %rdi
movl $0x5, %esi
movl $0x2, %edx
leaq 0x5a0c(%rip), %rcx      # 0x726f
leaq 0xe0(%rsp), %r8
xorl %eax, %eax
callq 0x373c
movslq 0xb00f(%rip), %rax      # 0xc888
leal 0x7(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x8, %ecx
leaq (,%rax,8), %rdx
subq %rax, %rdx
leal 0x1(%rax), %esi
subl %ecx, %eax
cltq
leaq (,%rax,8), %rcx
subq %rax, %rcx
leaq 0xafe8(%rip), %r15      # 0xc890
movw $0x99e2, %ax            # imm = 0x99E2
movw %ax, (%rcx,%r15)
movb $-0x5d, %al
movb %al, 0x2(%rcx,%r15)
leaq (%r15,%rcx), %r8
movb %r12b, 0x3(%rdx,%r15)
movl %esi, 0xafc1(%rip)      # 0xc888
movq %r14, %rdi
movl $0x5, %esi
movl $0x3, %edx
leaq 0x59a2(%rip), %rcx      # 0x727d
xorl %eax, %eax
callq 0x373c
leaq 0x3f10(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
movl $0x14, %edx
xorl %ecx, %ecx
callq 0x4ddb
leaq 0xe0(%rsp), %rdi
movabsq $0x400000000, %rsi      # imm = 0x400000000
xorl %edx, %edx
movl $0x1, %ecx
callq 0x4ddb
movq %r14, %rdi
movl $0x1, %esi
movl $0x4, %edx
leaq 0x5968(%rip), %rcx      # 0x7295
movq %r15, %r8
xorl %eax, %eax
callq 0x373c
movq %r14, %rdi
movq %r14, %r15
movl $0x5, %esi
movl $0x5, %edx
leaq 0x5921(%rip), %rcx      # 0x726f
leaq 0xe0(%rsp), %r8
movq %r8, %r14
xorl %eax, %eax
callq 0x373c
movslq 0xaf21(%rip), %rax      # 0xc888
leal 0x7(%rax), %ecx
testq %rax, %rax
cmovnsl %eax, %ecx
andl $-0x8, %ecx
movl %eax, %edx
subl %ecx, %edx
movslq %edx, %rcx
leaq (,%rcx,8), %rdx
subq %rcx, %rdx
leaq 0xaf04(%rip), %rdi      # 0xc890
leaq (%rdi,%rdx), %r8
movb $0x2e, %cl
movb %cl, (%rdx,%rdi)
leaq (,%rax,8), %rcx
subq %rax, %rcx
movb %r12b, 0x1(%rcx,%rdi)
leal 0x1(%rax), %edx
movl %edx, 0xaeda(%rip)      # 0xc888
leal 0x8(%rax), %esi
testl %edx, %edx
cmovnsl %edx, %esi
andl $-0x8, %esi
negl %esi
leal (%rax,%rsi), %edx
incl %edx
movslq %edx, %rdx
leaq (,%rdx,8), %rsi
subq %rdx, %rsi
leaq (%rdi,%rsi), %r9
movw $0x99e2, %dx            # imm = 0x99E2
movw %dx, (%rsi,%rdi)
movb $-0x5d, %dl
movb %dl, 0x2(%rsi,%rdi)
movb %r12b, 0xa(%rcx,%rdi)
addl $0x2, %eax
movl %eax, 0xae9a(%rip)      # 0xc888
movq %r15, %rdi
movl $0x5, %esi
movl $0x6, %edx
leaq 0x58a9(%rip), %rcx      # 0x72ab
xorl %eax, %eax
callq 0x373c
movl $0x46, %esi
leaq 0x3f10(%rsp), %r15
movq %r15, %rdi
movl $0x46, %edx
xorl %ecx, %ecx
callq 0x4ddb
movq %r14, %rdi
movabsq $-0x200000000, %rsi     # imm = 0xFFFFFFFE00000000
xorl %edx, %edx
movl $0x1, %ecx
callq 0x4ddb
leaq 0x2f0(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
movl $0x7, %edx
leaq 0x5879(%rip), %rcx      # 0x72d3
movq %r15, %r8
xorl %eax, %eax
callq 0x373c
movq %r14, %rdi
movq %r14, %r15
movl $0x5, %esi
movl $0x8, %edx
leaq 0x5870(%rip), %rcx      # 0x72eb
leaq 0xe0(%rsp), %r8
movl $0x2, %r9d
xorl %eax, %eax
callq 0x373c
movslq 0xadf1(%rip), %rax      # 0xc888
leal 0x7(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x8, %ecx
leaq (,%rax,8), %rdx
subq %rax, %rdx
leal 0x1(%rax), %esi
subl %ecx, %eax
cltq
leaq (,%rax,8), %rcx
subq %rax, %rcx
movb $0x2e, %al
leaq 0xadc8(%rip), %rdi      # 0xc890
movb %al, (%rcx,%rdi)
leaq (%rdi,%rcx), %r8
movb %r12b, 0x1(%rdx,%rdi)
movl %esi, 0xadae(%rip)      # 0xc888
movq %r14, %rdi
movl $0x5, %esi
movl $0x9, %edx
leaq 0x5823(%rip), %rcx      # 0x7311
xorl %eax, %eax
callq 0x373c
leaq 0x3f10(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
movl $0x64, %edx
xorl %ecx, %ecx
callq 0x4ddb
movl $0x5, %esi
leaq 0xe0(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
callq 0x4ddb
movq %r15, %rdi
movl $0x1, %esi
movl $0xa, %edx
leaq 0x57ee(%rip), %rcx      # 0x732c
movq %r14, %r8
xorl %eax, %eax
callq 0x373c
movq %r15, %rdi
movq %r15, %r14
movl $0x5, %esi
movl $0xb, %edx
leaq 0x5710(%rip), %rcx      # 0x726f
leaq 0xe0(%rsp), %r8
xorl %eax, %eax
callq 0x373c
movslq 0xad13(%rip), %rax      # 0xc888
leal 0x7(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x8, %ecx
leaq (,%rax,8), %rdx
subq %rax, %rdx
leal 0x1(%rax), %esi
subl %ecx, %eax
cltq
leaq (,%rax,8), %rcx
subq %rax, %rcx
movw $0x88e2, %ax            # imm = 0x88E2
leaq 0xace8(%rip), %r15      # 0xc890
movw %ax, (%rcx,%r15)
movb $-0x57, %al
movb %al, 0x2(%rcx,%r15)
leaq (%r15,%rcx), %r8
movb %r12b, 0x3(%rdx,%r15)
movl %esi, 0xacc5(%rip)      # 0xc888
movq %r14, %rdi
movl $0x5, %esi
movl $0xc, %edx
leaq 0x576b(%rip), %rcx      # 0x7342
xorl %eax, %eax
callq 0x373c
leaq 0x3f10(%rsp), %rdi
xorl %esi, %esi
movl $0x1e, %edx
xorl %ecx, %ecx
callq 0x4ddb
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
leaq 0x2(%rax), %rsi
leaq 0xe0(%rsp), %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x4ddb
movq %r14, %rdi
movl $0x1, %esi
movl $0xd, %edx
leaq 0x572e(%rip), %rcx      # 0x7358
leaq 0x3f10(%rsp), %r8
xorl %eax, %eax
callq 0x373c
movq %r14, %rdi
movl $0x5, %esi
movl $0xe, %edx
leaq 0x5723(%rip), %rcx      # 0x7370
leaq 0xe0(%rsp), %r8
movl $0xc8, %r9d
xorl %eax, %eax
callq 0x373c
movslq 0xac1f(%rip), %rax      # 0xc888
leal 0x7(%rax), %ecx
testq %rax, %rax
cmovnsl %eax, %ecx
andl $-0x8, %ecx
movl %eax, %edx
subl %ecx, %edx
movslq %edx, %rcx
leaq (,%rcx,8), %rdx
subq %rcx, %rdx
leaq (%r15,%rdx), %r8
movb $0x2e, %cl
movb %cl, (%rdx,%r15)
leaq (,%rax,8), %rcx
subq %rax, %rcx
movb %r12b, 0x1(%rcx,%r15)
leal 0x1(%rax), %edx
movl %edx, 0xabde(%rip)      # 0xc888
leal 0x8(%rax), %esi
testl %edx, %edx
cmovnsl %edx, %esi
andl $-0x8, %esi
negl %esi
leal (%rax,%rsi), %edx
incl %edx
movslq %edx, %rdx
leaq (,%rdx,8), %rsi
subq %rdx, %rsi
leaq (%r15,%rsi), %r9
movw $0x99e2, %dx            # imm = 0x99E2
movw %dx, (%rsi,%r15)
movb $-0x5d, %dl
movb %dl, 0x2(%rsi,%r15)
movb %r12b, 0xa(%rcx,%r15)
leal 0x2(%rax), %edx
movl %edx, 0xab9c(%rip)      # 0xc888
leal 0x9(%rax), %esi
testl %edx, %edx
cmovnsl %edx, %esi
andl $-0x8, %esi
negl %esi
leal (%rax,%rsi), %edx
addl $0x2, %edx
movslq %edx, %rdx
leaq (,%rdx,8), %rsi
subq %rdx, %rsi
leaq (%r15,%rsi), %r10
movw $0x88e2, %dx            # imm = 0x88E2
movw %dx, (%rsi,%r15)
movb $-0x57, %dl
movb %dl, 0x2(%rsi,%r15)
movb %r12b, 0x11(%rcx,%r15)
addl $0x3, %eax
movl %eax, 0xab59(%rip)      # 0xc888
subq $0x8, %rsp
movq %r14, %rdi
movl $0x5, %esi
movl $0xf, %edx
leaq 0x5649(%rip), %rcx      # 0x7390
xorl %eax, %eax
pushq %r10
callq 0x373c
addq $0x10, %rsp
movl $0x1, %esi
leaq 0x3f10(%rsp), %r15
movq %r15, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x4ddb
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0xe0(%rsp), %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x4ddb
movq %r14, %rdi
movl $0x1, %esi
movl $0x10, %edx
leaq 0x5629(%rip), %rcx      # 0x73c3
movq %r15, %r8
xorl %eax, %eax
callq 0x373c
movq %r14, %rdi
movl $0x5, %esi
movl $0x11, %edx
leaq 0x5621(%rip), %rcx      # 0x73d9
leaq 0xe0(%rsp), %r8
xorl %eax, %eax
callq 0x373c
movq %r14, %rdi
movl $0x5, %esi
movl $0x12, %edx
leaq 0x562c(%rip), %rcx      # 0x7407
xorl %eax, %eax
callq 0x373c
leaq 0xb748(%rsp), %r14
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2ea3
cmpl $0x1b, %eax
je 0x1e32
movl %eax, %r15d
cmpl $0x51, %eax
je 0x1e32
cmpl $0x71, %r15d
je 0x1e32
movl $0x7, %edx
leaq 0x560a(%rip), %rdi      # 0x741e
movl %r15d, %esi
callq 0x1140
testq %rax, %rax
je 0x1e2c
movl %r15d, %edi
callq 0x1050
movl %eax, %r12d
testw %r12w, %r12w
je 0x1dea
cmpw $0x52, %r12w
movl $0x2b, %eax
cmovel %eax, %r12d
callq 0x341f
testw %r12w, %r12w
je 0x2864
movzwl %r12w, %r15d
movl %r15d, %edi
callq 0x4c2c
movq %rax, %rcx
shrq $0x20, %rcx
je 0x1e73
movsd 0x28(%rbx), %xmm0
cvtsi2sd %ecx, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1ea7
testl %edx, %edx
je 0x1e89
movsd 0x20(%rbx), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
ucomisd %xmm1, %xmm0
jb 0x1ea7
testl %eax, %eax
je 0x2603
movsd 0x18(%rbx), %xmm0
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
ucomisd %xmm1, %xmm0
jae 0x2603
leaq 0x536c(%rip), %rsi      # 0x721a
xorl %eax, %eax
callq 0x2f08
leaq 0x2f0(%rsp), %r12
jmp 0x17d2
movl 0x10(%rbx), %eax
cmpl $0x1e5f, %eax           # imm = 0x1E5F
jg 0x2864
addl %eax, %eax
leal (%rax,%rax,2), %eax
movl %eax, 0x10(%rbx)
jmp 0x2864
movq %rbx, %rdi
movq %rbp, %rsi
leaq 0x8266(%rip), %rdx      # 0xa150
movl $0x14, %ecx
callq 0x2c37
jmp 0x2864
movl $0x1, %edi
callq 0x2bb3
xorb $0x1, %al
jmp 0x2867
leaq 0x3f10(%rsp), %r14
movq %r14, %rdi
movl $0x1d, %esi
movl $0x13, %edx
callq 0x345f
movq %r14, %rdi
movl $0x7, %esi
callq 0x3b2b
xorl %r15d, %r15d
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
leaq 0x5506(%rip), %rcx      # 0x744e
xorl %eax, %eax
callq 0x373c
movq %r14, %rdi
callq 0x33e8
addl $-0x61, %r15d
cmpl $0x10, %r15d
jb 0x27de
movl $0x2d4, %r14d           # imm = 0x2D4
movl $0x41, %r15d
cmpl $0x0, (%rbx,%r14)
je 0x1f97
movl -0x4(%rbx,%r14), %edx
testl %edx, %edx
js 0x1fb5
addl $0x41, %edx
movq %r12, %rdi
leaq 0x54f1(%rip), %rsi      # 0x747f
xorl %eax, %eax
callq 0x1230
jmp 0x1fce
movabsq $0x7974706d457b6b4b, %rax # imm = 0x7974706D457B6B4B
movq %rax, 0x2f0(%rsp)
movw $0x7d, 0x2f8(%rsp)
jmp 0x1fce
movupd 0x54b1(%rip), %xmm0     # 0x746e
movapd %xmm0, 0x2f0(%rsp)
movb $0x0, 0x300(%rsp)
leal -0x3f(%r15), %edx
movl (%rbx,%r14), %r9d
subq $0x8, %rsp
leaq 0x3f18(%rsp), %rdi
movl $0x1, %esi
leaq 0x54a5(%rip), %rcx      # 0x7493
movl %r15d, %r8d
xorl %eax, %eax
pushq %r12
callq 0x373c
addq $0x10, %rsp
addq $0x10, %r14
incl %r15d
cmpq $0x3d4, %r14            # imm = 0x3D4
jne 0x1f71
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2ea3
cmpl $0x1b, %eax
je 0x2857
movl %eax, %r15d
cmpl $0x51, %eax
je 0x2857
cmpl $0x71, %r15d
jne 0x1f57
jmp 0x2857
xorl %edi, %edi
callq 0x2bb3
xorb $0x1, %al
jne 0x2867
movq $0x0, 0xa825(%rip) # 0xc880
jmp 0x2867
leaq 0x3f10(%rsp), %r14
movq %r14, %rdi
movl $0x32, %esi
movl $0x16, %edx
callq 0x345f
movq %r14, %rdi
callq 0x33e8
xorl %r15d, %r15d
movl $0x0, 0x4(%rsp)
xorl %r12d, %r12d
leaq 0x3f10(%rsp), %r14
movq %r14, %rdi
movl $0x10007, %esi          # imm = 0x10007
movl $0x20, %edx
callq 0x34a0
movq %r14, %rdi
movl $0x7, %esi
callq 0x3b2b
movq %r14, %rdi
movl $0x1, %esi
movl $0x1, %edx
leaq 0x53ee(%rip), %rcx      # 0x74b9
xorl %eax, %eax
callq 0x373c
cmpl $0x3c, %r15d
jg 0x20f8
cmpl $0x2c, %r15d
movq 0x28(%rsp), %r14
jg 0x213a
cmpl $0xd, %r15d
je 0x2208
cmpl $0x2b, %r15d
je 0x216f
jmp 0x21fe
cmpl $0x140, %r15d           # imm = 0x140
movq 0x28(%rsp), %r14
jg 0x21d3
cmpl $0x3d, %r15d
je 0x216f
cmpl $0x3e, %r15d
jne 0x21fe
cmpl $0x5, %r12d
movl 0x4(%rsp), %r15d
jg 0x242b
movl %r12d, %eax
incl %eax
leal (%rax,%rax,8), %ecx
leal (%r12,%rcx,2), %r15d
incl %r15d
jmp 0x2167
cmpl $0x2d, %r15d
je 0x216f
cmpl $0x3c, %r15d
jne 0x21fe
testl %r12d, %r12d
movl 0x4(%rsp), %r15d
jle 0x242b
movl %r12d, %eax
decl %eax
leal (%rax,%rax,8), %ecx
leal (%r12,%rcx,2), %r15d
decl %r15d
movl %eax, %r12d
jmp 0x242b
movslq 0x4(%rsp), %rax
imulq $0x34, %rax, %rax
cmpb $0x1, (%r14,%rax)
jne 0x21fe
addq %r14, %rax
movl 0x30(%rax), %ecx
xorl %edx, %edx
cmpl $0x2d, %r15d
setne %dl
leal (%rcx,%rdx,2), %esi
cmpl $0x10, %esi
ja 0x21fe
testl %ecx, %ecx
movl 0x4(%rsp), %r15d
js 0x21af
movq %rcx, %rsi
shlq $0x4, %rsi
movq 0x20(%rsp), %rdi
decl 0xc(%rdi,%rsi)
leal (%rcx,%rdx,2), %ecx
decl %ecx
movl %ecx, 0x30(%rax)
testl %ecx, %ecx
js 0x242b
movl %ecx, %eax
shlq $0x4, %rax
movq 0x20(%rsp), %rcx
incl 0xc(%rcx,%rax)
jmp 0x242b
cmpl $0x142, %r15d           # imm = 0x142
je 0x2410
cmpl $0x141, %r15d           # imm = 0x141
jne 0x21fe
xorl %eax, %eax
movl 0x4(%rsp), %r15d
testl %r15d, %r15d
setg %al
subl %eax, %r15d
jmp 0x242b
movl 0x4(%rsp), %r15d
jmp 0x242b
movl 0x4(%rsp), %r15d
movslq %r15d, %rax
imulq $0x34, %rax, %rax
cmpb $0x0, (%r14,%rax)
jne 0x242b
cmpl 0x3c8(%rbx), %r15d
jge 0x242b
movq %rax, 0x10(%rsp)
movq %r12, 0x30(%rsp)
leaq 0x2f0(%rsp), %r14
movq %r14, %rdi
movl $0x2e, %esi
movl $0xe, %edx
callq 0x345f
movq %r14, %rdi
callq 0x33e8
movq %r14, %rdi
movl $0x10007, %esi          # imm = 0x10007
movl $0x20, %edx
callq 0x34a0
movq %r14, %rdi
movl $0x10003, %esi          # imm = 0x10003
callq 0x3b2b
movq %r14, %rdi
movl $0x10, %esi
movl $0x1, %edx
leaq 0x528e(%rip), %rcx      # 0x7519
xorl %eax, %eax
callq 0x373c
movq %r14, %rdi
movl $0x1, %esi
movl $0x2, %edx
leaq 0x5285(%rip), %rcx      # 0x752b
xorl %eax, %eax
callq 0x373c
movl $0x41, %r15d
xorl %r14d, %r14d
leaq 0x8c(%rsp), %rdi
callq 0x4714
movl 0xbc(%rsp), %eax
movl %eax, 0x110(%rsp,%r14)
movupd 0x8c(%rsp), %xmm0
movupd 0x9c(%rsp), %xmm1
movups 0xac(%rsp), %xmm2
movups %xmm2, 0x100(%rsp,%r14)
movupd %xmm1, 0xf0(%rsp,%r14)
movupd %xmm0, 0xe0(%rsp,%r14)
movapd %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movapd %xmm0, 0x50(%rsp)
movl %eax, 0x80(%rsp)
leal -0x3e(%r15), %edx
movl 0x68(%rsp), %eax
movq %rax, 0x8(%rsp)
movl 0x70(%rsp), %r11d
movl 0x74(%rsp), %r12d
movl 0x78(%rsp), %r13d
movl 0x7c(%rsp), %r10d
subq $0x8, %rsp
leaq 0x2f8(%rsp), %rdi
movl $0x1, %esi
leaq 0x5201(%rip), %rcx      # 0x755b
movl %r15d, %r8d
leaq 0x59(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq %r13
pushq %r12
pushq %r11
pushq 0x30(%rsp)
callq 0x373c
addq $0x30, %rsp
addq $0x34, %r14
incl %r15d
cmpq $0x208, %r14            # imm = 0x208
jne 0x22b6
movq 0x28(%rsp), %r14
leaq 0x4c6b(%rip), %r13      # 0x7004
movq 0x30(%rsp), %r12
movl 0x4(%rsp), %r15d
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2ea3
cmpl $0x1b, %eax
je 0x2409
cmpl $0x51, %eax
je 0x2409
cmpl $0x71, %eax
je 0x2409
addl $-0x61, %eax
cmpl $0x9, %eax
ja 0x23a3
movl %eax, %eax
imulq $0x34, %rax, %rax
movl 0x110(%rsp,%rax), %ecx
movq 0x10(%rsp), %rdx
movl %ecx, 0x30(%r14,%rdx)
movupd 0xe0(%rsp,%rax), %xmm0
movupd 0xf0(%rsp,%rax), %xmm1
movups 0x100(%rsp,%rax), %xmm2
movups %xmm2, 0x20(%r14,%rdx)
movupd %xmm1, 0x10(%r14,%rdx)
movupd %xmm0, (%r14,%rdx)
callq 0x341f
jmp 0x242b
leal (%r12,%r12,8), %eax
leal (%r12,%rax,2), %eax
addl $0x12, %eax
xorl %ecx, %ecx
movl 0x4(%rsp), %r15d
cmpl %eax, %r15d
setl %cl
addl %ecx, %r15d
leal 0x1(%r12), %r8d
leaq 0x3f10(%rsp), %rdi
movl $0x1, %esi
movl $0x15, %edx
leaq 0x50a4(%rip), %rcx      # 0x74ed
xorl %eax, %eax
callq 0x373c
leal (%r12,%r12,8), %eax
movq %r12, 0x30(%rsp)
leal (%r12,%rax,2), %eax
movslq %eax, %rcx
movl %r15d, 0x4(%rsp)
movslq %r15d, %rax
cmpl $0x82, %ecx
movl $0x81, %edx
cmovgel %ecx, %edx
subl %ecx, %edx
movq %rdx, 0x8(%rsp)
movq %rcx, %rdx
subq %rax, %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, 0x48(%rsp)
imulq $0x34, %rcx, %r12
addq %r14, %r12
xorl %r14d, %r14d
cmpq %r14, 0x8(%rsp)
je 0x25ca
movq 0x10(%rsp), %rax
movups 0x5171(%rip), %xmm0     # 0x761f
movups %xmm0, 0x30f(%rsp)
movaps 0x5153(%rip), %xmm0     # 0x7610
movaps %xmm0, 0x300(%rsp)
movapd 0x5133(%rip), %xmm0     # 0x7600
movapd %xmm0, 0x2f0(%rsp)
addq %r14, %rax
jne 0x24f3
movb $0x72, 0x2f1(%rsp)
movb $0x2d, 0x2fd(%rsp)
movb $0x2b, 0x309(%rsp)
cmpb $0x0, (%r12)
jne 0x2547
movq 0x48(%rsp), %rcx
leaq (%rcx,%r14), %rdx
movb $0x4b, 0x2f0(%rsp)
movb $0x0, 0x2f9(%rsp)
movslq 0x3c8(%rbx), %rsi
leaq 0x1(%r12), %rcx
cmpq %rsi, %rdx
jge 0x2544
movupd 0x4fd9(%rip), %xmm0     # 0x7505
movupd %xmm0, (%rcx)
movl $0x296572, 0x10(%rcx)   # imm = 0x296572
testq %rax, %rax
jne 0x2547
movb $0x72, 0x3(%r12)
jmp 0x2547
movb $0x0, (%rcx)
leaq 0x1(%r12), %r8
movl 0x30(%r12), %eax
leal 0x41(%rax), %r9d
testl %eax, %eax
movl $0x20, %eax
cmovsl %eax, %r9d
movl 0x18(%r12), %r10d
movl 0x20(%r12), %r11d
movl 0x24(%r12), %ebp
movl 0x28(%r12), %r15d
movl 0x2c(%r12), %r13d
leal 0x2(%r14), %edx
subq $0x8, %rsp
leaq 0x3f18(%rsp), %rdi
movl $0x1, %esi
leaq 0x2f8(%rsp), %rcx
xorl %eax, %eax
pushq %r13
pushq %r15
pushq %rbp
pushq %r11
pushq %r10
callq 0x373c
addq $0x30, %rsp
incq %r14
addq $0x34, %r12
cmpq $0x13, %r14
leaq 0x7b30(%rsp), %rbp
leaq 0x4a40(%rip), %r13      # 0x7004
jne 0x2497
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2ea3
cmpl $0x1b, %eax
leaq 0xb748(%rsp), %r14
movq 0x30(%rsp), %r12
je 0x25f9
movl %eax, %r15d
cmpl $0x71, %eax
je 0x25f9
cmpl $0x51, %r15d
jne 0x2090
callq 0x341f
jmp 0x2864
movl %r15d, 0x10(%rsp)
movl $0xc, %r12d
movl $0x1e, %r13d
leaq 0x2f0(%rsp), %r15
movq %r15, %rdi
leaq 0x4dff(%rip), %rsi      # 0x7425
callq 0x3050
xorl %ebp, %ebp
movq %r15, %rdi
movl $0x6, %esi
movl $0xc, %edx
leaq 0x4df8(%rip), %rcx      # 0x7439
xorl %eax, %eax
callq 0x373c
leaq 0x3f10(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x3c, %ecx
movl $0x18, %r8d
callq 0x3166
leaq 0x7b30(%rsp), %r14
movq %r14, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x3b07
movzwl %ax, %r8d
leaq 0x3f10(%rsp), %rdi
movl %r13d, 0x8(%rsp)
movl %r13d, %esi
movl %r12d, %edx
movl $0x10107, %ecx          # imm = 0x10107
callq 0x31f4
leaq 0x3f10(%rsp), %rdi
callq 0x33e8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2ea3
cmpl $0x1b, %eax
je 0x2788
movl %eax, %r15d
cmpl $0x51, %eax
je 0x2788
cmpl $0x71, %r15d
je 0x2788
leaq 0x3f10(%rsp), %rdi
movl 0x8(%rsp), %r13d
movl %r13d, %esi
movl %r12d, %edx
callq 0x3aae
leal -0x131(%r15), %eax
cmpl $0x13, %eax
ja 0x2718
leaq 0x492b(%rip), %rcx      # 0x7028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
decl %r13d
jmp 0x272a
incl %r13d
jmp 0x2720
incl %r13d
jmp 0x2718
decl %r13d
movl %r12d, %eax
jmp 0x272f
decl %r13d
movl %r12d, %eax
incl %eax
jmp 0x272f
incl %r13d
movl %r12d, %eax
decl %eax
leaq 0x7b30(%rsp), %r14
movq %r14, %rdi
movl %r13d, %esi
movl %r13d, %r12d
movl %eax, %r13d
movl %eax, %edx
callq 0x3b07
movzwl %ax, %r8d
leaq 0x3f10(%rsp), %rdi
movl %r12d, 0x8(%rsp)
movl %r12d, %esi
movl %r13d, %r12d
movl %r13d, %edx
movl $0x10107, %ecx          # imm = 0x10107
callq 0x31f4
cmpl $0xd, %r15d
movzbl %bpl, %ebp
movl $0x1, %eax
cmovel %eax, %ebp
testb $0x1, %bpl
je 0x26a8
callq 0x341f
callq 0x341f
testb $0x1, %bpl
je 0x2871
movq %rbx, %rdi
movl 0x10(%rsp), %esi
movl 0x8(%rsp), %r13d
movl %r13d, %edx
movl %r12d, %ecx
callq 0x4981
testb %al, %al
leaq 0x2f0(%rsp), %r15
leaq 0xb748(%rsp), %r14
jne 0x288d
leaq 0x4a66(%rip), %rsi      # 0x7238
xorl %eax, %eax
callq 0x2f08
jmp 0x261c
callq 0x33fe
movq %r12, %rdi
leaq 0x4cba(%rip), %rsi      # 0x74a7
callq 0x3050
xorl %eax, %eax
addl $-0x61, %eax
movl %eax, %r14d
cmpl $0x10, %eax
jb 0x2834
movq %rbx, %rdi
leaq 0xf360(%rsp), %rsi
movl $0x1, %edx
callq 0x578a
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x2ea3
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl $0x1b, %eax
je 0x2834
cmpl $0x71, %eax
je 0x2834
cmpl $0x51, %eax
jne 0x27f4
callq 0x341f
movl %r15d, %eax
shlq $0x4, %rax
movq 0x20(%rsp), %rcx
movl %r14d, 0x8(%rcx,%rax)
leaq 0x3f10(%rsp), %rdi
callq 0x33e8
callq 0x341f
leaq 0xb748(%rsp), %r14
movl (%rsp), %eax
testb $0x1, %al
jne 0x156b
jmp 0x28a1
leaq 0x478c(%rip), %r13      # 0x7004
movl (%rsp), %eax
leaq 0x7b30(%rsp), %rbp
leaq 0xb748(%rsp), %r14
jmp 0x2867
leaq 0x4770(%rip), %r13      # 0x7004
movl (%rsp), %eax
leaq 0x7b30(%rsp), %rbp
jmp 0x2867
callq 0x295e
movq $0x0, 0x9fcf(%rip) # 0xc880
movq %rbx, %rdi
callq 0x496b
callq 0x33fe
callq 0x33fe
callq 0x33fe
callq 0x33fe
leaq 0xf360(%rsp), %rdi
callq 0x33bd
leaq 0x12f78(%rsp), %rdi
callq 0x33bd
leaq 0x7b30(%rsp), %rdi
callq 0x33bd
leaq 0xb748(%rsp), %rdi
callq 0x33bd
callq 0x3351
xorl %eax, %eax
addq $0x1a7a8, %rsp          # imm = 0x1A7A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3351
movl 0x3c(%rsp), %ecx
movl 0x1c(%rsp), %r8d
leaq 0x4749(%rip), %rdi      # 0x7078
movl $0x50, %esi
movl $0x18, %edx
xorl %eax, %eax
callq 0x10c0
movq 0x7699(%rip), %rax      # 0x9fe0
movq (%rax), %rdi
callq 0x11d0
callq 0x1170
movl $0x1, %edi
callq 0x1240