// File: /workspace/github_cpp_makefile_star2_O3/kaiming[P]Chamber-Crawler-3k/Board/board.cc
// Function: Board::generateFloor()
void Board::generateFloor() {
    // Begin RNG piece generation


    // Generate player
    int pChamber = std::rand() % static_cast<int>(chambers.size());
    int tile = std::rand() % static_cast<int>(chambers[pChamber].size());

    // Insert Player
    chambers[pChamber][tile]->setOccupant(playerPtr);
    player = chambers[pChamber][tile];


    // Generate exit stairs
    int chamber;

    // Ensure exit stairs are not in the same chamber as the player
    do {
        chamber = std::rand() % static_cast<int>(chambers.size());
    } while (chamber == pChamber);

    tile = std::rand() % static_cast<int>(chambers[chamber].size());

        // Insert exit stairs
    chambers[chamber][tile]->setExit(true);


    // Generate 10 Potions
    for (int i = 0; i < 10; i++) {
        // Generate type
        int type = std::rand() % 6;
        std::shared_ptr<Potion> temp;

        if (type == 0) {
            temp = std::make_shared<RH>();
        } else if (type == 1) {
            temp = std::make_shared<BA>();
        } else if (type == 2) {
            temp = std::make_shared<BD>();
        } else if (type == 3) {
            temp = std::make_shared<PH>();
        } else if (type == 4) {
            temp = std::make_shared<WA>();
        } else if (type == 5) {
            temp = std::make_shared<WD>();
        }

        // Generate location (make sure not occupied)
        do {
            chamber = std::rand() % static_cast<int>(chambers.size());
            tile = std::rand() % static_cast<int>(chambers[chamber].size());
        } while (chambers[chamber][tile]->getPotion() || chambers[chamber][tile]->isExit() || chambers[chamber][tile]->getOccupant());

        // Place type at location
        chambers[chamber][tile]->setPotion(temp);
    }


    // Generate 10 Gold
    for (int i = 0; i < 10; i++) {
        // Generate type
        int type = std::rand() % 8;
        std::shared_ptr<Gold> temp;

        if (type >= 0 && type <= 4) {
            temp = std::make_shared<Gold>("Normal Hoard", 2);
        } else if (type == 5 || type == 6) {
            temp = std::make_shared<Gold>("Small Hoard", 1);
        } else if (type == 7) {
            temp = std::make_shared<DragonHoard>();
        }

        // Generate location (make sure not occupied)
        do {
            chamber = std::rand() % static_cast<int>(chambers.size());
            tile = std::rand() % static_cast<int>(chambers[chamber].size());
        } while (chambers[chamber][tile]->getPotion() || chambers[chamber][tile]->getGold() || chambers[chamber][tile]->isExit() || chambers[chamber][tile]->getOccupant()); // DLC EXTENSION HERE: if gold can stack, remove second if clause
        

        // Place type at location
        chambers[chamber][tile]->setGold(temp);

        // If dragonHoard type, place Dragon around it
        if (type == 7) {
            // Add to dragonHoards
            dragonHoards[floorNum-1].emplace_back(std::dynamic_pointer_cast<WalkableTile>(chambers[chamber][tile])); 

            // Allocate dragon spawn destination
            std::shared_ptr<WalkableTile> destination = nullptr;

            // Generate direction around DragonHoard
            std::vector<std::string> directions;
            directions.push_back("no");
            directions.push_back("ea");
            directions.push_back("so");
            directions.push_back("we");
            directions.push_back("ne");
            directions.push_back("nw");
            directions.push_back("se");
            directions.push_back("sw");
            int i = 0;

            do {
                // Exit case in event that no suitable location found
                if (i > 80) {
                    break;
                } else {
                    i++;
                }
                
                int rng = std::rand() % 8;

                destination = validDest(chambers[chamber][tile], directions[rng]);

            } while (!destination || !isUnoccupied(destination)); 


            // Place dragon at location and store in DragonHoard
            destination->setOccupant(std::dynamic_pointer_cast<DragonHoard>(temp)->getDragon());
            std::dynamic_pointer_cast<DragonHoard>(temp)->setDragonTile(destination);
        }
    }


    // Generate 20 Enemies
    for (int i = 0; i < 20; i++) {
        // Generate type
        int type = std::rand() % 18;
        std::shared_ptr<Enemy> temp;

        if (type >= 0 && type <= 3) {
            temp = std::make_shared<Human>();
        } else if (type >= 4 && type <= 6) {
            temp = std::make_shared<Dwarf>();
        } else if (type >= 7 && type <= 11) {
            temp = std::make_shared<Halfling>();
        } else if (type >= 12 && type <= 13) {
            temp = std::make_shared<Elf>();
        } else if (type >= 14 && type <= 15) {
            temp = std::make_shared<Orc>();
        } else if (type >= 16 && type <= 17) {
            temp = std::make_shared<Merchant>();
        }

        // Generate location (make sure not occupied)
        do {
            chamber = std::rand() % static_cast<int>(chambers.size());
            tile = std::rand() % static_cast<int>(chambers[chamber].size());
        } while (chambers[chamber][tile]->getPotion() || chambers[chamber][tile]->getGold() || chambers[chamber][tile]->getOccupant() || chambers[chamber][tile]->isExit());

        // Place type at location
        chambers[chamber][tile]->setOccupant(temp);
        enemies[floorNum-1].emplace_back(chambers[chamber][tile]);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
callq 0x5080
movq 0xe8(%rbx), %rcx
subq 0xe0(%rbx), %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
cltd
idivl %ecx
movl %edx, %ebp
callq 0x5080
movslq %ebp, %rcx
leaq (%rcx,%rcx,2), %r14
movq 0xe0(%rbx), %rcx
movq 0xf8(%rbx), %rsi
movq (%rcx,%r14,8), %rdi
movq 0x8(%rcx,%r14,8), %rcx
subq %rdi, %rcx
shrq $0x4, %rcx
cltd
idivl %ecx
movslq %edx, %r15
shlq $0x4, %r15
movq (%rdi,%r15), %rdi
movq %rsi, 0xc0(%rsp)
movq 0x100(%rbx), %rax
movq %rax, 0xc8(%rsp)
testq %rax, %rax
je 0xd81d
movq 0x177b1(%rip), %rcx     # 0x24fc0
cmpb $0x0, (%rcx)
je 0xd819
incl 0x8(%rax)
jmp 0xd81d
lock
incl 0x8(%rax)
leaq 0xc0(%rsp), %rsi
callq 0x1a9ba
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0xd83c
callq 0x7828
movq 0xe0(%rbx), %rax
movq (%rax,%r14,8), %rax
leaq (%rax,%r15), %rsi
addq $0x8, %rsi
movq -0x8(%rsi), %rax
movq %rax, 0xb8(%rbx)
leaq 0xc0(%rbx), %rdi
callq 0xbb5a
callq 0x5080
movq 0xe8(%rbx), %rcx
subq 0xe0(%rbx), %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
cltd
idivl %ecx
cmpl %ebp, %edx
je 0xd866
movl %edx, %r14d
callq 0x5080
movslq %r14d, %rcx
movq 0xe0(%rbx), %rdx
leaq (%rcx,%rcx,2), %rcx
movq (%rdx,%rcx,8), %rsi
movq 0x8(%rdx,%rcx,8), %rcx
subq %rsi, %rcx
shrq $0x4, %rcx
cltd
idivl %ecx
movslq %edx, %rax
shlq $0x4, %rax
movq (%rsi,%rax), %rdi
movl $0x1, %esi
callq 0x1aa52
xorl %r14d, %r14d
leaq 0x10(%rsp), %r15
callq 0x5080
cltq
imulq $0x2aaaaaab, %rax, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
cmpl $0x5, %eax
ja 0xdb0b
leaq 0xe3ce(%rip), %rcx      # 0x1bcd0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rdx
callq 0xbd0c
jmp 0xd9ba
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rdx
callq 0xc0b4
jmp 0xd9ba
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rdx
callq 0xbee0
jmp 0xd9ba
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rdx
callq 0xbfca
jmp 0xd9ba
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rdx
callq 0xbdf6
jmp 0xd9ba
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rdx
callq 0xc19e
movdqa 0x10(%rsp), %xmm0
movdqa %xmm0, 0x50(%rsp)
callq 0x5080
movq 0xe8(%rbx), %rcx
subq 0xe0(%rbx), %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
cltd
idivl %ecx
movl %edx, %ebp
callq 0x5080
movslq %ebp, %rcx
movq 0xe0(%rbx), %rdx
leaq (%rcx,%rcx,2), %rbp
movq (%rdx,%rbp,8), %rcx
movq 0x8(%rdx,%rbp,8), %rsi
subq %rcx, %rsi
shrq $0x4, %rsi
cltd
idivl %esi
movslq %edx, %r13
shlq $0x4, %r13
movq (%rcx,%r13), %rsi
movq %r15, %rdi
callq 0x1a9ce
movb $0x1, %r12b
cmpq $0x0, 0x10(%rsp)
jne 0xda76
movq 0xe0(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%r13), %rdi
callq 0x1aa4e
testb %al, %al
jne 0xda76
movq 0xe0(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%r13), %rsi
leaq 0x30(%rsp), %rdi
callq 0x1a98e
cmpq $0x0, 0x30(%rsp)
setne %r12b
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xda76
callq 0x7828
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xda85
callq 0x7828
testb %r12b, %r12b
jne 0xd9c6
movq 0xe0(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%r13), %rdi
movdqa 0x50(%rsp), %xmm0
movdqa %xmm0, 0x110(%rsp)
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rbp
testq %rbp, %rbp
je 0xdad0
movq 0x174fe(%rip), %rax     # 0x24fc0
cmpb $0x0, (%rax)
je 0xdacc
incl 0x8(%rbp)
jmp 0xdad0
lock
incl 0x8(%rbp)
leaq 0x110(%rsp), %rsi
callq 0x1a9fa
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0xdaef
callq 0x7828
testq %rbp, %rbp
je 0xdafc
movq %rbp, %rdi
callq 0x7828
incl %r14d
cmpl $0xa, %r14d
jne 0xd8d0
jmp 0xdb14
pxor %xmm0, %xmm0
jmp 0xd9c0
leaq 0x20(%rsp), %r13
xorl %r15d, %r15d
leaq 0x10(%rsp), %r12
callq 0x5080
movl %eax, %r14d
leal 0x7(%r14), %eax
testl %r14d, %r14d
cmovnsl %r14d, %eax
andl $-0x8, %eax
subl %eax, %r14d
cmpl $0x4, %r14d
movq %r15, 0x120(%rsp)
ja 0xdb79
movl $0x2, 0x30(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
leaq 0x70(%rsp), %rdx
leaq 0xda7d(%rip), %rcx      # 0x1b5ea
leaq 0x30(%rsp), %r8
callq 0xc288
jmp 0xdbd8
leal -0x5(%r14), %eax
cmpl $0x1, %eax
ja 0xdbb3
movl $0x1, 0x30(%rsp)
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
leaq 0x70(%rsp), %rdx
leaq 0xda50(%rip), %rcx      # 0x1b5f7
leaq 0x30(%rsp), %r8
callq 0xc3f8
jmp 0xdbd8
cmpl $0x7, %r14d
jne 0xddb7
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r12, %rsi
leaq 0x30(%rsp), %rdx
callq 0xc618
movq 0x10(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0x5080
movq 0xe8(%rbx), %rcx
subq 0xe0(%rbx), %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
cltd
idivl %ecx
movl %edx, %r12d
callq 0x5080
movslq %r12d, %rcx
movq 0xe0(%rbx), %rdx
leaq (%rcx,%rcx,2), %rbp
movq (%rdx,%rbp,8), %rcx
movq 0x8(%rdx,%rbp,8), %rsi
subq %rcx, %rsi
shrq $0x4, %rsi
cltd
idivl %esi
movslq %edx, %r15
shlq $0x4, %r15
movq (%rcx,%r15), %rsi
leaq 0x10(%rsp), %rdi
callq 0x1a9ce
movb $0x1, %r12b
cmpq $0x0, 0x10(%rsp)
jne 0xdcd2
movq 0xe0(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%r15), %rsi
leaq 0x30(%rsp), %rdi
callq 0x1aa0e
movb $0x1, %r12b
cmpq $0x0, 0x30(%rsp)
jne 0xdcc3
movq 0xe0(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%r15), %rdi
callq 0x1aa4e
testb %al, %al
jne 0xdcc3
movq 0xe0(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%r15), %rsi
leaq 0x70(%rsp), %rdi
callq 0x1a98e
cmpq $0x0, 0x70(%rsp)
setne %r12b
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xdcc3
callq 0x7828
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xdcd2
callq 0x7828
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xdce1
callq 0x7828
testb %r12b, %r12b
jne 0xdbec
movq 0xe0(%rbx), %rax
movq (%rax,%rbp,8), %rax
movq (%rax,%r15), %rdi
movq 0x68(%rsp), %rax
movq %rax, 0xb0(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0xb8(%rsp)
testq %rax, %rax
leaq 0x10(%rsp), %r12
je 0xdd3c
movq 0x1729c(%rip), %rax     # 0x24fc0
cmpb $0x0, (%rax)
je 0xdd33
movq 0x8(%rsp), %rax
incl 0x8(%rax)
jmp 0xdd3c
movq 0x8(%rsp), %rax
lock
incl 0x8(%rax)
leaq 0xb0(%rsp), %rsi
callq 0x1aa3a
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
je 0xdd5b
callq 0x7828
cmpl $0x7, %r14d
jne 0xe31c
movslq 0x108(%rbx), %rax
movq 0x70(%rbx), %rcx
movq 0xe0(%rbx), %rdx
movq (%rdx,%rbp,8), %rdx
movq (%rdx,%r15), %rsi
testq %rsi, %rsi
je 0xddab
addq %r15, %rdx
movq %rsi, 0x10(%rsp)
movq 0x8(%rdx), %rdx
movq %rdx, 0x18(%rsp)
testq %rdx, %rdx
je 0xddd2
movq 0x1721f(%rip), %rsi     # 0x24fc0
cmpb $0x0, (%rsi)
je 0xddce
incl 0x8(%rdx)
jmp 0xddd2
pxor %xmm0, %xmm0
movdqa %xmm0, 0x10(%rsp)
jmp 0xddd2
movq $0x0, 0x8(%rsp)
movq $0x0, 0x68(%rsp)
jmp 0xdbec
lock
incl 0x8(%rdx)
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
addq $-0x18, %rdi
movq %r12, %rsi
callq 0xc8ee
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xddf5
callq 0x7828
pxor %xmm0, %xmm0
movdqa %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movq %r13, 0x10(%rsp)
movq %r12, %rdi
leaq 0xd4ea(%rip), %rsi      # 0x1b301
leaq 0xd4e5(%rip), %rdx      # 0x1b303
callq 0x79f2
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x15d80
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xde47
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %r13, 0x10(%rsp)
movq %r12, %rdi
leaq 0xd4b1(%rip), %rsi      # 0x1b307
leaq 0xd4ac(%rip), %rdx      # 0x1b309
callq 0x79f2
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x15d80
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xde86
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %r13, 0x10(%rsp)
movq %r12, %rdi
leaq 0xd46f(%rip), %rsi      # 0x1b304
leaq 0xd46a(%rip), %rdx      # 0x1b306
callq 0x79f2
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x15d80
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xdec5
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %r13, 0x10(%rsp)
movq %r12, %rdi
leaq 0xd436(%rip), %rsi      # 0x1b30a
leaq 0xd431(%rip), %rdx      # 0x1b30c
callq 0x79f2
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x15d80
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xdf04
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %r13, 0x10(%rsp)
movq %r12, %rdi
leaq 0xd3fa(%rip), %rsi      # 0x1b30d
leaq 0xd3f5(%rip), %rdx      # 0x1b30f
callq 0x79f2
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x15d80
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xdf43
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %r13, 0x10(%rsp)
movq %r12, %rdi
leaq 0xd3be(%rip), %rsi      # 0x1b310
leaq 0xd3b9(%rip), %rdx      # 0x1b312
callq 0x79f2
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x15d80
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xdf82
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %r13, 0x10(%rsp)
movq %r12, %rdi
leaq 0xd382(%rip), %rsi      # 0x1b313
leaq 0xd37d(%rip), %rdx      # 0x1b315
callq 0x79f2
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x15d80
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xdfc1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
movq %r13, 0x10(%rsp)
movq %r12, %rdi
leaq 0xd346(%rip), %rsi      # 0x1b316
leaq 0xd341(%rip), %rdx      # 0x1b318
callq 0x79f2
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x15d80
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xe000
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
xorl %r14d, %r14d
xorl %r13d, %r13d
callq 0x5080
leal 0x7(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
movq 0xe0(%rbx), %rdx
movq (%rdx,%rbp,8), %rdx
movq (%rdx,%r15), %rsi
movq %rsi, 0xa0(%rsp)
movq 0x8(%rdx,%r15), %rdx
movq %rdx, 0xa8(%rsp)
testq %rdx, %rdx
je 0xe051
movq 0x16f7d(%rip), %rsi     # 0x24fc0
cmpb $0x0, (%rsi)
je 0xe04d
incl 0x8(%rdx)
jmp 0xe051
lock
incl 0x8(%rdx)
movq %rbx, %r12
andl $-0x8, %ecx
subl %ecx, %eax
cltq
movq 0x30(%rsp), %rcx
shlq $0x5, %rax
leaq 0xe0(%rsp), %rdx
movq %rdx, 0xd0(%rsp)
movq (%rcx,%rax), %rsi
movq 0x8(%rcx,%rax), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %rbx
movq %rbx, %rdi
callq 0x7898
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
leaq 0xa0(%rsp), %rdx
movq %rbx, %rcx
callq 0xe860
movq 0x10(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x60(%rsp)
testq %r14, %r14
je 0xe0c9
movq %r14, %rdi
callq 0x7828
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
movq %r12, %rbx
je 0xe0f1
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
movq 0x60(%rsp), %r12
je 0xe108
callq 0x7828
movq 0x50(%rsp), %rax
testq %rax, %rax
je 0xe13a
movq %rax, 0x90(%rsp)
movq %r12, 0x98(%rsp)
testq %r12, %r12
je 0xe145
movq 0x16e92(%rip), %rax     # 0x24fc0
cmpb $0x0, (%rax)
je 0xe13f
incl 0x8(%r12)
jmp 0xe145
xorl %r14d, %r14d
jmp 0xe167
lock
incl 0x8(%r12)
leaq 0x90(%rsp), %rsi
callq 0xf13a
movl %eax, %r14d
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0xe167
callq 0x7828
testb %r14b, %r14b
jne 0xe180
leal 0x1(%r13), %eax
movq %r12, %r14
cmpl $0x50, %r13d
movl %eax, %r13d
jb 0xe006
cmpq $0x0, 0x8(%rsp)
sete %bpl
movq 0x68(%rsp), %rdi
leaq 0x167aa(%rip), %r15     # 0x24940
movq %r15, %rsi
leaq 0x16310(%rip), %rdx     # 0x244b0
xorl %ecx, %ecx
callq 0x5230
testq %rax, %rax
sete %cl
orb %bpl, %cl
movl $0x0, %r14d
leaq 0x20(%rsp), %r13
jne 0xe1de
movq 0x16dfc(%rip), %rcx     # 0x24fc0
cmpb $0x0, (%rcx)
je 0xe1d4
movq 0x8(%rsp), %r14
incl 0x8(%r14)
jmp 0xe1de
movq 0x8(%rsp), %r14
lock
incl 0x8(%r14)
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x182ee
movdqa 0x10(%rsp), %xmm0
movdqa %xmm0, 0x100(%rsp)
pxor %xmm0, %xmm0
movdqa %xmm0, 0x10(%rsp)
movq 0x50(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x1a9ba
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0xe228
callq 0x7828
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xe237
callq 0x7828
testq %r14, %r14
je 0xe244
movq %r14, %rdi
callq 0x7828
cmpq $0x0, 0x8(%rsp)
sete %bpl
movq 0x68(%rsp), %rdi
movq %r15, %rsi
leaq 0x16253(%rip), %rdx     # 0x244b0
xorl %ecx, %ecx
callq 0x5230
testq %rax, %rax
sete %cl
orb %bpl, %cl
movl $0x0, %r14d
movq 0x50(%rsp), %rdx
jne 0xe29b
movq 0x16d3f(%rip), %rcx     # 0x24fc0
cmpb $0x0, (%rcx)
je 0xe291
movq 0x8(%rsp), %r14
incl 0x8(%r14)
jmp 0xe29b
movq 0x8(%rsp), %r14
lock
incl 0x8(%r14)
movq %rdx, 0x80(%rsp)
movq %r12, 0x88(%rsp)
testq %r12, %r12
leaq 0x10(%rsp), %r12
je 0xe2d4
movq 0x16d04(%rip), %rcx     # 0x24fc0
cmpb $0x0, (%rcx)
je 0xe2cb
movq 0x60(%rsp), %rcx
incl 0x8(%rcx)
jmp 0xe2d4
movq 0x60(%rsp), %rcx
lock
incl 0x8(%rcx)
movq %rax, %rdi
leaq 0x80(%rsp), %rsi
callq 0x18346
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0xe2f6
callq 0x7828
testq %r14, %r14
je 0xe303
movq %r14, %rdi
callq 0x7828
leaq 0x30(%rsp), %rdi
callq 0x77ca
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0xe31c
callq 0x7828
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
movq 0x120(%rsp), %r15
je 0xe333
callq 0x7828
incl %r15d
cmpl $0xa, %r15d
jne 0xdb21
xorl %r13d, %r13d
leaq 0x10(%rsp), %r14
callq 0x5080
cltq
imulq $0x38e38e39, %rax, %rcx # imm = 0x38E38E39
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x22, %rcx
addl %edx, %ecx
addl %ecx, %ecx
leal (%rcx,%rcx,8), %ecx
subl %ecx, %eax
cmpl $0x3, %eax
ja 0xe38f
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
leaq 0x30(%rsp), %rdx
callq 0xcb4c
jmp 0xe44f
leal -0x4(%rax), %ecx
cmpl $0x2, %ecx
ja 0xe3b7
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
leaq 0x30(%rsp), %rdx
callq 0xcc10
jmp 0xe44f
leal -0x7(%rax), %ecx
cmpl $0x4, %ecx
ja 0xe3dc
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
leaq 0x30(%rsp), %rdx
callq 0xcf20
jmp 0xe44f
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0xe, %ecx
je 0xe408
cmpl $0xc, %ecx
jne 0xe425
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
leaq 0x30(%rsp), %rdx
callq 0xccd4
jmp 0xe44f
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
leaq 0x30(%rsp), %rdx
callq 0xcd98
jmp 0xe44f
pxor %xmm0, %xmm0
movdqa %xmm0, 0x50(%rsp)
cmpl $0x10, %eax
jl 0xe45b
movq $0x0, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
movq %r14, %rsi
leaq 0x30(%rsp), %rdx
callq 0xce5c
movdqa 0x10(%rsp), %xmm0
movdqa %xmm0, 0x50(%rsp)
callq 0x5080
movq 0xe8(%rbx), %rcx
subq 0xe0(%rbx), %rcx
shrq $0x3, %rcx
imull $0xaaaaaaab, %ecx, %ecx # imm = 0xAAAAAAAB
cltd
idivl %ecx
movl %edx, %ebp
callq 0x5080
movslq %ebp, %rcx
movq 0xe0(%rbx), %rdx
leaq (%rcx,%rcx,2), %r15
movq (%rdx,%r15,8), %rcx
movq 0x8(%rdx,%r15,8), %rsi
subq %rcx, %rsi
shrq $0x4, %rsi
cltd
idivl %esi
movslq %edx, %r12
shlq $0x4, %r12
movq (%rcx,%r12), %rsi
movq %r14, %rdi
callq 0x1a9ce
movb $0x1, %bpl
cmpq $0x0, 0x10(%rsp)
jne 0xe53d
movq 0xe0(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12), %rsi
leaq 0x30(%rsp), %rdi
callq 0x1aa0e
movb $0x1, %bpl
cmpq $0x0, 0x30(%rsp)
jne 0xe52e
movq 0xe0(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12), %rsi
leaq 0x70(%rsp), %rdi
callq 0x1a98e
movb $0x1, %bpl
cmpq $0x0, 0x70(%rsp)
jne 0xe51f
movq 0xe0(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12), %rdi
callq 0x1aa4e
movl %eax, %ebp
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xe52e
callq 0x7828
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xe53d
callq 0x7828
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xe54c
callq 0x7828
testb %bpl, %bpl
jne 0xe45b
movq 0xe0(%rbx), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r12), %rdi
movdqa 0x50(%rsp), %xmm0
movdqa %xmm0, 0xf0(%rsp)
pshufd $0xee, %xmm0, %xmm0     # xmm0 = xmm0[2,3,2,3]
movq %xmm0, %rbp
testq %rbp, %rbp
je 0xe597
movq 0x16a37(%rip), %rax     # 0x24fc0
cmpb $0x0, (%rax)
je 0xe593
incl 0x8(%rbp)
jmp 0xe597
lock
incl 0x8(%rbp)
leaq 0xf0(%rsp), %rsi
callq 0x1a9ba
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0xe5b6
callq 0x7828
movslq 0x108(%rbx), %rax
leaq (%rax,%rax,2), %rax
movq 0x58(%rbx), %rcx
movq 0xe0(%rbx), %rdx
leaq (%rcx,%rax,8), %rdi
addq $-0x18, %rdi
addq (%rdx,%r15,8), %r12
movq %r12, %rsi
callq 0x15dee
testq %rbp, %rbp
je 0xe5ed
movq %rbp, %rdi
callq 0x7828
incl %r13d
cmpl $0x14, %r13d
jne 0xe348
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xc8(%rsp), %r14
jmp 0xe808
movq %rax, %rbx
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0xe631
callq 0x7828
movq 0x18(%rsp), %rdi
jmp 0xe648
movq %rax, %rbx
jmp 0xe652
movq %rax, %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0xe652
callq 0x7828
testq %r14, %r14
je 0xe65f
movq %r14, %rdi
callq 0x7828
movq 0x60(%rsp), %r14
jmp 0xe7d4
movq %rax, %rbx
movq 0x18(%rsp), %rdi
jmp 0xe6e2
jmp 0xe681
jmp 0xe681
jmp 0xe681
jmp 0xe681
jmp 0xe681
jmp 0xe681
jmp 0xe681
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0xe6ae
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x51f0
jmp 0xe6ae
jmp 0xe6ab
jmp 0xe6ab
jmp 0xe6ab
jmp 0xe6ab
jmp 0xe6ab
jmp 0xe6ab
jmp 0xe6ab
movq %rax, %rbx
movq 0x8(%rsp), %r14
leaq 0x30(%rsp), %rdi
callq 0x77ca
jmp 0xe808
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
jmp 0xe789
jmp 0xe7f9
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
testq %rdi, %rdi
jne 0xe7e6
jmp 0xe7f2
movq %rax, %rbx
movq 0x118(%rsp), %rdi
jmp 0xe789
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0xe719
callq 0x7828
jmp 0xe719
jmp 0xe72a
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0xe784
callq 0x7828
jmp 0xe784
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
movq 0x8(%rsp), %r14
je 0xe769
callq 0x7828
jmp 0xe769
jmp 0xe781
movq %rax, %rbx
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0xe75a
callq 0x7828
movq %r12, %r14
jmp 0xe7d4
jmp 0xe781
movq %rax, %rbx
movq 0x8(%rsp), %r14
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xe808
callq 0x7828
jmp 0xe808
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0xe7fc
callq 0x7828
jmp 0xe7fc
movq %rax, %rbx
jmp 0xe7c2
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0xe7c2
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x51f0
movq 0xa8(%rsp), %rdi
testq %rdi, %rdi
je 0xe7d4
callq 0x7828
leaq 0x30(%rsp), %rdi
callq 0x77ca
testq %r14, %r14
je 0xe7f2
movq %r14, %rdi
callq 0x7828
jmp 0xe7f2
jmp 0xe7f9
movq %rax, %rbx
movq 0x8(%rsp), %r14
jmp 0xe808
movq %rax, %rbx
pshufd $0xee, 0x50(%rsp), %xmm0 # xmm0 = mem[2,3,2,3]
movq %xmm0, %r14
testq %r14, %r14
je 0xe815
movq %r14, %rdi
callq 0x7828
movq %rbx, %rdi
callq 0x5380
nop