LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/LiGaCu[P]Distributed_System_to_Compute_the_Shortest_Path/aws.cpp
// Function: getTCPsockandbind(addrinfo*)
int getTCPsockandbind(struct addrinfo *servinfo)
{
    int sockfd;
    struct addrinfo *p;
    int reuseaddr=1;

    // loop through all the results and bind to the first we can
    for(p = servinfo; p != NULL; p = p->ai_next) 
    {
        if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) 
        {
            perror("server: socket");
            continue;
        }
        if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(int)) == -1) 
        {
            perror("setsockopt");
            exit(1);
        }
        if (bind(sockfd, p->ai_addr, p->ai_addrlen) == -1) 
        {
            close(sockfd);
            perror("server: bind");
            continue;
        }
        break;
    }
    if (p == NULL) 
    {
        fprintf(stderr, "server: failed to bind\n");
        exit(1);
    }

    return sockfd;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl $0x1, 0xc(%rsp)
testq %rdi, %rdi
je 0x30b8
movq %rdi, %rbx
leaq 0x12c2(%rip), %r15      # 0x430c
leaq 0xc(%rsp), %r14
leaq 0x12d0(%rip), %r12      # 0x4326
movl 0x4(%rbx), %edi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
callq 0x2080
movq %r15, %rdi
cmpl $-0x1, %eax
je 0x30aa
movl %eax, %ebp
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movq %r14, %rcx
movl $0x4, %r8d
callq 0x2290
cmpl $-0x1, %eax
je 0x30cc
movq 0x18(%rbx), %rsi
movl 0x10(%rbx), %edx
movl %ebp, %edi
callq 0x2070
cmpl $-0x1, %eax
jne 0x30bd
movl %ebp, %edi
callq 0x22d0
movq %r12, %rdi
callq 0x2130
movq 0x28(%rbx), %rbx
testq %rbx, %rbx
jne 0x3056
callq 0x23c2
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x23ad
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::Game()
Game::Game()
{
    turnCounter = 20;
    setGameOver(false);
    tempSpaceType = ' ';
    map = new World_Map;
    testSubject = new Player;
   
    //sets the starting space to 0,0
    setPlayerSpace();
    //prints the player's character on the board
    playerSpace->setSpaceTypeIdentifier('*');
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x14, (%rdi)
movw $0x2000, 0x4(%rdi)      # imm = 0x2000
movl $0x28, %edi
callq 0x2150
movq %rax, %r14
movq %rax, %rdi
callq 0x48bc
movq %r14, 0x18(%rbx)
movl $0x48, %edi
callq 0x2150
movq %rax, %r14
movq %rax, %rdi
callq 0x41c4
movq %r14, 0x8(%rbx)
movq %rbx, %rdi
callq 0x25a6
movq 0x10(%rbx), %rdi
movl $0x2a, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3b44
movq %rax, %rbx
movl $0x48, %esi
jmp 0x2590
movq %rax, %rbx
movl $0x28, %esi
movq %r14, %rdi
callq 0x2160
movq %rbx, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::~Game()
Game::~Game()
{
    delete testSubject;
    testSubject = NULL;

    delete map;
    map = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %r14
testq %r14, %r14
je 0x25fc
movq %r14, %rdi
callq 0x430c
movl $0x48, %esi
movq %r14, %rdi
callq 0x2160
movq $0x0, 0x8(%rbx)
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0x2622
movq %r14, %rdi
callq 0x4c80
movl $0x28, %esi
movq %r14, %rdi
callq 0x2160
movq $0x0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::makeMove(char)
void Game::makeMove(char userDirectionInput)
{
    //integrity check to ensure the player does not move out of bounds or on
    //top of an obstacle
    if (isOutOfBounds(userDirectionInput) || isObstacle(userDirectionInput))
    {
        std::cout << "Seriously? You clearly can't go that way. Try again." << std::endl;
    }
    else
    {
        //switch to change the player's coordinates based on chosen direction
        switch (userDirectionInput)
        {
            case 'w': testSubject->decrementCurrentX();
                      break;
            case 's': testSubject->incrementCurrentX();
                      break;
            case 'a': testSubject->decrementCurrentY();
                      break;
            case 'd': testSubject->incrementCurrentY();
                      break;
        }

        //set the player space based on new coordinates
        setPlayerSpace();
       
        //check for a special space type interaction
        playerSpace->spaceTypeSpecialInteraction(testSubject, map->getItem(3), map->getItem(2));
      
        //print the player's character on the map
        showPosition(userDirectionInput);

        //show the map
        map->showMap();
       
        //remove one turn from the total allowed
        turnCounter--;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
callq 0x31b6
testb %al, %al
jne 0x30c8
movsbl %bpl, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x323c
testb %al, %al
je 0x3112
movq 0x9f01(%rip), %rbx      # 0xcfd0
leaq 0x526b(%rip), %rsi      # 0x8341
movl $0x34, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20e0
cmpl $0x72, %ebp
jg 0x312c
cmpl $0x61, %ebp
je 0x3141
cmpl $0x64, %ebp
jne 0x3155
movq 0x8(%rbx), %rdi
callq 0x437e
jmp 0x3155
cmpl $0x73, %ebp
je 0x314c
cmpl $0x77, %ebp
jne 0x3155
movq 0x8(%rbx), %rdi
callq 0x4382
jmp 0x3155
movq 0x8(%rbx), %rdi
callq 0x4386
jmp 0x3155
movq 0x8(%rbx), %rdi
callq 0x437a
movq %rbx, %rdi
callq 0x25a6
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %r15
movq 0x18(%rbx), %rdi
movl $0x3, %esi
callq 0x4d60
movq %rax, %r12
movq 0x18(%rbx), %rdi
movl $0x2, %esi
callq 0x4d60
movq (%r15), %r8
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %rax, %rcx
callq *0x10(%r8)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x330c
movq 0x18(%rbx), %rdi
callq 0x5802
decl (%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::isOutOfBounds(char)
bool Game::isOutOfBounds(char intendedInput)
{
    //executes if the player would move out of bounds upwards
    if (testSubject->getCurrentX() == 0 && intendedInput == 'w')
    {
        return true; 
    }
    
    //executes if the player would move out of bounds downwards
    if (testSubject->getCurrentX() == map->getRows() - 1 && intendedInput == 's')
    {
        return true; 
    }
    
    //executes if the player would move out of bounds to the left
    if (testSubject->getCurrentY() == 0 && intendedInput == 'a')
    {
        return true; 
    }
    
    //executes if the player would move out of bounds to the right
    if (testSubject->getCurrentY() == map->getColumns() - 1 && intendedInput == 'd')
    {
        return true; 
    }

    //if the player chooses not to move, do nothing
    if (intendedInput == 'n')
    {
        return false;
    }

    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movq 0x8(%rdi), %rdi
callq 0x4372
movb $0x1, %bpl
cmpb $0x77, %bl
jne 0x31d7
testl %eax, %eax
je 0x322f
movq 0x8(%r14), %rdi
callq 0x4372
movl %eax, %r15d
movq 0x18(%r14), %rdi
callq 0x4d52
cmpb $0x73, %bl
jne 0x31f8
decl %eax
cmpl %eax, %r15d
je 0x322f
movq 0x8(%r14), %rdi
callq 0x4376
cmpb $0x61, %bl
jne 0x320a
testl %eax, %eax
je 0x322f
movq 0x8(%r14), %rdi
callq 0x4376
movl %eax, %ebp
movq 0x18(%r14), %rdi
callq 0x4d56
decl %eax
cmpl %eax, %ebp
sete %al
cmpb $0x64, %bl
sete %bpl
andb %al, %bpl
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::isObstacle(char)
bool Game::isObstacle(char intendedInput)
{
    switch (intendedInput)
    {
        //case if the player would move onto an obstacle upwards
        case 'w': if (playerSpace->getSpaceUp()->getSpaceTypeIdentifier() == 'X'
                      || playerSpace->getSpaceUp()->getSpaceTypeIdentifier() == '[')
                  {
                      return true;
                  }
                  break;
        //case if the player would move onto an obstacle downwards
        case 's': if (playerSpace->getSpaceBottom()->getSpaceTypeIdentifier() == 'X'
                      || playerSpace->getSpaceBottom()->getSpaceTypeIdentifier() == '[')
                  {
                      return true;
                  }
                  break;
        //case if the player would move onto an obstacle to the left
        case 'a': if (playerSpace->getSpaceLeft()->getSpaceTypeIdentifier() == 'X'
                      || playerSpace->getSpaceLeft()->getSpaceTypeIdentifier() == '[')
                  {
                      return true;
                  }
                  break;
        //case if the player would move onto an obstacle to the right
        case 'd': if (playerSpace->getSpaceRight()->getSpaceTypeIdentifier() == 'X'
                      || playerSpace->getSpaceRight()->getSpaceTypeIdentifier() == '[')
                  {
                      return true;
                  }
                  break;
        //case if the player chooses not to move 
        case 'x': return false;
    }

    return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
cmpl $0x72, %esi
jle 0x3285
cmpl $0x73, %esi
je 0x32b1
cmpl $0x78, %esi
je 0x32ff
cmpl $0x77, %esi
jne 0x32ff
movq 0x10(%r14), %rdi
callq 0x3b06
movq %rax, %rdi
callq 0x3afe
movb $0x1, %bl
cmpb $0x58, %al
je 0x3301
movq 0x10(%r14), %rdi
callq 0x3b06
jmp 0x32f3
cmpl $0x61, %esi
je 0x32d3
cmpl $0x64, %esi
jne 0x32ff
movq 0x10(%r14), %rdi
callq 0x3b18
movq %rax, %rdi
callq 0x3afe
movb $0x1, %bl
cmpb $0x58, %al
je 0x3301
movq 0x10(%r14), %rdi
callq 0x3b18
jmp 0x32f3
movq 0x10(%r14), %rdi
callq 0x3b0c
movq %rax, %rdi
callq 0x3afe
movb $0x1, %bl
cmpb $0x58, %al
je 0x3301
movq 0x10(%r14), %rdi
callq 0x3b0c
jmp 0x32f3
movq 0x10(%r14), %rdi
callq 0x3b12
movq %rax, %rdi
callq 0x3afe
movb $0x1, %bl
cmpb $0x58, %al
je 0x3301
movq 0x10(%r14), %rdi
callq 0x3b12
movq %rax, %rdi
callq 0x3afe
cmpb $0x5b, %al
je 0x3301
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::showPosition(char)
void Game::showPosition(char userDirectionInput)
{
    //replaces the current space identifier based on the direction the player
    //is going to move
    switch (userDirectionInput)
    {
        case 'w': getPlayerSpace()->getSpaceBottom()->setSpaceTypeIdentifier(tempSpaceType);
                  break;
        case 's': getPlayerSpace()->getSpaceUp()->setSpaceTypeIdentifier(tempSpaceType);
                  break;
        case 'a': getPlayerSpace()->getSpaceRight()->setSpaceTypeIdentifier(tempSpaceType);
                  break;
        case 'd': getPlayerSpace()->getSpaceLeft()->setSpaceTypeIdentifier(tempSpaceType);
                  break;
    }
   
    //holds the space type identifier while the player identifier is placed
    tempSpaceType = getPlayerSpace()->getSpaceTypeIdentifier();
   
    //add the player's identifier to the map
    getPlayerSpace()->setSpaceTypeIdentifier('*');
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $0x72, %esi
jg 0x3331
cmpl $0x61, %esi
je 0x334d
cmpl $0x64, %esi
jne 0x337b
movq %rbx, %rdi
callq 0x264a
movq %rax, %rdi
callq 0x3b12
jmp 0x336f
cmpl $0x73, %esi
je 0x335f
cmpl $0x77, %esi
jne 0x337b
movq %rbx, %rdi
callq 0x264a
movq %rax, %rdi
callq 0x3b0c
jmp 0x336f
movq %rbx, %rdi
callq 0x264a
movq %rax, %rdi
callq 0x3b18
jmp 0x336f
movq %rbx, %rdi
callq 0x264a
movq %rax, %rdi
callq 0x3b06
movsbl 0x5(%rbx), %esi
movq %rax, %rdi
callq 0x3b44
movq %rbx, %rdi
callq 0x264a
movq %rax, %rdi
callq 0x3afe
movb %al, 0x5(%rbx)
movq %rbx, %rdi
callq 0x264a
movq %rax, %rdi
movl $0x2a, %esi
popq %rbx
jmp 0x3b44
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::checkForItem()
void Game::checkForItem()
{
    if (getPlayerSpace()->getItemInSpace() != NULL)
    {
        std::cout << "Oh great. You found the " << playerSpace->
            getItemInSpace()->getItemName() << "..." << std::endl << std::endl;

        //add the item to the player's backpack
        testSubject->addItemToBackpack(playerSpace->
                getItemInSpace());
       
        //remove the item from the space
        playerSpace->removeItemFromSpace();
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
callq 0x264a
movq %rax, %rdi
callq 0x3b3e
testq %rax, %rax
je 0x3957
movq 0x9757(%rip), %r14      # 0xcfd0
leaq 0x4be1(%rip), %rsi      # 0x8461
movl $0x18, %edx
movq %r14, %rdi
callq 0x2180
movq 0x10(%rbx), %rdi
callq 0x3b3e
movq %rsp, %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x40e2
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x2180
movq %rax, %r14
leaq 0x4dc9(%rip), %rsi      # 0x8686
movl $0x3, %edx
movq %rax, %rdi
callq 0x2180
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3936
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x8(%rbx), %r14
movq 0x10(%rbx), %rdi
callq 0x3b3e
movq %r14, %rdi
movq %rax, %rsi
callq 0x438a
movq 0x10(%rbx), %rdi
callq 0x3b68
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x397f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2240
nop
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::checkForEnding()
void Game::checkForEnding()
{
    
    //executes if the player has escaped the chamber
    if (testSubject->getCurrentX() == 1 && testSubject->getCurrentY() == 4)
    {
        endGame(VICTORY);
    }

    //executes if the player dies
    if (testSubject->getHitPoints() == 0)
    {
        endGame(MELTED);
    }
     
    //executes if the player runs out of time
    if (turnCounter == 0)
    {
        endGame(BURNED);
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x4372
cmpl $0x1, %eax
jne 0x39b2
movq 0x8(%rbx), %rdi
callq 0x4376
cmpl $0x4, %eax
jne 0x39b2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x37dc
movq 0x8(%rbx), %rdi
callq 0x434a
testl %eax, %eax
jne 0x39cc
movq %rbx, %rdi
movl $0x2, %esi
callq 0x37dc
cmpl $0x0, (%rbx)
je 0x39d3
popq %rbx
retq
movq %rbx, %rdi
movl $0x1, %esi
popq %rbx
jmp 0x37dc
nop
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/game.cpp
// Function: Game::playRound()
void Game::playRound()
{
    executeUserInput(getUserAction());
    checkForCake();
    checkForItem();
    checkDoor();
    checkForEnding();
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x5ea0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3620
movq %rbx, %rdi
callq 0x3a0c
movq %rbx, %rdi
callq 0x3850
movq %rbx, %rdi
callq 0x39e2
movq %rbx, %rdi
popq %rbx
jmp 0x3988
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/button.cpp
// Function: Button::spaceTypeSpecialInteraction(Player*, Item*, Item*)
void Button::spaceTypeSpecialInteraction(Player *playerInput, Item *cc, Item *pg)
{
    //if the player has the Companion Cube, press the button down
    if (playerInput->checkBackpackForItem(cc))
    {
        isPressed = true;
        //remove the Companion Cube from the player's backpack
        playerInput->removeItemFromBackpack(cc);
        
        std::cout << "What?! How did you just open that door?!" << std::endl;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x4664
testb %al, %al
je 0x3d40
movb $0x1, 0x9(%r15)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x43b4
movq 0x92d0(%rip), %rbx      # 0xcfd0
leaq 0x4828(%rip), %rsi      # 0x852f
movl $0x28, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x20e0
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/player.cpp
// Function: Player::Player()
Player::Player()
{
    setHitPoints(100);
    std::cout << "It's waking up...what was it's name again?" << std::endl;
    std::cout << "Enter your name: ";
    setName(getString(false));
    setCurrentX(0);
    setCurrentY(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
leaq 0x18(%rdi), %r12
movq %r12, 0x8(%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movb $0x0, 0x18(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movq %rax, 0x40(%rdi)
movl $0x64, (%rdi)
movq 0x8dd0(%rip), %r15      # 0xcfd0
leaq 0x44c6(%rip), %rsi      # 0x86cd
movl $0x2a, %edx
movq %r15, %rdi
callq 0x2180
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq 0x8d9e(%rip), %rdi      # 0xcfd0
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq 0x8d8a(%rip), %rdi      # 0xcfd0
leaq 0x44ab(%rip), %rsi      # 0x86f8
movl $0x11, %edx
callq 0x2180
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x5a9c
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x20c0
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x428b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq $0x0, 0x28(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r15
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x42c2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x42c2
movq %rax, %r15
leaq 0x30(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x42da
movq 0x40(%rbx), %rsi
subq %rdi, %rsi
callq 0x2160
movq (%r14), %rdi
cmpq %r12, %rdi
je 0x42ee
movq (%r12), %rsi
incq %rsi
callq 0x2160
movq %r15, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/worldMap.cpp
// Function: World_Map::makeNewMap()
void World_Map::makeNewMap()
{
     
    testChamberMap = new Space**[rows];
    for (int i = 0; i < rows; i++)
    {
        testChamberMap[i] = new Space*[columns];

        for (int j = 0; j < columns; j++)
        {
            testChamberMap[i][j] = new Floor;
        }
    }
   
    //add all special-type spaces
    initializeSpecialSpaces();
    //link all rooms together
    linkRooms();
    //add all items the map
    initializeItems();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq (%rdi), %r14
leaq (,%r14,8), %rdi
testq %r14, %r14
movq $-0x1, %r15
cmovsq %r15, %rdi
callq 0x2030
movq %rax, 0x8(%rbx)
testq %r14, %r14
jle 0x4c41
movl 0x4(%rbx), %r13d
xorl %r12d, %r12d
movslq %r13d, %rbp
leaq (,%rbp,8), %rdi
testl %ebp, %ebp
cmovsq %r15, %rdi
callq 0x2030
movq 0x8(%rbx), %rcx
movq %rax, (%rcx,%r12,8)
testl %ebp, %ebp
jle 0x4c36
xorl %ebp, %ebp
movl $0x38, %edi
callq 0x2150
movq %rax, %r14
movq %rax, %rdi
callq 0x3d48
movq 0x8(%rbx), %rax
movq (%rax,%r12,8), %rax
movq %r14, (%rax,%rbp,8)
incq %rbp
movslq 0x4(%rbx), %r13
cmpq %r13, %rbp
jl 0x4c06
movl (%rbx), %r14d
incq %r12
movslq %r14d, %rax
cmpq %rax, %r12
jl 0x4be2
movq %rbx, %rdi
callq 0x534c
movq %rbx, %rdi
callq 0x542c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x54fc
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
callq 0x2160
movq %rbx, %rdi
callq 0x2240
nop
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/worldMap.cpp
// Function: World_Map::~World_Map()
World_Map::~World_Map()
{
    for (int i = 0; i < rows; i++)
    {
        for (int j = 0; j < columns; j++)
        {
            delete testChamberMap[i][j];
        }
        delete [] testChamberMap[i];
    }
    delete [] testChamberMap;
    testChamberMap = NULL;

    delete cake;
    delete portalGun;
    delete companionCube;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, (%rdi)
jle 0x4cdc
xorl %r14d, %r14d
movl 0x4(%rbx), %eax
testl %eax, %eax
jle 0x4cbf
xorl %r15d, %r15d
movq 0x8(%rbx), %rcx
movq (%rcx,%r14,8), %rcx
movq (%rcx,%r15,8), %rdi
testq %rdi, %rdi
je 0x4cb4
movq (%rdi), %rax
callq *0x8(%rax)
movl 0x4(%rbx), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x4c9a
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x4cd1
callq 0x21c0
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x4c90
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x4cea
callq 0x21c0
movq $0x0, 0x8(%rbx)
movq 0x10(%rbx), %r14
testq %r14, %r14
je 0x4d03
movq %r14, %rdi
callq 0x40ac
movl $0x48, %esi
movq %r14, %rdi
callq 0x2160
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0x4d21
movq %r14, %rdi
callq 0x40ac
movl $0x48, %esi
movq %r14, %rdi
callq 0x2160
movq 0x20(%rbx), %rbx
testq %rbx, %rbx
je 0x4d3f
movq %rbx, %rdi
callq 0x40ac
movl $0x48, %esi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2160
nop
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/worldMap.cpp
// Function: World_Map::getItem(int)
Item* World_Map::getItem(int itemToGet)
{
    //switch based on item specified
    switch (itemToGet)
    {
        case 1: return cake;
                break;
        case 2: return portalGun;
                break;
        case 3: return companionCube;
                break;
    }

    return NULL;
}

// Assembly:
cmpl $0x3, %esi
je 0x4d79
cmpl $0x2, %esi
je 0x4d74
cmpl $0x1, %esi
jne 0x4d7e
movq 0x10(%rdi), %rax
retq
movq 0x18(%rdi), %rax
retq
movq 0x20(%rdi), %rax
retq
xorl %eax, %eax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/worldMap.cpp
// Function: World_Map::initializeSpecialSpaces()
void World_Map::initializeSpecialSpaces()
{
    addButton(1, 1);
    addDoor(1, 3);
    addChamberlock(1, 4);
    addToxic_Waste(4, 3);
    addToxic_Waste(3, 4);
    addToxic_Waste(1, 2);
    addWall(0, 1);
    addWall(0, 3);
    addWall(0, 4);
    addWall(2, 0);
    addWall(2, 3);
    addWall(2, 4);
    addWall(3, 1);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, %esi
movl $0x1, %edx
callq 0x553e
movq %rbx, %rdi
movl $0x1, %esi
movl $0x3, %edx
callq 0x55ac
movq %rbx, %rdi
movl $0x1, %esi
movl $0x4, %edx
callq 0x561a
movq %rbx, %rdi
movl $0x4, %esi
movl $0x3, %edx
callq 0x5688
movq %rbx, %rdi
movl $0x3, %esi
movl $0x4, %edx
callq 0x5688
movq %rbx, %rdi
movl $0x1, %esi
movl $0x2, %edx
callq 0x5688
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1, %edx
callq 0x56f6
movq %rbx, %rdi
xorl %esi, %esi
movl $0x3, %edx
callq 0x56f6
movq %rbx, %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x56f6
movq %rbx, %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x56f6
movq %rbx, %rdi
movl $0x2, %esi
movl $0x3, %edx
callq 0x56f6
movq %rbx, %rdi
movl $0x2, %esi
movl $0x4, %edx
callq 0x56f6
movq %rbx, %rdi
movl $0x3, %esi
movl $0x1, %edx
popq %rbx
jmp 0x56f6
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/worldMap.cpp
// Function: World_Map::linkRooms()
void World_Map::linkRooms()
{
    for (int i = 0; i < rows; i++)
    {
        for (int j = 0; j < columns; j++)
        {
            //if not an edge, link to room above
            if (i > 0)
            {
                testChamberMap[i][j]->setSpaceUp(testChamberMap[i - 1][j]);
            }
            //if not an edge, link to room left
            if (j > 0)
            {
                testChamberMap[i][j]->setSpaceLeft(testChamberMap[i][j - 1]);
            }
            //if not an edge, link to room below
            if (i < rows - 1)
            {
                testChamberMap[i][j]->setSpaceBottom(testChamberMap[i + 1][j]);
            }
            //if not an edge, link to room right
            if (j < columns - 1)
            {
                testChamberMap[i][j]->setSpaceRight(testChamberMap[i][j + 1]);
            }
        }
    }
}

// Assembly:
movl (%rdi), %ecx
testl %ecx, %ecx
jle 0x54fb
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rdi), %eax
xorl %r14d, %r14d
testl %eax, %eax
jle 0x54e7
xorl %r15d, %r15d
testq %r14, %r14
je 0x546e
movq 0x8(%rbx), %rax
movq -0x8(%rax,%r14,8), %rcx
movq (%rax,%r14,8), %rax
movq (%rax,%r15,8), %rdi
movq (%rcx,%r15,8), %rsi
callq 0x3b4a
testq %r15, %r15
je 0x5489
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rax
movq -0x8(%rax,%r15,8), %rsi
movq (%rax,%r15,8), %rdi
callq 0x3b56
movslq (%rbx), %rax
decq %rax
cmpq %rax, %r14
jge 0x54ae
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rcx
movq 0x8(%rax,%r14,8), %rax
movq (%rcx,%r15,8), %rdi
movq (%rax,%r15,8), %rsi
callq 0x3b50
movslq 0x4(%rbx), %rax
movq %rax, %rcx
decq %rcx
cmpq %rcx, %r15
jge 0x54d6
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rax
movq (%rax,%r15,8), %rdi
movq 0x8(%rax,%r15,8), %rsi
callq 0x3b5c
movl 0x4(%rbx), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x544f
movl (%rbx), %ecx
incq %r14
movslq %ecx, %rdx
cmpq %rdx, %r14
jl 0x5444
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/utils.cpp
// Function: getString[abi:cxx11](bool)
std::string getString(bool prompt)
{
    std::string input;
  
    if (prompt == true)
    {
        std::cout << "Enter a word or phrase: ";
    }

    //get the user's input
    std::getline(std::cin, input);

    //remprompt if input is empty std::string
    while (input == "")
    {
        std::cout << "Empty string -- enter at least one character: "
            << std::endl;
        std::getline(std::cin, input);
    }
    
    return input;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rbp
movq %rbp, (%rdi)
movq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
testl %esi, %esi
je 0x5ad9
movq 0x7508(%rip), %rdi      # 0xcfd0
leaq 0x2def(%rip), %rsi      # 0x88be
movl $0x18, %edx
callq 0x2180
movq 0x7500(%rip), %rdi      # 0xcfe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %edx
movq 0x74e5(%rip), %r14      # 0xcfe0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2260
leaq 0x1ac6(%rip), %r15      # 0x75d3
movq 0x74bc(%rip), %r12      # 0xcfd0
leaq 0x2dbc(%rip), %r13      # 0x88d7
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2080
testl %eax, %eax
jne 0x5b86
movl $0x2e, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x2180
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %r12, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2260
jmp 0x5b1b
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5b9a
movq %rax, %r14
movq (%rbx), %rdi
cmpq %rbp, %rdi
je 0x5bb1
movq (%rbp), %rsi
incq %rsi
callq 0x2160
movq %r14, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/utils.cpp
// Function: printArray(int*, int)
void printArray(int *array, int s)
{
    int i = 0;
    
    while (i < s)
    {
        std::cout << array[i] << " ";
        i++;
    }
    std::cout << std::endl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testl %esi, %esi
jle 0x667f
movq %rdi, %rbx
movl %esi, %r12d
xorl %r13d, %r13d
movq 0x697c(%rip), %r14      # 0xcfd0
leaq 0x13d8(%rip), %r15      # 0x7a33
movl (%rbx,%r13,4), %esi
movq %r14, %rdi
callq 0x2230
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
incq %r13
cmpq %r13, %r12
jne 0x665b
movq 0x694a(%rip), %rbx      # 0xcfd0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x20e0
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/utils.cpp
// Function: replay()
char replay()
{
    char choice;

    do
    {
        std::cout << std::endl;
        std::cout << "Would you like to play again? (y/n)" << std::endl;
        choice = getMenuChar();
    }
    while (choice != 'y' && choice !='n');

    return choice;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x6682(%rip), %rbx      # 0xcfd0
leaq 0x2371(%rip), %r14      # 0x8cc6
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movl $0x23, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
callq 0x6290
cmpb $0x79, %al
je 0x69c4
movzbl %al, %ecx
cmpl $0x6e, %ecx
jne 0x6955
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/utils.cpp
// Function: selectionYN()
char selectionYN()
{
    char choice;

    do
    {
        std::cout << std::endl;
        std::cout << "Please enter yes or no? (y/n)" << std::endl;
        choice = getMenuChar();
    }
    while (choice != 'y' && choice != 'n');

    return choice;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x65f9(%rip), %rbx      # 0xcfd0
leaq 0x230c(%rip), %r14      # 0x8cea
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movl $0x1d, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
callq 0x6290
cmpb $0x79, %al
je 0x6a4d
movzbl %al, %ecx
cmpl $0x6e, %ecx
jne 0x69de
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/JacobLCarter[P]2D-Portal/main.cpp
// Function: main
int main()
{
    //get user's choice at the main menu
    int menuChoice = mainMenu();

    //executes if the user chooses to play
    if (menuChoice == 1)
    {
        //loop repeats until the user chooses not to replay
        do
        {
            //make a new game
            Game *currentGame = new Game;
      
            //show the introduction and wait for the user to press enter to continue
            std::cout << currentGame->gameIntroduction();
            std::cin.get();

            //show the starting map
            currentGame->getMap()->showMap();

            //show the map legend
            std::cout << currentGame->getMap()->getMapLegend();

            //display the game's controls
            std::cout << currentGame->displayHelpMenu();

            //play another round while it is not true that the game is over
            while (!currentGame->getGameOver())
            {
                currentGame->playRound();
            }
           
            //free memory allocated for the game
            delete currentGame;
        }
        while (replay() != 'n');
    }
    else
    {
        std::cout << "Exiting the program" << std::endl;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
callq 0x66b6
cmpl $0x1, %eax
jne 0x6b8b
leaq 0x10(%rsp), %r13
movq %rsp, %rbx
movq 0x654e(%rip), %r14      # 0xcfd0
movq 0x6557(%rip), %r15      # 0xcfe0
movl $0x20, %edi
callq 0x2150
movq %rax, %r12
movq %rax, %rdi
callq 0x251c
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2698
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x2180
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x6ad0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2160
movq %r15, %rdi
callq 0x21a0
movq %r12, %rdi
callq 0x2684
movq %rax, %rdi
callq 0x5802
movq %r12, %rdi
callq 0x2684
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4d82
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x2180
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x6b22
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2fde
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rdi
callq 0x2180
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x6b5b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2160
jmp 0x6b5b
callq 0x3a64
movq %r12, %rdi
callq 0x2690
movq %r12, %rdi
testb %al, %al
je 0x6b56
callq 0x25e4
movl $0x20, %esi
movq %r12, %rdi
callq 0x2160
callq 0x6943
cmpb $0x6e, %al
jne 0x6a89
jmp 0x6bcd
movq 0x643e(%rip), %rbx      # 0xcfd0
leaq 0x216f(%rip), %rsi      # 0x8d08
movl $0x13, %edx
movq %rbx, %rdi
callq 0x2180
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2140
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x20, %esi
movq %r12, %rdi
jmp 0x6c02
jmp 0x6bee
jmp 0x6bee
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x6c07
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2240
// File: /workspace/github_cpp_makefile_star2_O3/vjeux[P]jspp/example/scope.cpp
// Function: main::$_4::operator()(Object, Object)
_(function (var $) {
	var global = "local";

	std::cout << "Inside:      $ = " << $ << std::endl;
	std::cout << "Inside: global = " << global << std::endl;

	// Inside:      $ = jQuery
	// Inside: global = local

	return undefined;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movq %rdi, %rbx
leaq 0x1e8f(%rip), %rsi      # 0xa26b
movq %rsp, %rdi
callq 0x6678
movq 0x5bed(%rip), %rdi      # 0xdfd8
leaq 0x1e7f(%rip), %rsi      # 0xa271
movl $0x11, %edx
callq 0x21f0
movq (%r14), %rax
leaq 0x30(%rsp), %rsi
movq %rax, (%rsi)
movq %rsi, 0x8(%rsi)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rsi)
incl (%rax)
movq 0x5bbc(%rip), %r14      # 0xdfd8
movq %r14, %rdi
callq 0x24fc
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x5b96(%rip), %rdi      # 0xdfd8
callq 0x2030
movq %rax, %rdi
callq 0x2120
leaq 0x30(%rsp), %rdi
callq 0x85b8
movq 0x5b78(%rip), %rdi      # 0xdfd8
leaq 0x1e1c(%rip), %rsi      # 0xa283
movl $0x11, %edx
callq 0x21f0
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
leaq 0x18(%rsp), %rsi
movq %rax, (%rsi)
movq %rsi, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
incl (%rcx)
movq 0x5b45(%rip), %r14      # 0xdfd8
movq %r14, %rdi
callq 0x24fc
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2190
movsbl %al, %esi
movq 0x5b1f(%rip), %rdi      # 0xdfd8
callq 0x2030
movq %rax, %rdi
callq 0x2120
leaq 0x18(%rsp), %rdi
callq 0x85b8
movq 0x5cb9(%rip), %rax      # 0xe190
movq %rax, (%rbx)
movq %rbx, 0x8(%rbx)
movq 0x5cbb(%rip), %rax      # 0xe1a0
movq %rax, 0x10(%rbx)
incl (%rax)
movq %rsp, %rdi
callq 0x85b8
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
jmp 0x851a
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0x8515
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x85b8
movq %rsp, %rdi
callq 0x85b8
movq %rbx, %rdi
callq 0x2290
// File: /workspace/github_cpp_makefile_star2_O3/cpirc[P]Monochrome/src/eval.cpp
// Function: int evaluate_mobility<(Piece)1>(Position const&)
int evaluate_mobility(const Position& pos) {
    int score = 0;
    uint64_t pieces = get_piece(pos, p, US);

    while (pieces) {
        score += popcnt(attacks<p>(lsb(pieces), get_occupancy(pos))) *
                 mobility_weights[p];

        pieces &= pieces - 1;
    }

    return score + evaluate_mobility<p + 1>(pos);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x30(%rdi), %rax
andq 0x8(%rdi), %rax
je 0x416b
xorl %ebx, %ebx
leaq 0xd4c5(%rip), %rcx      # 0x115c0
movabsq $0x5555555555555555, %rdx # imm = 0x5555555555555555
movabsq $0x3333333333333333, %rsi # imm = 0x3333333333333333
movabsq $0xf0f0f0f0f0f0f0f, %r8 # imm = 0xF0F0F0F0F0F0F0F
movabsq $0x101010101010101, %r9 # imm = 0x101010101010101
bsfq %rax, %r10
movq (%rcx,%r10,8), %r10
movq %r10, %r11
shrq %r11
andq %rdx, %r11
subq %r11, %r10
movq %r10, %r11
andq %rsi, %r11
shrq $0x2, %r10
andq %rsi, %r10
addq %r11, %r10
movq %r10, %r11
shrq $0x4, %r11
addq %r10, %r11
andq %r8, %r11
imulq %r9, %r11
shrq $0x38, %r11
leal (%rbx,%r11,4), %ebx
leaq -0x1(%rax), %r10
andq %r10, %rax
jne 0x4123
jmp 0x416d
xorl %ebx, %ebx
callq 0x417b
addl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cpirc[P]Monochrome/src/main.cpp
// Function: main
int main() {
    seed_rng(17594872);
    init_keys();
    init_bitboards();

    std::setbuf(stdout, NULL);
    std::setbuf(stdin, NULL);

    std::string line;
    while (true) {
        std::getline(std::cin, line);
        if (line == "uci") {
            UCI::listen();
            break;
        } else if (line == "xboard") {
            std::cout << "Protocol not supported" << std::endl;
        } else if (line == "quit") {
            break;
        } else {
            std::cout << "Unknown protocol" << std::endl;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
callq 0x6804
callq 0x362c
movq 0xc92a(%rip), %rax      # 0x10f90
movq (%rax), %rdi
xorl %esi, %esi
callq 0x3230
movq 0xc949(%rip), %rax      # 0x10fc0
movq (%rax), %rdi
xorl %esi, %esi
callq 0x3230
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0xc93d(%rip), %rbx      # 0x10fd8
leaq -0x48(%rbp), %r14
leaq 0x7ffa(%rip), %r15      # 0xc6a0
leaq 0x7ff7(%rip), %r12      # 0xc6a4
movq 0xc914(%rip), %r13      # 0x10fc8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3300
movq %r14, %rdi
movq %r15, %rsi
callq 0x3070
testl %eax, %eax
je 0x4756
movq %r14, %rdi
movq %r12, %rsi
callq 0x3070
testl %eax, %eax
je 0x4715
movq %r14, %rdi
leaq 0x7fc4(%rip), %rsi      # 0xc6c2
callq 0x3070
movl $0x10, %edx
leaq 0x7fb8(%rip), %rsi      # 0xc6c7
testl %eax, %eax
jne 0x4721
jmp 0x475b
movl $0x16, %edx
leaq 0x7f8a(%rip), %rsi      # 0xc6ab
movq %r13, %rdi
callq 0x31e0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x31b0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3130
jmp 0x46b4
callq 0xa233
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x476d
callq 0x31a0
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4780
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x4795
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/cpirc[P]Monochrome/src/move.cpp
// Function: move_to_lan(char*, unsigned int)
void move_to_lan(char* lan_str, const Move move) {
    assert(lan_str);

    Square from = from_square(move), to = to_square(move);

    lan_str[0] = square_str[(std::size_t)from][0];
    lan_str[1] = square_str[(std::size_t)from][1];

    lan_str[2] = square_str[(std::size_t)to][0];
    lan_str[3] = square_str[(std::size_t)to][1];

    if (promotion_type(move)) {
        switch (promotion_type(move)) {
            case KNIGHT:
                lan_str[4] = 'n';
                break;
            case BISHOP:
                lan_str[4] = 'b';
                break;
            case ROOK:
                lan_str[4] = 'r';
                break;
            case QUEEN:
                lan_str[4] = 'q';
                break;
            default:
                break;
        }
        lan_str[5] = '\0';
    } else
        lan_str[4] = '\0';
}

// Assembly:
testq %rdi, %rdi
je 0x4c40
movl %esi, %eax
andl $0x3f, %eax
leaq 0xbf69(%rip), %rcx      # 0x10b40
movq (%rcx,%rax,8), %rax
movb (%rax), %dl
movb %dl, (%rdi)
movb 0x1(%rax), %al
movb %al, 0x1(%rdi)
movl %esi, %eax
shrl $0x3, %eax
andl $0x1f8, %eax            # imm = 0x1F8
movq (%rax,%rcx), %rax
movb (%rax), %cl
movb %cl, 0x2(%rdi)
movb 0x1(%rax), %al
movb %al, 0x3(%rdi)
shrl $0xf, %esi
movl %esi, %ecx
andb $0x7, %cl
movl $0x5, %eax
cmpb $0x4, %cl
ja 0x4c3b
andl $0x7, %esi
leaq 0x7ae6(%rip), %rcx      # 0xc700
movslq (%rcx,%rsi,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movl $0x4, %eax
jmp 0x4c3b
movb $0x71, %cl
jmp 0x4c38
movb $0x62, %cl
jmp 0x4c38
movb $0x72, %cl
jmp 0x4c38
movb $0x6e, %cl
movb %cl, 0x4(%rdi)
movb $0x0, (%rdi,%rax)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x7b85(%rip), %rdi      # 0xc7d0
leaq 0x7b86(%rip), %rsi      # 0xc7d8
leaq 0x7b8c(%rip), %rcx      # 0xc7e5
movl $0x7a, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/cpirc[P]Monochrome/src/move.cpp
// Function: lan_to_move(Position const&, char const*, unsigned int&)
bool lan_to_move(const Position& pos, const char* lan_str, Move& move) {
    assert(lan_str);

    Square from = (Square)((lan_str[0] - 'a') + ((lan_str[1] - '1') * 8)),
           to = (Square)((lan_str[2] - 'a') + ((lan_str[3] - '1') * 8));
    Piece promo = NO_PIECE;

    switch (lan_str[4]) {
        case '\0':
            break;
        case 'n':
            promo = KNIGHT;
            break;
        case 'b':
            promo = BISHOP;
            break;
        case 'r':
            promo = ROOK;
            break;
        case 'q':
            promo = QUEEN;
            break;
        default:
            break;
    }

    SearchStack ss[1];
    clear_ss(ss, 1);

    int movecount;
    movecount = generate(pos, ss->ml);

    Move current_move;
    while ((current_move = next_move(ss, movecount))) {
        if (pos.flipped) {
            current_move = flip_move(current_move);
        }

        if (from_square(current_move) == from &&
            to_square(current_move) == to) {
            // FIX ME: This is very ugly
            if (promo != NO_PIECE && promotion_type(current_move) != promo) {
                continue;
            }
            move = current_move;
            return true;
        }
    }

    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
testq %rsi, %rsi
je 0x4e0d
movq %rdx, %r12
movq %rdi, %r14
movb 0x1(%rsi), %r13b
movb 0x3(%rsi), %bl
shlb $0x3, %r13b
shlb $0x3, %bl
movzbl 0x4(%rsi), %eax
movl $0x6, -0x2c(%rbp)
movb $0x1, %cl
movl %ecx, -0x30(%rbp)
cmpl $0x70, %eax
jg 0x4d2f
cmpl $0x62, %eax
je 0x4d42
cmpl $0x6e, %eax
jne 0x4d59
movl $0x1, -0x2c(%rbp)
jmp 0x4d52
cmpl $0x71, %eax
je 0x4d4b
cmpl $0x72, %eax
jne 0x4d59
movl $0x3, -0x2c(%rbp)
jmp 0x4d52
movl $0x2, -0x2c(%rbp)
jmp 0x4d52
movl $0x4, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
addb (%rsi), %r13b
addb 0x2(%rsi), %bl
leaq -0x860(%rbp), %r15
movq %r15, %rdi
movl $0x1, %esi
callq 0x7c57
leaq -0x85c(%rbp), %rsi
movq %r14, %rdi
callq 0x5d4e
leaq -0x34(%rbp), %rsi
movl %eax, (%rsi)
movq %r15, %rdi
callq 0x78de
testl %eax, %eax
je 0x4def
movq %r12, -0x40(%rbp)
addb $0x17, %r13b
addb $0x17, %bl
leaq -0x34(%rbp), %r12
movl %eax, %ecx
andl $0x3ffff, %ecx          # imm = 0x3FFFF
xorl $0xe38, %ecx            # imm = 0xE38
cmpb $0x0, 0x41(%r14)
cmovel %eax, %ecx
movl %ecx, %eax
andb $0x3f, %al
cmpb %r13b, %al
jne 0x4de0
movl %ecx, %eax
shrl $0x6, %eax
andb $0x3f, %al
cmpb %bl, %al
jne 0x4de0
cmpb $0x0, -0x30(%rbp)
jne 0x4df3
movl %ecx, %eax
shrl $0xf, %eax
andl $0x7, %eax
cmpl %eax, -0x2c(%rbp)
je 0x4df3
movq %r15, %rdi
movq %r12, %rsi
callq 0x78de
testl %eax, %eax
jne 0x4da3
xorl %eax, %eax
jmp 0x4dfb
movq -0x40(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, %al
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x79bc(%rip), %rdi      # 0xc7d0
leaq 0x79bd(%rip), %rsi      # 0xc7d8
leaq 0x79e8(%rip), %rcx      # 0xc80a
movl $0xaa, %edx
callq 0x3100
// File: /workspace/github_cpp_makefile_star2_O3/cpirc[P]Monochrome/src/move.cpp
// Function: pv_verify(Position const&, std::vector<unsigned int, std::allocator<unsigned int>>&)
bool pv_verify(const Position& pos, PV& pv) {
    Position npos = pos;
    Move moves[256];

    for (const auto& pv_move : pv) {
        bool found = false;

        int movecount = generate(npos, moves);
        for (int i = 0; i < movecount; i++) {
            if (pv_move == moves[i]) {
                make_move(npos, pv_move);
                found = true;
                break;
            }
        }

        if (!found) {
            return false;
        }
    }

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
movq %rsi, %rbx
movq %rdi, %rax
leaq -0x90(%rbp), %rdi
movl $0xa, %ecx
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x40(%rbp), %rdi
addq $0x50, %rax
movq %rax, %rsi
callq 0x5300
movq (%rbx), %r12
movq 0x8(%rbx), %r13
cmpq %r13, %r12
je 0x4ec6
leaq -0x90(%rbp), %r14
leaq -0x490(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x5d4e
testl %eax, %eax
setg %bl
jle 0x4ec2
movl (%r12), %esi
movl %eax, %eax
xorl %ecx, %ecx
cmpl -0x490(%rbp,%rcx,4), %esi
je 0x4eaf
incq %rcx
cmpq %rcx, %rax
jne 0x4e9c
jmp 0x4ec2
movq %r14, %rdi
callq 0x47a0
addq $0x4, %r12
cmpq %r13, %r12
jne 0x4e82
jmp 0x4ec8
xorl %ebx, %ebx
jmp 0x4ec8
movb $0x1, %bl
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x4ed6
callq 0x31a0
movl %ebx, %eax
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4eec
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x4efd
callq 0x31a0
movq %rbx, %rdi
callq 0x32d0
// File: /workspace/github_cpp_makefile_star2_O3/cpirc[P]Monochrome/src/move_gen.cpp
// Function: void add_moves<false, (Piece)0>(Position const&, unsigned int*, int&)
void add_moves<false, PAWN>(const Position& pos, Move* ml, int& idx) {
    std::uint64_t pawns = get_piece(pos, PAWN, US);
    std::uint64_t empty = ~get_occupancy(pos);
    std::uint64_t singles, doubles;

    // Single push
    singles = (pawns << 8) & empty;

    // Separate promotions
    singles &= ~rank_mask[RANK_8];

    while (singles) {
        Square dest = lsb(singles);

        ml[idx] = get_move(dest - 8, dest, NORMAL);
        idx++;

        singles &= singles - 1;
    }

    // Double push
    singles = ((pawns & rank_mask[RANK_2]) << 8) & empty;
    doubles = (singles << 8) & empty;

    while (doubles) {
        Square dest = lsb(doubles);

        ml[idx] = get_move(dest - 16, dest, DOUBLE_PUSH);
        idx++;

        doubles &= doubles - 1;
    }

    // Promotions
    singles = ((pawns & rank_mask[RANK_7]) << 8) & empty;

    while (singles) {
        Square dest = lsb(singles);

        ml[idx] = get_move(dest - 8, dest, PROMOTION, TO_KNIGHT);
        idx++;

        ml[idx] = get_move(dest - 8, dest, PROMOTION, TO_BISHOP);
        idx++;

        ml[idx] = get_move(dest - 8, dest, PROMOTION, TO_ROOK);
        idx++;

        ml[idx] = get_move(dest - 8, dest, PROMOTION, TO_QUEEN);
        idx++;

        singles &= singles - 1;
    }

    add_moves<false, KNIGHT>(pos, ml, idx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x30(%rdi), %rcx
movq (%rdi), %rax
andq %rcx, %rax
orq 0x38(%rdi), %rcx
notq %rcx
shlq $0x8, %rax
andq %rcx, %rax
movabsq $0xffffffffffff00, %r8  # imm = 0xFFFFFFFFFFFF00
andq %rax, %r8
je 0x55b5
movl (%rdx), %r9d
bsfq %r8, %r10
leal 0xf8(%r10), %r11d
movzbl %r11b, %r11d
shll $0x6, %r10d
orl %r11d, %r10d
movslq %r9d, %r9
movl %r10d, (%rsi,%r9,4)
movl (%rdx), %r9d
incl %r9d
movl %r9d, (%rdx)
leaq -0x1(%r8), %r10
andq %r10, %r8
jne 0x5586
movl %eax, %r8d
shll $0x8, %r8d
andl %r8d, %ecx
andl $0xff000000, %ecx       # imm = 0xFF000000
je 0x5600
movl (%rdx), %r8d
bsfq %rcx, %r9
leal 0xf0(%r9), %r10d
movzbl %r10b, %r10d
shll $0x6, %r9d
orl %r10d, %r9d
orl $0x5000, %r9d           # imm = 0x5000
movslq %r8d, %r8
movl %r9d, (%rsi,%r8,4)
movl (%rdx), %r8d
incl %r8d
movl %r8d, (%rdx)
leaq -0x1(%rcx), %r9
andq %r9, %rcx
jne 0x55ca
movabsq $-0x100000000000000, %rcx # imm = 0xFF00000000000000
andq %rcx, %rax
je 0x5688
movl (%rdx), %r8d
bsfq %rax, %rcx
leal 0xf8(%rcx), %r9d
movzbl %r9b, %r9d
shll $0x6, %ecx
orl %r9d, %ecx
leal 0xc000(%rcx), %r9d
movslq %r8d, %r8
movl %r9d, (%rsi,%r8,4)
movslq (%rdx), %r8
leaq 0x1(%r8), %r9
movl %r9d, (%rdx)
leal 0x14000(%rcx), %r9d
movl %r9d, 0x4(%rsi,%r8,4)
movslq (%rdx), %r8
leaq 0x1(%r8), %r9
movl %r9d, (%rdx)
leal 0x1c000(%rcx), %r9d
movl %r9d, 0x4(%rsi,%r8,4)
movslq (%rdx), %r8
leaq 0x1(%r8), %r9
movl %r9d, (%rdx)
orl $0x24000, %ecx          # imm = 0x24000
movl %ecx, 0x4(%rsi,%r8,4)
movl (%rdx), %r8d
incl %r8d
movl %r8d, (%rdx)
leaq -0x1(%rax), %rcx
andq %rcx, %rax
jne 0x5612
popq %rbp
jmp 0x5dae