// File: /workspace/github_c_makefile_star2_O0/Ziddykins[P]Dawn/src/items.c
// Function: generate_drop
void generate_drop(struct Message *message) {
    char out[MAX_MESSAGE_BUFFER];
    const char *rarity[]  = {NULL, "Common ", "Uncommon ", "Rare ", "Mythical ", "Epic ", "Legendary ", "Godly ", "Forsaken "};
    const char *weapons[] = {"Sword", "Mace", "Scimitar", "Axe", "Club", "Staff", "Wand", "Pike", "Polearm", "Lance", "Spear", "Floppy Dildo"};
    const char *shields[] = {"Tower Shield", "Round Shield", "Small Shield", "Large Shield", "Medium Shield"};
    const char *armor[]   = {"Leather Armor", "Breastplate Armor", "Fullplate Armor", "Chainmail Armor", "Cloth Armor"};
    char item_name[200];
    item_name[0] = '\0';

    float rarity_chance = rand()/(RAND_MAX/100.0f);
    int type_chance     = rand()%MAX_ITEM_TYPE;
    int p_index = get_pindex(message->sender_nick);
    int drop_level = dawn->global_monster.drop_level;
    int str, def, intel, mdef, hp;
    str = def = intel = mdef = hp = 0;

    if (dawn->players[p_index].available_slots == 0) {
        sprintf(out, "PRIVMSG %s :%s has found an item, but has no more room in his inventory!\r\n",
                message->receiver, message->sender_nick);
        add_msg(out, strlen(out));
        return;
    }

    struct Inventory item_dropped;
    item_dropped.type = type_chance;

    if (rarity_chance <= COMMON) {
        item_dropped.rarity = 1;
    } else if (rarity_chance <= UNCOMMON) {
        strcat(item_name, IRC_CYAN);
        item_dropped.rarity = 2;
    } else if (rarity_chance <= RARE) {
        strcat(item_name, IRC_ORANGE);
        item_dropped.rarity = 3;
    } else if (rarity_chance <= MYTHICAL) {
        strcat(item_name, IRC_PURPLE);
        item_dropped.rarity = 4;
    } else if (rarity_chance <= EPIC) {
        strcat(item_name, IRC_DBLUE);
        item_dropped.rarity = 5;
    } else if (rarity_chance <= LEGENDARY) {
        strcat(item_name, IRC_BROWN);
        item_dropped.rarity = 6;
    } else if (rarity_chance <= GODLY) {
        strcat(item_name, IRC_BOLD);
        strcat(item_name, IRC_PINK);
        item_dropped.rarity = 7;
    } else if (rarity_chance <= FORSAKEN) {
        strcat(item_name, IRC_BOLD);
        strcat(item_name, IRC_UNDRL);
        strcat(item_name, IRC_RED);
        item_dropped.rarity = 8;
    } else {
        enum material {WOOD, LEATHER, STONE, ORE, BRONZE, MAIL, STEEL, DIAMOND};
        char *mat_types[] = {"wood", "leather", "stone", "ore", "bronze", "mail", "steel", "diamond"};
        char plural[7], mat_name[10];
        int type, amount;

        if (drop_level < 4)       type = rand() % 2;
        else if (drop_level < 6)  type = rand() % 3;
        else if (drop_level < 8)  type = rand() % 4;
        else if (drop_level < 10) type = rand() % 6;
        else if (drop_level < 11) type = rand() % 7;
        else                      type = rand() % MAX_MATERIAL_TYPE;

        amount = 1 + rand() % 4;
        amount > 1 ? strcpy(plural, "scraps") : strcpy(plural, "scrap");
        strcpy(mat_name, mat_types[type]);
        dawn->players[p_index].materials[type] += amount;
/*
        switch (type) {
            case WOOD:    dawn->players[p_index].wood    += amount; break;
            case LEATHER: dawn->players[p_index].leather += amount; break;
            case STONE:   dawn->players[p_index].stone   += amount; break;
            case ORE:     dawn->players[p_index].ore     += amount; break;
            case BRONZE:  dawn->players[p_index].bronze  += amount; break;
            case MAIL:    dawn->players[p_index].mail    += amount; break;
            case STEEL:   dawn->players[p_index].steel   += amount; break;
            case DIAMOND: dawn->players[p_index].diamond += amount; break;
        }
*/
        sprintf(out, "PRIVMSG %s :%s finds %d %s %s\r\n",
                message->receiver, message->sender_nick, amount, mat_name, plural);
        add_msg(out, strlen(out));

        return;
    }

    strcat(item_name, rarity[item_dropped.rarity]);

    switch (type_chance) {
        case 0:
        {
            char weapon_type[48];
            str = 1 + rand() % ((drop_level * dawn->players[p_index].level) * 2 * item_dropped.rarity);
            intel = 1 + rand() % ((drop_level * dawn->players[p_index].level) * 2 * item_dropped.rarity);
            def   = 1 + rand() % str;
            mdef  = 1 + rand() % str;
            strcpy(weapon_type, weapons[rand()%MAX_WEAPON_TYPE]);
            strcat(item_name, weapon_type);
            break;
        }
        case 1:
        {
            char shield_type[48];
            def = 1 + rand() % ((drop_level * dawn->players[p_index].level) * 2 * item_dropped.rarity);
            intel = 1 + rand() % def;
            str   = 1 + rand() % def;
            mdef = 1 + rand() % ((drop_level * dawn->players[p_index].level) * 2 * item_dropped.rarity);
            strcpy(shield_type, shields[rand()%MAX_SHIELD_TYPE]);
            strcat(item_name, shield_type);
            break;
        }
        case 2:
        {
            char armor_type[48];
            def = 1 + rand() % ((drop_level * dawn->players[p_index].level) * 2 * item_dropped.rarity);
            intel = 1 + rand() % def;
            str   = 1 + rand() % def;
            mdef = 1 + rand() % ((drop_level * dawn->players[p_index].level) * 2 * item_dropped.rarity);
            strcpy(armor_type, armor[rand()%MAX_ARMOR_TYPE]);
            strcat(item_name, armor_type);
            break;
        }
        default:
            PRINTERR("ITEM ERROR")
    }

    if (item_dropped.rarity >= 3) {
        hp = 1 + rand() % ((drop_level * dawn->players[p_index].level) * 2 * item_dropped.rarity);
    }

        
    strcat(item_name, IRC_NORMAL);
    //strcpy(item_name, item_name); programming drunk. not even once.
    size_t len = strlen(item_name);
    item_name[len+1] = '\0';

    strcpy(item_dropped.name, item_name);

    item_dropped.attr_strength     = str;
    item_dropped.attr_defense      = def;
    item_dropped.attr_intelligence = intel;
    item_dropped.attr_mdef         = mdef;
    item_dropped.attr_health = hp;
    item_dropped.req_level = 1;
    item_dropped.weight = 5;
    item_dropped.socket_one = 0;
    item_dropped.socket_two = 0;
    item_dropped.socket_three = 0;
    item_dropped.attr_mana = 0;

    //see inventory.h
    item_dropped.bitfield &= ~(1 << RUSTED);     //Not rusted
    item_dropped.bitfield &= ~(1 << EQUIPPED);   //Not equipped
    item_dropped.bitfield |=  (1 << EQUIPPABLE); //Equippable
    item_dropped.bitfield |=  (1 << NEW);        //New
    item_dropped.bitfield &= ~(1 << FAVORITE);  //Not favorite


    for (int i=0; i<MAX_INVENTORY_SLOTS; i++) {
        printf("%d. '%s'\n", i, dawn->players[p_index].inventory[i].name);
        if (strlen(dawn->players[p_index].inventory[i].name) < 2) {
            if (dawn->players[p_index].available_slots > 0) {
                dawn->players[p_index].inventory[i] = item_dropped;
                dawn->players[p_index].available_slots--;
                printf("%s got %s %d slots left\n", message->sender_nick, item_dropped.name, dawn->players[p_index].available_slots);
                break;
            } else {
                sprintf(out, "PRIVMSG %s :%s, you have no room in your inventory!\r\n",
                        message->receiver, message->sender_nick);
                add_msg(out, strlen(out));
                return;
            }
        } else {
            printf("wat?\n");
        }
    }

    sprintf(out, "PRIVMSG %s :%s has found a %s [S: %u - D: %u I: %u - MD: %u] on the corpse of the monster!\r\n",
            message->receiver, message->sender_nick, item_name, str, def, intel, mdef);
    add_msg(out, strlen(out));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x5a0, %rsp            # imm = 0x5A0
movq %rdi, -0x8(%rbp)
leaq -0x1f0(%rbp), %rdi
leaq 0x1b873(%rip), %rsi     # 0x25c50
movl $0x48, %edx
callq 0x2170
leaq -0x250(%rbp), %rdi
leaq 0x1b8ab(%rip), %rsi     # 0x25ca0
movl $0x60, %edx
callq 0x2170
leaq -0x280(%rbp), %rdi
leaq 0x1b8f3(%rip), %rsi     # 0x25d00
movl $0x28, %edx
callq 0x2170
leaq -0x2b0(%rbp), %rdi
leaq 0x1b90b(%rip), %rsi     # 0x25d30
movl $0x28, %edx
callq 0x2170
movb $0x0, -0x380(%rbp)
callq 0x2080
cvtsi2ss %eax, %xmm0
movss 0x12ec1(%rip), %xmm1    # 0x1d308
divss %xmm1, %xmm0
movss %xmm0, -0x384(%rbp)
callq 0x2080
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, -0x388(%rbp)
movq -0x8(%rbp), %rdi
callq 0x13ba0
movl %eax, -0x38c(%rbp)
leaq 0x1e5f4(%rip), %rax     # 0x28a70
movq (%rax), %rax
movl 0xf2e60(%rax), %eax
movl %eax, -0x390(%rbp)
movl $0x0, -0x3a4(%rbp)
movl $0x0, -0x3a0(%rbp)
movl $0x0, -0x39c(%rbp)
movl $0x0, -0x398(%rbp)
movl $0x0, -0x394(%rbp)
leaq 0x1e5ac(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x38c(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
cmpl $0x0, 0x2678(%rax)
jne 0xa539
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
movq -0x8(%rbp), %rcx
leaq 0x12f48(%rip), %rsi     # 0x1d44c
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x548(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x548(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0xb043
movl -0x388(%rbp), %eax
movl %eax, -0x3b4(%rbp)
movss 0x12dbf(%rip), %xmm0    # 0x1d30c
ucomiss -0x384(%rbp), %xmm0
jb 0xa565
movl $0x1, -0x3ac(%rbp)
jmp 0xa8e9
movss 0x12da3(%rip), %xmm0    # 0x1d310
ucomiss -0x384(%rbp), %xmm0
jb 0xa598
leaq -0x380(%rbp), %rdi
leaq 0x12f13(%rip), %rsi     # 0x1d497
callq 0x2400
movl $0x2, -0x3ac(%rbp)
jmp 0xa8e7
movss 0x12d74(%rip), %xmm0    # 0x1d314
ucomiss -0x384(%rbp), %xmm0
jb 0xa5cb
leaq -0x380(%rbp), %rdi
leaq 0x12ee4(%rip), %rsi     # 0x1d49b
callq 0x2400
movl $0x3, -0x3ac(%rbp)
jmp 0xa8e5
movss 0x12d45(%rip), %xmm0    # 0x1d318
ucomiss -0x384(%rbp), %xmm0
jb 0xa5fe
leaq -0x380(%rbp), %rdi
leaq 0x12eb5(%rip), %rsi     # 0x1d49f
callq 0x2400
movl $0x4, -0x3ac(%rbp)
jmp 0xa8e3
movss 0x12d16(%rip), %xmm0    # 0x1d31c
ucomiss -0x384(%rbp), %xmm0
jb 0xa631
leaq -0x380(%rbp), %rdi
leaq 0x12e86(%rip), %rsi     # 0x1d4a3
callq 0x2400
movl $0x5, -0x3ac(%rbp)
jmp 0xa8e1
movss 0x12ce7(%rip), %xmm0    # 0x1d320
ucomiss -0x384(%rbp), %xmm0
jb 0xa664
leaq -0x380(%rbp), %rdi
leaq 0x12e57(%rip), %rsi     # 0x1d4a7
callq 0x2400
movl $0x6, -0x3ac(%rbp)
jmp 0xa8df
movss 0x12cb8(%rip), %xmm0    # 0x1d324
ucomiss -0x384(%rbp), %xmm0
jb 0xa6aa
leaq -0x380(%rbp), %rdi
leaq 0x12e28(%rip), %rsi     # 0x1d4ab
callq 0x2400
leaq -0x380(%rbp), %rdi
leaq 0x12e17(%rip), %rsi     # 0x1d4ad
callq 0x2400
movl $0x7, -0x3ac(%rbp)
jmp 0xa8dd
movss 0x12c76(%rip), %xmm0    # 0x1d328
ucomiss -0x384(%rbp), %xmm0
jb 0xa703
leaq -0x380(%rbp), %rdi
leaq 0x12de2(%rip), %rsi     # 0x1d4ab
callq 0x2400
leaq -0x380(%rbp), %rdi
leaq 0x12dd5(%rip), %rsi     # 0x1d4b1
callq 0x2400
leaq -0x380(%rbp), %rdi
leaq 0x10641(%rip), %rsi     # 0x1ad30
callq 0x2400
movl $0x8, -0x3ac(%rbp)
jmp 0xa8db
leaq -0x480(%rbp), %rdi
leaq 0x1b64f(%rip), %rsi     # 0x25d60
movl $0x40, %edx
callq 0x2170
cmpl $0x4, -0x390(%rbp)
jge 0xa73c
callq 0x2080
movl $0x2, %ecx
cltd
idivl %ecx
movl %edx, -0x498(%rbp)
jmp 0xa7cf
cmpl $0x6, -0x390(%rbp)
jge 0xa75a
callq 0x2080
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, -0x498(%rbp)
jmp 0xa7cd
cmpl $0x8, -0x390(%rbp)
jge 0xa778
callq 0x2080
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, -0x498(%rbp)
jmp 0xa7cb
cmpl $0xa, -0x390(%rbp)
jge 0xa796
callq 0x2080
movl $0x6, %ecx
cltd
idivl %ecx
movl %edx, -0x498(%rbp)
jmp 0xa7c9
cmpl $0xb, -0x390(%rbp)
jge 0xa7b4
callq 0x2080
movl $0x7, %ecx
cltd
idivl %ecx
movl %edx, -0x498(%rbp)
jmp 0xa7c7
callq 0x2080
movl $0x8, %ecx
cltd
idivl %ecx
movl %edx, -0x498(%rbp)
jmp 0xa7c9
jmp 0xa7cb
jmp 0xa7cd
jmp 0xa7cf
callq 0x2080
movl $0x4, %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x49c(%rbp)
cmpl $0x1, -0x49c(%rbp)
jle 0xa803
leaq -0x487(%rbp), %rdi
leaq 0x12ce8(%rip), %rsi     # 0x1d4e4
callq 0x21c0
jmp 0xa816
leaq -0x487(%rbp), %rdi
leaq 0x12cda(%rip), %rsi     # 0x1d4eb
callq 0x21c0
leaq -0x491(%rbp), %rdi
movslq -0x498(%rbp), %rax
movq -0x480(%rbp,%rax,8), %rsi
callq 0x21c0
movslq -0x49c(%rbp), %rdx
leaq 0x1e231(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x38c(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movslq -0x498(%rbp), %rcx
addq 0x25f8(%rax,%rcx,8), %rdx
movq %rdx, 0x25f8(%rax,%rcx,8)
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
movq -0x8(%rbp), %rcx
movl -0x49c(%rbp), %r8d
leaq -0x491(%rbp), %r9
leaq -0x487(%rbp), %rax
leaq 0x12c4f(%rip), %rsi     # 0x1d4f1
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x550(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x550(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0xb043
jmp 0xa8dd
jmp 0xa8df
jmp 0xa8e1
jmp 0xa8e3
jmp 0xa8e5
jmp 0xa8e7
jmp 0xa8e9
movslq -0x3ac(%rbp), %rax
movq -0x1f0(%rbp,%rax,8), %rsi
leaq -0x380(%rbp), %rdi
callq 0x2400
movl -0x388(%rbp), %eax
movl %eax, -0x554(%rbp)
testl %eax, %eax
je 0xa93b
jmp 0xa916
movl -0x554(%rbp), %eax
subl $0x1, %eax
je 0xaa41
jmp 0xa927
movl -0x554(%rbp), %eax
subl $0x2, %eax
je 0xab47
jmp 0xac4a
callq 0x2080
movl -0x390(%rbp), %ecx
leaq 0x1e123(%rip), %rdx     # 0x28a70
movq (%rdx), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0x38c(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rdx
imull 0x2668(%rdx), %ecx
shll %ecx
imull -0x3ac(%rbp), %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x394(%rbp)
callq 0x2080
movl -0x390(%rbp), %ecx
leaq 0x1e0da(%rip), %rdx     # 0x28a70
movq (%rdx), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0x38c(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rdx
imull 0x2668(%rdx), %ecx
shll %ecx
imull -0x3ac(%rbp), %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x39c(%rbp)
callq 0x2080
cltd
idivl -0x394(%rbp)
addl $0x1, %edx
movl %edx, -0x398(%rbp)
callq 0x2080
cltd
idivl -0x394(%rbp)
addl $0x1, %edx
movl %edx, -0x3a0(%rbp)
leaq -0x4d0(%rbp), %rax
movq %rax, -0x560(%rbp)
callq 0x2080
movq -0x560(%rbp), %rdi
movl $0xc, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq -0x250(%rbp,%rax,8), %rsi
callq 0x21c0
leaq -0x380(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
callq 0x2400
jmp 0xac56
callq 0x2080
movl -0x390(%rbp), %ecx
leaq 0x1e01d(%rip), %rdx     # 0x28a70
movq (%rdx), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0x38c(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rdx
imull 0x2668(%rdx), %ecx
shll %ecx
imull -0x3ac(%rbp), %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x398(%rbp)
callq 0x2080
cltd
idivl -0x398(%rbp)
addl $0x1, %edx
movl %edx, -0x39c(%rbp)
callq 0x2080
cltd
idivl -0x398(%rbp)
addl $0x1, %edx
movl %edx, -0x394(%rbp)
callq 0x2080
movl -0x390(%rbp), %ecx
leaq 0x1dfaa(%rip), %rdx     # 0x28a70
movq (%rdx), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0x38c(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rdx
imull 0x2668(%rdx), %ecx
shll %ecx
imull -0x3ac(%rbp), %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x3a0(%rbp)
leaq -0x500(%rbp), %rax
movq %rax, -0x568(%rbp)
callq 0x2080
movq -0x568(%rbp), %rdi
movl $0x5, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq -0x280(%rbp,%rax,8), %rsi
callq 0x21c0
leaq -0x380(%rbp), %rdi
leaq -0x500(%rbp), %rsi
callq 0x2400
jmp 0xac56
callq 0x2080
movl -0x390(%rbp), %ecx
leaq 0x1df17(%rip), %rdx     # 0x28a70
movq (%rdx), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0x38c(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rdx
imull 0x2668(%rdx), %ecx
shll %ecx
imull -0x3ac(%rbp), %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x398(%rbp)
callq 0x2080
cltd
idivl -0x398(%rbp)
addl $0x1, %edx
movl %edx, -0x39c(%rbp)
callq 0x2080
cltd
idivl -0x398(%rbp)
addl $0x1, %edx
movl %edx, -0x394(%rbp)
callq 0x2080
movl -0x390(%rbp), %ecx
leaq 0x1dea4(%rip), %rdx     # 0x28a70
movq (%rdx), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0x38c(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rdx
imull 0x2668(%rdx), %ecx
shll %ecx
imull -0x3ac(%rbp), %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x3a0(%rbp)
leaq -0x530(%rbp), %rax
movq %rax, -0x570(%rbp)
callq 0x2080
movq -0x570(%rbp), %rdi
movl $0x5, %ecx
cltd
idivl %ecx
movslq %edx, %rax
movq -0x2b0(%rbp,%rax,8), %rsi
callq 0x21c0
leaq -0x380(%rbp), %rdi
leaq -0x530(%rbp), %rsi
callq 0x2400
jmp 0xac56
leaq 0x128c0(%rip), %rdi     # 0x1d511
callq 0x2190
cmpl $0x3, -0x3ac(%rbp)
jl 0xaca8
callq 0x2080
movl -0x390(%rbp), %ecx
leaq 0x1ddff(%rip), %rdx     # 0x28a70
movq (%rdx), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0x38c(%rbp), %rsi
imulq $0x26a8, %rsi, %rsi     # imm = 0x26A8
addq %rsi, %rdx
imull 0x2668(%rdx), %ecx
shll %ecx
imull -0x3ac(%rbp), %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0x3a4(%rbp)
leaq -0x380(%rbp), %rdi
leaq 0x1252f(%rip), %rsi     # 0x1d1e5
callq 0x2400
leaq -0x380(%rbp), %rdi
callq 0x20c0
movq %rax, -0x538(%rbp)
movq -0x538(%rbp), %rax
movb $0x0, -0x37f(%rbp,%rax)
leaq -0x440(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0x21c0
movl -0x394(%rbp), %eax
movl %eax, -0x3d0(%rbp)
movl -0x398(%rbp), %eax
movl %eax, -0x3d8(%rbp)
movl -0x39c(%rbp), %eax
movl %eax, -0x3d4(%rbp)
movl -0x3a0(%rbp), %eax
movl %eax, -0x3cc(%rbp)
movl -0x3a4(%rbp), %eax
movl %eax, -0x3dc(%rbp)
movl $0x1, -0x3c8(%rbp)
movl $0x5, -0x3c4(%rbp)
movl $0x0, -0x3c0(%rbp)
movl $0x0, -0x3bc(%rbp)
movl $0x0, -0x3b8(%rbp)
movl $0x0, -0x3b0(%rbp)
movzbl -0x3a8(%rbp), %eax
andl $-0x11, %eax
movb %al, -0x3a8(%rbp)
movzbl -0x3a8(%rbp), %eax
andl $-0x5, %eax
movb %al, -0x3a8(%rbp)
movzbl -0x3a8(%rbp), %eax
orl $0x8, %eax
movb %al, -0x3a8(%rbp)
movzbl -0x3a8(%rbp), %eax
orl $0x1, %eax
movb %al, -0x3a8(%rbp)
movzbl -0x3a8(%rbp), %eax
andl $-0x3, %eax
movb %al, -0x3a8(%rbp)
movl $0x0, -0x53c(%rbp)
cmpl $0x19, -0x53c(%rbp)
jge 0xafc7
movl -0x53c(%rbp), %esi
leaq 0x1dc94(%rip), %rax     # 0x28a70
movq (%rax), %rdx
addq $0x1a0, %rdx            # imm = 0x1A0
movslq -0x38c(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rdx
addq $0x190, %rdx            # imm = 0x190
movslq -0x53c(%rbp), %rax
imulq $0x9c, %rax, %rax
addq %rax, %rdx
leaq 0x1272a(%rip), %rdi     # 0x1d540
movb $0x0, %al
callq 0x2040
leaq 0x1dc4c(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movslq -0x38c(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rdi
addq $0x190, %rdi            # imm = 0x190
movslq -0x53c(%rbp), %rax
imulq $0x9c, %rax, %rax
addq %rax, %rdi
callq 0x20c0
cmpq $0x2, %rax
jae 0xafa3
leaq 0x1dc03(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x38c(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
cmpl $0x0, 0x2678(%rax)
jle 0xaf51
leaq 0x1dbd5(%rip), %rax     # 0x28a70
movq (%rax), %rdi
addq $0x1a0, %rdi            # imm = 0x1A0
movslq -0x38c(%rbp), %rax
imulq $0x26a8, %rax, %rax     # imm = 0x26A8
addq %rax, %rdi
addq $0x190, %rdi            # imm = 0x190
movslq -0x53c(%rbp), %rax
imulq $0x9c, %rax, %rax
addq %rax, %rdi
leaq -0x440(%rbp), %rsi
movl $0x9c, %edx
callq 0x2170
leaq 0x1db8a(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x38c(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2678(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2678(%rax)
movq -0x8(%rbp), %rsi
leaq -0x440(%rbp), %rdx
leaq 0x1db4f(%rip), %rax     # 0x28a70
movq (%rax), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movslq -0x38c(%rbp), %rcx
imulq $0x26a8, %rcx, %rcx     # imm = 0x26A8
addq %rcx, %rax
movl 0x2678(%rax), %ecx
leaq 0x12602(%rip), %rdi     # 0x1d54a
movb $0x0, %al
callq 0x2040
jmp 0xafc7
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
movq -0x8(%rbp), %rcx
leaq 0x125f5(%rip), %rsi     # 0x1d563
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x578(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x578(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
jmp 0xb043
leaq 0x125ef(%rip), %rdi     # 0x1d599
movb $0x0, %al
callq 0x2040
jmp 0xafb3
movl -0x53c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x53c(%rbp)
jmp 0xadc2
leaq -0x1a0(%rbp), %rdi
movq -0x8(%rbp), %rdx
addq $0xc0, %rdx
movq -0x8(%rbp), %rcx
leaq -0x380(%rbp), %r8
movl -0x394(%rbp), %r9d
movl -0x398(%rbp), %r11d
movl -0x39c(%rbp), %r10d
movl -0x3a0(%rbp), %eax
leaq 0x12599(%rip), %rsi     # 0x1d59f
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x2050
leaq -0x1a0(%rbp), %rax
movq %rax, -0x580(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x20c0
movq -0x580(%rbp), %rdi
movq %rax, %rsi
callq 0x12840
addq $0x5a0, %rsp            # imm = 0x5A0
popq %rbp
retq
nopl (%rax)