LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::Wait()
void Wait() {
            PCB* cpu_process = all_processes[CPU];

            // If the process has no children, nothing to wait for
            if (cpu_process->HasChildren()) {
                // If the process already has at least one zombie child, child disappears and parent keeps using CPU
                int PID_of_zombie_child = cpu_process->ProcessHasZombieChild();
                if (PID_of_zombie_child > 0) {  ///////////???
                    cpu_process->SetWaitingState(0);

                    // Delete the zombie child's children
                    DeleteChildren(all_processes[PID_of_zombie_child]);
                    
                    // Delete the zombie child
                    PCB* zombie = all_processes[PID_of_zombie_child];
                    PCB* parent = all_processes[zombie->GetParent()];

                    parent->RemoveChild(zombie);
                    all_processes.erase(PID_of_zombie_child);
                    delete zombie;
                    zombie = nullptr;
                }

                // If the process has no zombie children, remove the process from the ready queue and send process at front of ready queue to CPU
                else {
                    // Set process using CPU to waiting
                    cpu_process->SetWaitingState(1);
                    CPU = ready_queue.front();
                    ready_queue.pop_front();
                    // The waiting parent process will be added back to the end of the ready queue when one of its children exits.
                }
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x38(%rbp)
movq %rsi, %rdi
addq $0x50, %rdi
callq 0x4050
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x98c0
testb $0x1, %al
jne 0x3659
jmp 0x3759
movq -0x10(%rbp), %rdi
callq 0xb090
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jle 0x372b
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x9740
movq -0x38(%rbp), %rdi
addq $0x50, %rdi
leaq -0x14(%rbp), %rsi
callq 0x4050
movq -0x38(%rbp), %rdi
movq (%rax), %rsi
callq 0x93e0
movq -0x38(%rbp), %rdi
addq $0x50, %rdi
leaq -0x14(%rbp), %rsi
callq 0x4050
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, -0x20(%rbp)
addq $0x50, %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x93a0
movq -0x48(%rbp), %rdi
movl %eax, -0x2c(%rbp)
leaq -0x2c(%rbp), %rsi
callq 0x8510
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x95e0
movq -0x38(%rbp), %rdi
addq $0x50, %rdi
leaq -0x14(%rbp), %rsi
callq 0x95a0
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x3721
movq -0x40(%rbp), %rdi
callq 0x9690
movq -0x40(%rbp), %rdi
movl $0x28, %esi
callq 0x21f0
movq $0x0, -0x20(%rbp)
jmp 0x3757
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x9740
movq -0x38(%rbp), %rdi
addq $0x20, %rdi
callq 0x9260
movq -0x38(%rbp), %rdi
movl (%rax), %eax
movl %eax, (%rdi)
addq $0x20, %rdi
callq 0x9290
jmp 0x3759
addq $0x50, %rsp
popq %rbp
retq
nop
// File: isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::RequestDisk(int const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void RequestDisk(const int & disk_number, const std::string & file_name) {
            if ((disk_number < number_of_hard_disks) && (disk_number >= 0)) {
                // Process 1 should not use any disks/be added to any queues
                if (CPU != 1) {
                    hard_disks[disk_number]->Request(file_name, CPU);
                    // Remove from CPU and replace from ready queue
                    GetNextFromReadyQueue();
                }
            }
            else {
                std::cout << "There is no disk " << disk_number << std::endl;
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
cmpl 0xc(%rcx), %eax
jge 0x37e8
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jl 0x37e8
movq -0x20(%rbp), %rax
cmpl $0x1, (%rax)
je 0x37e6
movq -0x20(%rbp), %rdi
addq $0x38, %rdi
movq -0x10(%rbp), %rax
movslq (%rax), %rsi
callq 0x4200
movq -0x20(%rbp), %rdx
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xb120
movq -0x20(%rbp), %rdi
callq 0x9760
jmp 0x3818
movq 0xf7e1(%rip), %rdi      # 0x12fd0
leaq 0x89b5(%rip), %rsi      # 0xc1ab
callq 0x21d0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
callq 0x2320
movq %rax, %rdi
movq 0xf7ad(%rip), %rsi      # 0x12fc0
callq 0x2210
addq $0x20, %rsp
popq %rbp
retq
nop
// File: isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::RemoveProcessFromDisk(int const&)
void RemoveProcessFromDisk(const int & disk_number) {
            if ((disk_number < number_of_hard_disks) && (disk_number >= 0)) {
                int removed_pcb = hard_disks[disk_number]->RemoveProcess();
                AddToReadyQueue(removed_pcb);
            }
            else {
                std::cout << "There is no disk " << disk_number << std::endl;
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
cmpl 0xc(%rcx), %eax
jge 0x3879
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jl 0x3879
movq -0x20(%rbp), %rdi
addq $0x38, %rdi
movq -0x10(%rbp), %rax
movslq (%rax), %rsi
callq 0x4200
movq (%rax), %rdi
callq 0x9dc0
movq -0x20(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0x8620
jmp 0x38a9
movq 0xf750(%rip), %rdi      # 0x12fd0
leaq 0x8924(%rip), %rsi      # 0xc1ab
callq 0x21d0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
callq 0x2320
movq %rax, %rdi
movq 0xf71c(%rip), %rsi      # 0x12fc0
callq 0x2210
addq $0x20, %rsp
popq %rbp
retq
nop
// File: isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::~OperatingSystem()
~OperatingSystem() {
            // Delete disks
            for (auto disk : hard_disks) {
                delete disk;
            }
            // Delete frames
            for (auto frame : frames) {
                delete frame;
            }
            // Delete all PCBs
            for (auto PCB : all_processes) {
                delete PCB.second;
            }

            hard_disks.clear();
            frames.clear();
            all_processes.clear();
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
addq $0x38, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9bd0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x9c40
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x9c00
testb $0x1, %al
jne 0x3b8c
jmp 0x3bce
leaq -0x18(%rbp), %rdi
callq 0x9c70
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, %rax
je 0x3bc1
movq -0x80(%rbp), %rdi
callq 0xb8f0
movq -0x80(%rbp), %rdi
movl $0x40, %esi
callq 0x21f0
jmp 0x3bc3
leaq -0x18(%rbp), %rdi
callq 0xb920
jmp 0x3b79
movq -0x78(%rbp), %rax
addq $0x80, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0xa0c0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rdi
callq 0xa130
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0xa0f0
testb $0x1, %al
jne 0x3c09
jmp 0x3c54
leaq -0x38(%rbp), %rdi
callq 0xa160
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0x3c47
movq -0x88(%rbp), %rdi
callq 0xb940
movq -0x88(%rbp), %rdi
movl $0xc, %esi
callq 0x21f0
jmp 0x3c49
leaq -0x38(%rbp), %rdi
callq 0xb950
jmp 0x3bf6
movq -0x78(%rbp), %rax
addq $0x50, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0xb970
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x61b0
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xb9a0
testb $0x1, %al
jne 0x3c8d
jmp 0x3ce0
leaq -0x58(%rbp), %rdi
callq 0x6230
movq (%rax), %rcx
movq %rcx, -0x70(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, %rax
je 0x3cd3
movq -0x90(%rbp), %rdi
callq 0x9690
movq -0x90(%rbp), %rdi
movl $0x28, %esi
callq 0x21f0
jmp 0x3cd5
leaq -0x58(%rbp), %rdi
callq 0x7190
jmp 0x3c7a
movq -0x78(%rbp), %rdi
addq $0x38, %rdi
callq 0xb9d0
movq -0x78(%rbp), %rdi
addq $0x80, %rdi
callq 0xb9f0
movq -0x78(%rbp), %rdi
addq $0x50, %rdi
callq 0xba10
movq -0x78(%rbp), %rdi
addq $0x80, %rdi
callq 0x4220
movq -0x78(%rbp), %rdi
addq $0x50, %rdi
callq 0x4280
movq -0x78(%rbp), %rdi
addq $0x38, %rdi
callq 0x42a0
movq -0x78(%rbp), %rdi
addq $0x20, %rdi
callq 0x4300
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::AddToReadyQueue(int)
void AddToReadyQueue(const int pid) {
            // First process goes straight to CPU
            if (CPU == 1) {
                CPU = pid;
            }
            // Otherwise process added to back of queue
            else {
                ready_queue.push_back(pid);
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x1, (%rax)
jne 0x8647
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
movl %ecx, (%rax)
jmp 0x8658
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
leaq -0xc(%rbp), %rsi
callq 0x90f0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: isabellab3[P]OS-Simulation/./PCB.h
// Function: PCB::RemoveChild(PCB*&)
void RemoveChild(PCB* & child) {
            for (auto itr = child_processes.begin(); itr != child_processes.end(); itr++) {
                if ((*itr) == child) {
                    child_processes.erase(itr);
                    return;
                }
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
addq $0x8, %rdi
callq 0x8ea0
movq %rax, -0x18(%rbp)
movq -0x40(%rbp), %rdi
addq $0x8, %rdi
callq 0x8d30
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xaaa0
testb $0x1, %al
jne 0x9629
jmp 0x967d
leaq -0x18(%rbp), %rdi
callq 0xaae0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x966a
movq -0x40(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x48(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xab70
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xab00
movq %rax, -0x30(%rbp)
jmp 0x967d
jmp 0x966c
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xabb0
movq %rax, -0x38(%rbp)
jmp 0x9605
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::GetNextFromReadyQueue()
void GetNextFromReadyQueue() {
            if (ready_queue.empty()) {
                CPU = 1;
            }
            else {
                CPU = ready_queue.front();
                ready_queue.pop_front();
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x10(%rbp)
addq $0x20, %rdi
callq 0xb070
testb $0x1, %al
jne 0x9783
jmp 0x978f
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
jmp 0x97ad
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x9260
movq -0x10(%rbp), %rdi
movl (%rax), %eax
movl %eax, (%rdi)
addq $0x20, %rdi
callq 0x9290
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: isabellab3[P]OS-Simulation/./OS.h
// Function: OperatingSystem::RemoveFromReadyQueue(int)
void RemoveFromReadyQueue(const int pid_) {
            auto pid_to_delete = std::find(ready_queue.begin(), ready_queue.end(), pid_);
            // If the item is in the ready queue, removes it
            if (pid_to_delete != ready_queue.end()) {
                ready_queue.erase(pid_to_delete);
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x48(%rbp)
addq $0x20, %rdi
callq 0x92c0
movq -0x48(%rbp), %rdi
movq %rax, -0x20(%rbp)
addq $0x20, %rdi
callq 0x4570
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0xc(%rbp), %rdx
callq 0xa220
movq -0x48(%rbp), %rdi
movq %rax, -0x18(%rbp)
addq $0x20, %rdi
callq 0x4570
movq %rax, -0x30(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xa270
testb $0x1, %al
jne 0x9a6e
jmp 0x9a98
movq -0x48(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x50(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xa2f0
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0xa2a0
movq %rax, -0x40(%rbp)
addq $0x50, %rsp
popq %rbp
retq
nop
// File: isabellab3[P]OS-Simulation/./disk.h
// Function: HardDisk::Remove(int const&)
void Remove(const int & pid) {
            // If the process is using the disk
            if (current_process == pid) {
                RemoveProcess();
            }
            // If the process is in the io queue
            for (auto itr = io_queue.begin(); itr != io_queue.end(); itr++) {
                if ((*itr).first == pid) {
                    io_queue.erase(itr);
                }
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x9cbb
movq -0x40(%rbp), %rdi
callq 0x9dc0
movq -0x40(%rbp), %rdi
addq $0x28, %rdi
callq 0x9e60
movq %rax, -0x18(%rbp)
movq -0x40(%rbp), %rdi
addq $0x28, %rdi
callq 0x7940
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x9e90
testb $0x1, %al
jne 0x9cf0
jmp 0x9d40
leaq -0x18(%rbp), %rdi
callq 0x7d70
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x9d2d
movq -0x40(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x48(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x9f10
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x9ec0
movq %rax, -0x30(%rbp)
jmp 0x9d2f
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x9f30
movq %rax, -0x38(%rbp)
jmp 0x9ccc
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: isabellab3[P]OS-Simulation/./disk.h
// Function: HardDisk::RemoveProcess()
int RemoveProcess() {
            int removed_process = current_process;
            if (!DiskIsIdle()) {
                // No process is waiting to use the disk; set idle
                if (io_queue.empty()) {
                    current_process = -1;
                    current_file = "";
                }

                // Otherwise let the next process on the queue use the disk
                else {
                    current_process = io_queue.front().first;
                    current_file = io_queue.front().second;
                    io_queue.pop_front();
                }
            }
            return removed_process;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movl (%rdi), %eax
movl %eax, -0xc(%rbp)
callq 0x8230
testb $0x1, %al
jne 0x9e52
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0x9f60
testb $0x1, %al
jne 0x9df5
jmp 0x9e11
movq -0x18(%rbp), %rdi
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
addq $0x8, %rdi
leaq 0x235f(%rip), %rsi      # 0xc169
callq 0x22a0
jmp 0x9e50
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0x9f80
movq -0x18(%rbp), %rdi
movl (%rax), %eax
movl %eax, (%rdi)
addq $0x28, %rdi
callq 0x9f80
movq -0x18(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
addq $0x8, %rdi
callq 0x2030
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0x9fb0
jmp 0x9e52
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: isabellab3[P]OS-Simulation/./PCB.h
// Function: PCB::ProcessHasZombieChild() const
int ProcessHasZombieChild() const {
            for (auto itr = child_processes.begin(); itr != child_processes.end(); itr++) {
                if ((*itr)->process_is_zombie) {
                    return (*itr)->pid;
                }
            }
            return 0;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x8, %rdi
callq 0x9800
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x9870
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x9830
testb $0x1, %al
jne 0xb0d5
jmp 0xb10d
leaq -0x18(%rbp), %rdi
callq 0x98a0
movq (%rax), %rax
testb $0x1, 0x24(%rax)
je 0xb0fa
leaq -0x18(%rbp), %rdi
callq 0x98a0
movq (%rax), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0xb114
jmp 0xb0fc
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x9aa0
movq %rax, -0x28(%rbp)
jmp 0xb0b1
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: isabellab3[P]OS-Simulation/./disk.h
// Function: HardDisk::Request(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int const&)
void Request(const std::string & file_name, const int & pid) {
            // If there is no process using the disk already, it can go straight to the disk
            if (DiskIsIdle()) {
                current_process = pid;
                current_file = file_name;
            }
            // Otherwise add the process to the io queue
            else {
                io_queue.push_back(std::pair<int, std::string>(pid, file_name));
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x8230
testb $0x1, %al
jne 0xb147
jmp 0xb162
movq -0x58(%rbp), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, (%rdi)
movq -0x10(%rbp), %rsi
addq $0x8, %rdi
callq 0x2030
jmp 0xb1b4
movq -0x58(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0xb210
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0xb1d0
jmp 0xb192
leaq -0x40(%rbp), %rdi
callq 0x7ec0
jmp 0xb1b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x7ec0
jmp 0xb1ba
addq $0x70, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x2330
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: lhartmann[P]orangepi-i2s-steppers/throttle_test.cpp
// Function: main
int main() {
	Throttle t;
	t.prepare(100, 40, 5, 5);
	for (int i=0; i<200; ++i) {
		cout
			<< i << " "
			<< (t.step() ? "STEP " : "     ")
			<< (t.done() ? "DONE " : "     ")
			<< t.acc << " "
			<< t.r << " "
			<< endl;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1310
leaq -0x28(%rbp), %rdi
movl $0x64, %esi
movl $0x28, %edx
movl $0x5, %r8d
movl %r8d, %ecx
callq 0x1340
movl $0x0, -0x2c(%rbp)
cmpl $0xc8, -0x2c(%rbp)
jge 0x12fb
movl -0x2c(%rbp), %esi
movq 0x2db6(%rip), %rdi      # 0x3fd8
callq 0x1080
movq %rax, %rdi
leaq 0xddd(%rip), %rsi       # 0x200e
callq 0x1040
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1410
testb $0x1, %al
jne 0x1249
jmp 0x1256
leaq 0xdb4(%rip), %rax       # 0x2004
movq %rax, -0x40(%rbp)
jmp 0x1263
leaq 0xdad(%rip), %rax       # 0x200a
movq %rax, -0x40(%rbp)
jmp 0x1263
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x1040
movq %rax, -0x48(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x14e0
testb $0x1, %al
jne 0x1283
jmp 0x1290
leaq 0xd86(%rip), %rax       # 0x2010
movq %rax, -0x50(%rbp)
jmp 0x129d
leaq 0xd73(%rip), %rax       # 0x200a
movq %rax, -0x50(%rbp)
jmp 0x129d
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x1040
movq %rax, %rdi
movl -0xc(%rbp), %esi
callq 0x1080
movq %rax, %rdi
leaq 0xd4f(%rip), %rsi       # 0x200e
callq 0x1040
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x1060
movq %rax, %rdi
leaq 0xd35(%rip), %rsi       # 0x200e
callq 0x1040
movq %rax, %rdi
movq 0x2ce0(%rip), %rsi      # 0x3fc8
callq 0x1050
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x120b
xorl %eax, %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: waket[P]ThreadPool/main.cpp
// Function: hello()
void hello () {
    int time = random() % 8;
    cout << "\t\tHello ... " << time << " ...." << endl;
    sleep(time);
    cout << "\t\tHello ... " << time << " DONE" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
callq 0x20b0
movl $0x8, %ecx
cqto
idivq %rcx
movl %edx, %eax
movl %eax, -0x4(%rbp)
movq 0xbb15(%rip), %rdi      # 0xdfd8
leaq 0x6b3a(%rip), %rsi      # 0x9004
callq 0x2180
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x22b0
movq %rax, %rdi
leaq 0x6b2d(%rip), %rsi      # 0x9011
callq 0x2180
movq %rax, %rdi
movq 0xbad5(%rip), %rsi      # 0xdfc8
callq 0x21c0
movl -0x4(%rbp), %edi
callq 0x2100
movq 0xbad1(%rip), %rdi      # 0xdfd8
leaq 0x6af6(%rip), %rsi      # 0x9004
callq 0x2180
movq %rax, %rdi
movl -0x4(%rbp), %esi
callq 0x22b0
movq %rax, %rdi
leaq 0x6b56(%rip), %rsi      # 0x907e
callq 0x2180
movq %rax, %rdi
movq 0xba91(%rip), %rsi      # 0xdfc8
callq 0x21c0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: waket[P]ThreadPool/./ThreadPoolTask.h
// Function: Mutex::~Mutex()
~Mutex() {
        // It shall be safe to destroy an initialized mutex that is unlocked.
        // Attempting to destroy a locked mutex results in undefined behavior.
        if (isLocked) {
            unlock();
        }
        pthread_mutex_destroy(&mutxLock);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movb 0x28(%rax), %al
testb $0x1, %al
je 0x3278
movq -0x10(%rbp), %rdi
callq 0x3d90
jmp 0x3276
jmp 0x3278
movq -0x10(%rbp), %rdi
callq 0x21f0
addq $0x10, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x3830
nop
// File: waket[P]ThreadPool/ThreadPoolTask.cpp
// Function: ThreadPoolTask::start()
bool ThreadPoolTask::start() {
    startWorkersMutex.lock();
    isStarted = true;
    isStopWorker = false;
    for (int i = 0; i < workerCount; i++) {
        pthread_t pth;
        if (pthread_create(&pth, NULL, start_worker, (void*) this) != 0) {
            cout << "\tFailed to create new worker" << endl;
            isStarted = false;
            startWorkersMutex.unlock();
            return false;
        }
    }
    // Lock and wait till all the workers start
    cout << "\tLock and wait for All workers to get started" << endl;
    startWorkersCond.wait(startWorkersMutex.mutexPtr());
    startWorkersMutex.unlock();

    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
addq $0x158, %rdi            # imm = 0x158
callq 0x5b00
movq -0x28(%rbp), %rax
movb $0x1, 0x150(%rax)
movb $0x0, 0x152(%rax)
movl $0x0, -0x14(%rbp)
movq -0x28(%rbp), %rcx
movslq -0x14(%rbp), %rax
cmpq 0x8(%rcx), %rax
jae 0x52c0
movq -0x28(%rbp), %rcx
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0x6ea(%rip), %rdx      # 0x4b80
callq 0x22f0
cmpl $0x0, %eax
je 0x52b3
movq 0x8d5d(%rip), %rdi      # 0xdfd8
leaq 0x3fcb(%rip), %rsi      # 0x924d
callq 0x2180
movq %rax, %rdi
movq 0x8d37(%rip), %rsi      # 0xdfc8
callq 0x21c0
movq -0x28(%rbp), %rdi
movb $0x0, 0x150(%rdi)
addq $0x158, %rdi            # imm = 0x158
callq 0x3d90
movb $0x0, -0x1(%rbp)
jmp 0x531f
jmp 0x52b5
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x5249
movq 0x8d11(%rip), %rdi      # 0xdfd8
leaq 0x3f9c(%rip), %rsi      # 0x926a
callq 0x2180
movq %rax, %rdi
movq 0x8ceb(%rip), %rsi      # 0xdfc8
callq 0x21c0
movq -0x28(%rbp), %rdi
movq %rdi, %rax
addq $0x188, %rax            # imm = 0x188
movq %rax, -0x30(%rbp)
addq $0x158, %rdi            # imm = 0x158
callq 0x5b60
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x5b30
movq -0x28(%rbp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x3d90
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: waket[P]ThreadPool/ThreadPoolTask.cpp
// Function: ThreadPoolTask::doTask(boost::function<void ()> const&)
bool ThreadPoolTask::doTask(const TaskItem& task) {
    //Lock by mutex before getting the value of isShutdown
    stopMutex.lock();
    if (isShutdown ) {
        stopMutex.unlock();
        return false;
    }
    
    // TO ALLOW ADDING TASK EVEN IF IT IS NOT STARTED YET
    // Comment the next 4 lines.
    if (!started()) {
        stopMutex.unlock();
        return false;
    }
    stopMutex.unlock();

    //Lock by mutex before queuing the task
    tasksMutex.lock();
    tasksDeque.push_back(task);
    cout << "\tadd. Size of the task queue is: " << tasksDeque.size() << endl;
    // wakeup one worker that is waiting for a task to be available
    tasksCond.signal();
    tasksMutex.unlock();
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0xf0, %rdi
callq 0x5b00
movq -0x20(%rbp), %rax
testb $0x1, 0x151(%rax)
je 0x55ba
movq -0x20(%rbp), %rdi
addq $0xf0, %rdi
callq 0x3d90
movb $0x0, -0x1(%rbp)
jmp 0x5675
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x20(%rax)
testb $0x1, %al
jne 0x55e1
movq -0x20(%rbp), %rdi
addq $0xf0, %rdi
callq 0x3d90
movb $0x0, -0x1(%rbp)
jmp 0x5675
movq -0x20(%rbp), %rdi
addq $0xf0, %rdi
callq 0x3d90
movq -0x20(%rbp), %rdi
addq $0x90, %rdi
callq 0x5b00
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movq -0x18(%rbp), %rsi
callq 0x5f30
movq 0x89bf(%rip), %rdi      # 0xdfd8
leaq 0x3e5a(%rip), %rsi      # 0x947a
callq 0x2180
movq -0x20(%rbp), %rdi
movq %rax, -0x28(%rbp)
addq $0x10, %rdi
callq 0x5c00
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x2050
movq %rax, %rdi
movq 0x897c(%rip), %rsi      # 0xdfc8
callq 0x21c0
movq -0x20(%rbp), %rdi
addq $0xc0, %rdi
callq 0x5be0
movq -0x20(%rbp), %rdi
addq $0x90, %rdi
callq 0x3d90
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
// File: waket[P]ThreadPool/ThreadPoolTask.cpp
// Function: ThreadPoolTask::wait()
bool ThreadPoolTask::wait() {
    //Lock by mutex before getting  the value of isShutdown
    stopMutex.lock();
    if(isShutdown) { //Don't wait. The Thread pool is already stopped
        assert(!isStarted);
        stopMutex.unlock();
        return true;
    }
     //Wait til the thread pool stops all the workers
    stopCond.wait(stopMutex.mutexPtr());
    stopMutex.unlock();
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x18(%rbp)
addq $0xf0, %rdi
callq 0x5b00
movq -0x18(%rbp), %rax
testb $0x1, 0x151(%rax)
je 0x5716
movq -0x18(%rbp), %rax
movb 0x150(%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x56df
jmp 0x56e1
jmp 0x5700
leaq 0x3db4(%rip), %rdi      # 0x949c
leaq 0x3c78(%rip), %rsi      # 0x9367
movl $0xb6, %edx
leaq 0x3dac(%rip), %rcx      # 0x94a7
callq 0x20e0
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
callq 0x3d90
movb $0x1, -0x1(%rbp)
jmp 0x5753
movq -0x18(%rbp), %rdi
movq %rdi, %rax
addq $0x120, %rax            # imm = 0x120
movq %rax, -0x20(%rbp)
addq $0xf0, %rdi
callq 0x5b60
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x5b30
movq -0x18(%rbp), %rdi
addq $0xf0, %rdi
callq 0x3d90
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: waket[P]ThreadPool/ThreadPoolTask.cpp
// Function: ThreadPoolTask::requestStop()
bool ThreadPoolTask::requestStop() {
    //Lock by mutex to avoid scheduling successive requestStop
    stopMutex.lock();
    if(isShutdown) { //Nothing to do. The thread pool is already stopped
        assert(!isStarted);
        stopMutex.unlock();
        return true;
    }
    stopMutex.unlock();
    //Stop all workers by creating new thread for asynchronous purpose
    pthread_t pth;
    if (pthread_create(&pth, NULL, stop_workers, (void*) this) != 0) {
        cout << "\tFailed to create thread to stop all the workers" << endl;
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0xf0, %rdi
callq 0x5b00
movq -0x20(%rbp), %rax
testb $0x1, 0x151(%rax)
je 0x5806
movq -0x20(%rbp), %rax
movb 0x150(%rax), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x57cf
jmp 0x57d1
jmp 0x57f0
leaq 0x3cc4(%rip), %rdi      # 0x949c
leaq 0x3b88(%rip), %rsi      # 0x9367
movl $0xcb, %edx
leaq 0x3cd8(%rip), %rcx      # 0x94c3
callq 0x20e0
movq -0x20(%rbp), %rdi
addq $0xf0, %rdi
callq 0x3d90
movb $0x1, -0x1(%rbp)
jmp 0x585f
movq -0x20(%rbp), %rdi
addq $0xf0, %rdi
callq 0x3d90
movq -0x20(%rbp), %rcx
leaq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq -0xc9(%rip), %rdx       # 0x5760
callq 0x22f0
cmpl $0x0, %eax
je 0x585b
movq 0x879e(%rip), %rdi      # 0xdfd8
leaq 0x3ca5(%rip), %rsi      # 0x94e6
callq 0x2180
movq %rax, %rdi
movq 0x8778(%rip), %rsi      # 0xdfc8
callq 0x21c0
movb $0x0, -0x1(%rbp)
jmp 0x585f
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/tower.cpp
// Function: Tower::draw(XInfo*, int)
void Tower::draw (XInfo *xinfo, int x) {
    int y = y_ / ScaleY;
    int height = Tower::Size::h() / ScaleY;

    // temporary fix
    // adjust y to align properly along bottom of screen
    y = xinfo->attr_.height - numBlocks_ * height;

    for (int i = 0; i < numBlocks_ ; ++i) {
        reinterpret_cast<Fill&>(*this).draw<attr::NAVAJO>(xinfo, x, y + i * height);
        Draw::draw<attr::BLACK>(xinfo, x, y + i * height);
        if (!i && hasLauncher_) {
            // draw launcher
            launcher_.draw<attr::GREY>(
                    xinfo,
                    x + ((Tower::Size::w() - MLauncher::Size::w()) / 2) / ScaleX,
                    y);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cvtsi2sdl 0x4(%rax), %xmm0
leaq 0xe9b9(%rip), %rax      # 0x13280
divsd (%rax), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x18(%rbp)
callq 0x4db0
movq -0x28(%rbp), %rcx
cvtsi2sd %eax, %xmm0
leaq 0xe99a(%rip), %rax      # 0x13280
divsd (%rax), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movl 0x8(%rcx), %ecx
imull -0x1c(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x28(%rbp), %rcx
movl -0x20(%rbp), %eax
cmpl 0x8(%rcx), %eax
jge 0x49d9
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x20(%rbp), %eax
imull -0x1c(%rbp), %eax
addl %eax, %ecx
callq 0x4dc0
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x20(%rbp), %eax
imull -0x1c(%rbp), %eax
addl %eax, %ecx
callq 0x4e00
cmpl $0x0, -0x20(%rbp)
jne 0x49c9
movq -0x28(%rbp), %rax
testb $0x1, 0xd(%rax)
je 0x49c9
movq -0x28(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
cvtsi2sdl -0x14(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
callq 0x4e80
movl %eax, -0x2c(%rbp)
callq 0x4e90
movsd -0x48(%rbp), %xmm0
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl %eax, %ecx
movl -0x2c(%rbp), %eax
subl %ecx, %eax
movl $0x2, %ecx
cltd
idivl %ecx
cvtsi2sd %eax, %xmm1
leaq 0xe8c3(%rip), %rax      # 0x13278
divsd (%rax), %xmm1
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %edx
movl -0x18(%rbp), %ecx
callq 0x4e40
jmp 0x49cb
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x490b
addq $0x50, %rsp
popq %rbp
retq
nop
// File: therealgymmy[P]HelicopterGame/src/tower.cpp
// Function: TowerList::addTower()
void TowerList::addTower () {
    int h = rand() % 10 + 1;
    int m = rand() % 5;
    bool mlauncher = false;

    if (!m) {
        mlauncher = true;
    }

    towers_.push_back(Tower(PLANE_W,
                            PLANE_H - h * Tower::Size::h(),
                            h,
                            mlauncher));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x3070
movl $0xa, %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, -0xc(%rbp)
callq 0x3070
movl $0x5, %ecx
cltd
idivl %ecx
movl %edx, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x4ad5
movb $0x1, -0x11(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x34(%rbp)
callq 0x4db0
movl %eax, %ecx
movl -0x34(%rbp), %eax
imull %ecx, %eax
movl $0xbb8, %edx            # imm = 0xBB8
subl %eax, %edx
movl -0xc(%rbp), %ecx
movb -0x11(%rbp), %al
leaq -0x24(%rbp), %rdi
movl $0xfa0, %esi            # imm = 0xFA0
andb $0x1, %al
movzbl %al, %r8d
callq 0x4860
movq -0x30(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x5090
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: therealgymmy[P]HelicopterGame/src/tower.cpp
// Function: TowerList::draw(XInfo*)
void TowerList::draw (XInfo *xinfo) {
    TowerList::Towers::iterator first = towers_.begin();
    int firstx = first->x() / Tower::ScaleX;
    int firstw = Tower::Size::w() / Tower::ScaleX;
    for (TowerList::Towers::iterator itr = towers_.begin();
         itr != towers_.end();
         ++itr) {
        itr->draw(xinfo, firstx);
        firstx += firstw;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
callq 0x4ed0
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x4f00
movq %rax, %rdi
callq 0x4f20
cvtsi2sd %eax, %xmm0
leaq 0xe71b(%rip), %rax      # 0x13278
divsd (%rax), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x1c(%rbp)
callq 0x4e80
movq -0x38(%rbp), %rdi
cvtsi2sd %eax, %xmm0
leaq 0xe6fc(%rip), %rax      # 0x13278
divsd (%rax), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x20(%rbp)
callq 0x4ed0
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rdi
callq 0x4f70
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4f40
testb $0x1, %al
jne 0x4bb0
jmp 0x4bdc
leaq -0x28(%rbp), %rdi
callq 0x4f00
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x48a0
movl -0x20(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4fa0
jmp 0x4b90
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/tower.cpp
// Function: TowerList::move()
void TowerList::move () {
    Towers::iterator last  = --towers_.end();
    Towers::iterator first = towers_.begin();
    Towers::iterator itr = towers_.begin();

    if (last->x() <= PLANE_W - Tower::Size::w()) {
        addTower();
    }

    for (; itr != towers_.end(); ++itr) {
        itr->setX(itr->x() - Tower::speed());
    }

    if (first->x() <= 0) {
        towers_.erase(first);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x4f70
movq %rax, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x4fc0
movq -0x50(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0x10(%rbp)
callq 0x4ed0
movq -0x50(%rbp), %rdi
movq %rax, -0x20(%rbp)
callq 0x4ed0
movq %rax, -0x28(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x4f00
movq %rax, %rdi
callq 0x4f20
movl %eax, -0x44(%rbp)
callq 0x4e80
movl %eax, %edx
movl -0x44(%rbp), %eax
movl $0xfa0, %ecx            # imm = 0xFA0
subl %edx, %ecx
cmpl %ecx, %eax
jg 0x4c69
movq -0x50(%rbp), %rdi
callq 0x4a90
jmp 0x4c6b
movq -0x50(%rbp), %rdi
callq 0x4f70
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x4f40
testb $0x1, %al
jne 0x4c8b
jmp 0x4cca
leaq -0x28(%rbp), %rdi
callq 0x4f00
movq %rax, -0x58(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x4f00
movq %rax, %rdi
callq 0x4f20
movl %eax, -0x5c(%rbp)
callq 0x5010
movl -0x5c(%rbp), %esi
movq -0x58(%rbp), %rdi
subl %eax, %esi
callq 0x4fe0
leaq -0x28(%rbp), %rdi
callq 0x4fa0
jmp 0x4c6b
leaq -0x20(%rbp), %rdi
callq 0x4f00
movq %rax, %rdi
callq 0x4f20
cmpl $0x0, %eax
jg 0x4cfe
leaq -0x38(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x5070
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x5020
movq %rax, -0x40(%rbp)
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/tower.cpp
// Function: TowerList::fire(MissileList&)
void TowerList::fire (MissileList &mlist) {
    for (Towers::iterator itr = towers_.begin();
         itr != towers_.end();
         ++itr) {
        if (itr->hasLauncher() && !(rand() % 100)) {
            itr->fire(mlist);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x28(%rbp)
callq 0x4ed0
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4f70
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x4f40
testb $0x1, %al
jne 0x4d51
jmp 0x4d9c
leaq -0x18(%rbp), %rdi
callq 0x4f00
movq %rax, %rdi
callq 0x50d0
testb $0x1, %al
jne 0x4d68
jmp 0x4d8f
callq 0x3070
movl $0x64, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x4d8f
leaq -0x18(%rbp), %rdi
callq 0x4f00
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x49e0
jmp 0x4d91
leaq -0x18(%rbp), %rdi
callq 0x4fa0
jmp 0x4d31
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: therealgymmy[P]HelicopterGame/src/attributes_impl.h
// Function: void Attributes::DrawableImpl<Tower, Attributes::Rectangle>::drawImpl<(Attributes::Color)7>(XInfo*, int, int, int (*)(_XDisplay*, unsigned long, _XGC*, int, int, unsigned int, unsigned int))
void drawImpl (XInfo *xinfo, int x, int y, Draw draw) {
        Display *display = xinfo->display_;
        Pixmap   buffer  = xinfo->buffer_;
        GC       gcColor = pickColor(xinfo, color);

        draw(display, buffer, gcColor,
             x,
             y,
             self.w() / ScaleX,
             self.h() / ScaleY);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0xa0(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rsi
movl $0x7, %edx
callq 0x5270
movq -0x70(%rbp), %rdi
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x48(%rbp)
callq 0x53e0
callq 0x4e80
movq -0x70(%rbp), %rdi
cvtsi2sd %eax, %xmm0
leaq 0xe06e(%rip), %rax      # 0x13278
movsd (%rax), %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movl %eax, -0x44(%rbp)
callq 0x53e0
callq 0x4db0
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movl -0x4c(%rbp), %ecx
movl -0x48(%rbp), %r8d
movl -0x44(%rbp), %r9d
movl %eax, %r10d
movq -0x40(%rbp), %rax
cvtsi2sd %r10d, %xmm0
leaq 0xe032(%rip), %r10      # 0x13280
movsd (%r10), %xmm1
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %r10
movl %r10d, (%rsp)
callq *%rax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/attributes_impl.h
// Function: Attributes::DrawableBase::pickColor(XInfo*, Attributes::Color)
GC pickColor (XInfo *xinfo, Color color) {
        switch (color) {
            case BLACK:
                return xinfo->black_;
            case WHITE:
                return xinfo->white_;
            case GREY:
                return xinfo->grey_;
            case GREEN:
                return xinfo->green_;
            case BROWN:
                return xinfo->brown_;
            case RED:
                return xinfo->red_;
            case BLUE:
                return xinfo->blue_;
            case NAVAJO:
                return xinfo->navajo_;
            default:
                error("Unknown Color");
                return xinfo->white_;       // should never reach here
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq %rax, -0x60(%rbp)
subq $0x7, %rax
ja 0x5345
movq -0x60(%rbp), %rax
leaq 0x7d65(%rip), %rcx      # 0xd004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movq 0xa8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x53c4
movq -0x18(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x53c4
movq -0x18(%rbp), %rax
movq 0xb8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x53c4
movq -0x18(%rbp), %rax
movq 0xc0(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x53c4
movq -0x18(%rbp), %rax
movq 0xc8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x53c4
movq -0x18(%rbp), %rax
movq 0xd0(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x53c4
movq -0x18(%rbp), %rax
movq 0xd8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x53c4
movq -0x18(%rbp), %rax
movq 0xe0(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x53c4
leaq -0x41(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x3410
movq -0x68(%rbp), %rdx
leaq 0x7ccf(%rip), %rsi      # 0xd02c
leaq -0x40(%rbp), %rdi
callq 0x5430
jmp 0x5368
leaq -0x40(%rbp), %rdi
callq 0x53f0
jmp 0x5373
leaq -0x40(%rbp), %rdi
callq 0x3120
leaq -0x41(%rbp), %rdi
callq 0x3290
movq -0x18(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x53c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x53b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3120
leaq -0x41(%rbp), %rdi
callq 0x3290
jmp 0x53ce
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3400
nopw (%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/x_handler.cpp
// Function: XHandler::draw()
void XHandler::draw () {
    if (!showCredit_) {
        drawBombs();
        drawHeli();
        drawTowers();
        drawMissiles();
        drawExplosions();

        drawHealthBar();
        drawScore();
    }
    else {
        drawCredits();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
testb $0x1, 0xf0(%rax)
jne 0x66be
movq -0x10(%rbp), %rdi
callq 0x66d0
movq -0x10(%rbp), %rdi
callq 0x6700
movq -0x10(%rbp), %rdi
callq 0x6730
movq -0x10(%rbp), %rdi
callq 0x6760
movq -0x10(%rbp), %rdi
callq 0x6790
movq -0x10(%rbp), %rdi
callq 0x67c0
movq -0x10(%rbp), %rdi
callq 0x67f0
jmp 0x66c7
movq -0x10(%rbp), %rdi
callq 0x6820
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: therealgymmy[P]HelicopterGame/src/x_handler.cpp
// Function: XHandler::updateAttr(XWindowAttributes*)
void XHandler::updateAttr (XWindowAttributes *attr) {
    xinfo_.attr_ = *attr;

    int depth = DefaultDepth(xinfo_.display_, xinfo_.screen_);
    XFreePixmap(xinfo_.display_, xinfo_.buffer_);
    xinfo_.buffer_ = XCreatePixmap(
            xinfo_.display_, xinfo_.window_,
            attr->width, attr->height, depth);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
movq -0x10(%rbp), %rsi
addq $0x8, %rdi
addq $0x18, %rdi
movl $0x88, %edx
callq 0x31b0
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq 0xe8(%rcx), %rcx
movslq 0x10(%rax), %rdx
shlq $0x7, %rdx
addq %rdx, %rcx
movl 0x38(%rcx), %ecx
movl %ecx, -0x14(%rbp)
movq 0x8(%rax), %rdi
movq 0xa8(%rax), %rsi
callq 0x3430
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edx
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movl -0x14(%rbp), %r8d
callq 0x3060
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0xa8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/x_handler.cpp
// Function: XHandler::refresh()
void XHandler::refresh () {
    Display           *display = xinfo_.display_;
    Window            &window  = xinfo_.window_;
    Pixmap            &buffer  = xinfo_.buffer_;
    GC                &draw    = xinfo_.black_;
    GC                &erase   = xinfo_.blue_;
    XWindowAttributes &attr    = xinfo_.attr_;

    unsigned int winW = attr.width;
    unsigned int winH = attr.height;

    XCopyArea(display, buffer, window, draw, 0, 0, winW, winH, 0, 0);
    XFlush(display);

    // clear buffer
    XFillRectangle(display, buffer, erase, 0, 0, winW, winH);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x10(%rbp)
movq %rax, %rcx
addq $0x8, %rcx
addq $0x10, %rcx
movq %rcx, -0x18(%rbp)
movq %rax, %rcx
addq $0x8, %rcx
addq $0xa0, %rcx
movq %rcx, -0x20(%rbp)
movq %rax, %rcx
addq $0x8, %rcx
addq $0xa8, %rcx
movq %rcx, -0x28(%rbp)
movq %rax, %rcx
addq $0x8, %rcx
addq $0xd8, %rcx
movq %rcx, -0x30(%rbp)
addq $0x8, %rax
addq $0x18, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movl -0x3c(%rbp), %r10d
movl -0x40(%rbp), %eax
xorl %r9d, %r9d
movl %r9d, %r8d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
callq 0x30f0
movq -0x10(%rbp), %rdi
callq 0x33a0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
movq -0x30(%rbp), %rax
movq (%rax), %rdx
movl -0x3c(%rbp), %r9d
movl -0x40(%rbp), %eax
xorl %r8d, %r8d
movl %r8d, %ecx
movl %eax, (%rsp)
callq 0x3498
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: therealgymmy[P]HelicopterGame/src/x_handler.cpp
// Function: render(RenderArg*)
void render (RenderArg *renderArg) {
    XHandler *xhandler  = renderArg->xhandler_;
    pthread_mutex_t *mutex = renderArg->mutex_;

    while (true) {
        if (pthread_mutex_lock(mutex) == -1) {
            error("cannot lock mutex in render thread");
        }

        xhandler->draw();

        if (pthread_mutex_unlock(mutex) == -1) {
            error("cannot unlock mutex in render thread");
        }

        xhandler->refresh();
        usleep(1000 * REFRESH_RATE);
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3360
cmpl $-0x1, %eax
jne 0x7788
leaq -0x39(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x3410
movq -0x80(%rbp), %rdx
leaq 0x5ac3(%rip), %rsi      # 0xd1f0
leaq -0x38(%rbp), %rdi
callq 0x5430
jmp 0x7738
leaq -0x38(%rbp), %rdi
callq 0x53f0
jmp 0x7743
leaq -0x38(%rbp), %rdi
callq 0x3120
leaq -0x39(%rbp), %rdi
callq 0x3290
jmp 0x7788
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x777a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x3120
leaq -0x39(%rbp), %rdi
callq 0x3290
jmp 0x782d
movq -0x10(%rbp), %rdi
callq 0x6660
movq -0x18(%rbp), %rdi
callq 0x3180
cmpl $-0x1, %eax
jne 0x7815
leaq -0x71(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x3410
movq -0x88(%rbp), %rdx
leaq 0x5a56(%rip), %rsi      # 0xd213
leaq -0x70(%rbp), %rdi
callq 0x5430
jmp 0x77c8
leaq -0x70(%rbp), %rdi
callq 0x53f0
jmp 0x77d3
leaq -0x70(%rbp), %rdi
callq 0x3120
leaq -0x71(%rbp), %rdi
callq 0x3290
jmp 0x7815
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x780a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x3120
leaq -0x71(%rbp), %rdi
callq 0x3290
jmp 0x782d
movq -0x10(%rbp), %rdi
callq 0x75c0
movl $0x3a98, %edi           # imm = 0x3A98
callq 0x3330
jmp 0x7707
movq -0x48(%rbp), %rdi
callq 0x3400
nopw %cs:(%rax,%rax)