LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: CMU-SAFARI[P]MQSim/src/ssd/Queue_Probe.cpp
// Function: SSD_Components::Queue_Probe::STDevQueueLength()
double Queue_Probe::STDevQueueLength()
	{
		sim_time_type sum = 0;
		for (unsigned int len = 0; len < states.size(); len++) {
			sum += states[len].totalTime * len;
		}
		double mean = (double)sum / (double)Simulator->Time();
		double stdev = 0.0;
		for (unsigned int len = 0; len < states.size(); len++) {
			stdev += std::pow((double)states[len].totalTime * len / (double)Simulator->Time() - mean, 2);
		}

		return std::sqrt(stdev);
	}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x60(%rsp)
movq $0x0, 0x88(%rsp)
movl $0x0, 0x84(%rsp)
movq 0x60(%rsp), %rdi
movl 0x84(%rsp), %eax
movq %rax, 0x58(%rsp)
addq $0x50, %rdi
callq 0x98660
movq %rax, %rcx
movq 0x58(%rsp), %rax
cmpq %rcx, %rax
jae 0x98213
movq 0x60(%rsp), %rdi
addq $0x50, %rdi
movl 0x84(%rsp), %eax
movl %eax, %esi
callq 0x98640
movq 0x8(%rax), %rax
movl 0x84(%rsp), %ecx
imulq %rcx, %rax
addq 0x88(%rsp), %rax
movq %rax, 0x88(%rsp)
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0x981a3
movq 0x88(%rsp), %xmm0
movaps 0x1378d(%rip), %xmm1    # 0xab9b0
movaps %xmm1, 0x30(%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x1378c(%rip), %xmm1    # 0xab9c0
movaps %xmm1, 0x40(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movaps 0x30(%rsp), %xmm3
movaps 0x40(%rsp), %xmm2
movsd 0x50(%rsp), %xmm0
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x78(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x70(%rsp)
movl $0x0, 0x6c(%rsp)
movq 0x60(%rsp), %rdi
movl 0x6c(%rsp), %eax
movq %rax, 0x28(%rsp)
addq $0x50, %rdi
callq 0x98660
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0x98381
movq 0x60(%rsp), %rdi
addq $0x50, %rdi
movl 0x6c(%rsp), %eax
movl %eax, %esi
callq 0x98640
movq 0x8(%rax), %xmm0
movaps 0x136ca(%rip), %xmm1    # 0xab9b0
movaps %xmm1, (%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x136ca(%rip), %xmm1    # 0xab9c0
movaps %xmm1, 0x10(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movl 0x6c(%rsp), %eax
cvtsi2sd %rax, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movaps (%rsp), %xmm3
movaps 0x10(%rsp), %xmm2
movsd 0x20(%rsp), %xmm0
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
subsd 0x78(%rsp), %xmm0
movl $0x2, %edi
callq 0x98780
addsd 0x70(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
jmp 0x9829e
movsd 0x70(%rsp), %xmm0
callq 0x8360
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Queue_Probe.cpp
// Function: SSD_Components::Queue_Probe::AvgQueueLengthEpoch()
double Queue_Probe::AvgQueueLengthEpoch()
	{
		sim_time_type sum = 0;
		sim_time_type sumTime = 0;
		for (unsigned int len = 0; len < states.size(); len++) {
			sum += statesEpoch[len].totalTime * len;
			sumTime += statesEpoch[len].totalTime;
		}

		return (double)sum / (double)(Simulator->Time() - epochStartTime);
	}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x0, 0x3c(%rsp)
movq 0x30(%rsp), %rdi
movl 0x3c(%rsp), %eax
movq %rax, 0x28(%rsp)
addq $0x50, %rdi
callq 0x98660
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0x9844a
movq 0x30(%rsp), %rdi
addq $0x68, %rdi
movl 0x3c(%rsp), %eax
movl %eax, %esi
callq 0x98640
movq 0x30(%rsp), %rdi
movq 0x8(%rax), %rax
movl 0x3c(%rsp), %ecx
imulq %rcx, %rax
addq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
addq $0x68, %rdi
movl 0x3c(%rsp), %eax
movl %eax, %esi
callq 0x98640
movq 0x8(%rax), %rax
addq 0x40(%rsp), %rax
movq %rax, 0x40(%rsp)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x983cd
movq 0x48(%rsp), %xmm0
movaps 0x13559(%rip), %xmm1    # 0xab9b0
movaps %xmm1, (%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x13559(%rip), %xmm1    # 0xab9c0
movaps %xmm1, 0x10(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq 0x30(%rsp), %rcx
movaps (%rsp), %xmm3
movaps 0x10(%rsp), %xmm2
movsd 0x20(%rsp), %xmm0
movq 0x48(%rcx), %rcx
subq %rcx, %rax
movq %rax, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
addq $0x58, %rsp
retq
nopw (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Stats.cpp
// Function: SSD_Components::Stats::Clear_stats(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
void Stats::Clear_stats(unsigned int channel_no, unsigned int chip_no_per_channel, unsigned int die_no_per_chip, unsigned int plane_no_per_die,
		unsigned int block_no_per_plane, unsigned int page_no_per_block, unsigned int max_allowed_block_erase_count)
	{
		for (unsigned int channel_cntr = 0; channel_cntr < channel_no; channel_cntr++) {
			for (unsigned int chip_cntr = 0; chip_cntr < chip_no_per_channel; chip_cntr++) {
				for (unsigned int die_cntr = 0; die_cntr < die_no_per_chip; die_cntr++) {
					for (unsigned int plane_cntr = 0; plane_cntr < plane_no_per_die; plane_cntr++) {
						delete[] Block_erase_histogram[channel_cntr][chip_cntr][die_cntr][plane_cntr];
					}
					delete[] Block_erase_histogram[channel_cntr][chip_cntr][die_cntr];
				}
				delete[] Block_erase_histogram[channel_cntr][chip_cntr];
			}
			delete[] Block_erase_histogram[channel_cntr];
		}
		delete[] Block_erase_histogram;
	}

// Assembly:
subq $0x58, %rsp
movl 0x60(%rsp), %eax
movl %edi, 0x54(%rsp)
movl %esi, 0x50(%rsp)
movl %edx, 0x4c(%rsp)
movl %ecx, 0x48(%rsp)
movl %r8d, 0x44(%rsp)
movl %r9d, 0x40(%rsp)
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
cmpl 0x54(%rsp), %eax
jae 0x9ae6b
movl $0x0, 0x38(%rsp)
movl 0x38(%rsp), %eax
cmpl 0x50(%rsp), %eax
jae 0x9ae35
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jae 0x9adf7
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
cmpl 0x48(%rsp), %eax
jae 0x9adb1
movq 0x40a83(%rip), %rax     # 0xdb7f0
movl 0x3c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x38(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x34(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x30(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x9ada2
movq 0x28(%rsp), %rdi
callq 0x8570
jmp 0x9ada4
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x9ad5c
movq 0x40a38(%rip), %rax     # 0xdb7f0
movl 0x3c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x38(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x34(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x9ade5
movq 0x20(%rsp), %rdi
callq 0x8570
jmp 0x9ade7
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x9ad46
movq 0x409f2(%rip), %rax     # 0xdb7f0
movl 0x3c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x38(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x9ae23
movq 0x18(%rsp), %rdi
callq 0x8570
jmp 0x9ae25
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x9ad30
movq 0x409b4(%rip), %rax     # 0xdb7f0
movl 0x3c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x9ae59
movq 0x10(%rsp), %rdi
callq 0x8570
jmp 0x9ae5b
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x9ad1a
movq 0x4097e(%rip), %rax     # 0xdb7f0
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x9ae87
movq 0x8(%rsp), %rdi
callq 0x8570
addq $0x58, %rsp
retq
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/TSU_Base.cpp
// Function: SSD_Components::TSU_Base::Setup_triggers()
void TSU_Base::Setup_triggers()
	{
		Sim_Object::Setup_triggers();
		_NVMController->ConnectToTransactionServicedSignal(handle_transaction_serviced_signal_from_PHY);
		_NVMController->ConnectToChannelIdleSignal(handle_channel_idle_signal);
		_NVMController->ConnectToChipIdleSignal(handle_chip_idle_signal);
	}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x205c0
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
leaq 0x38(%rip), %rsi        # 0x9b170
callq 0x8bc50
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
leaq 0x33(%rip), %rsi        # 0x9b180
callq 0x8bd20
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
leaq 0xee(%rip), %rsi        # 0x9b250
callq 0x8bdd0
addq $0x18, %rsp
retq
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/TSU_Base.cpp
// Function: SSD_Components::TSU_Base::handle_channel_idle_signal(unsigned int)
void TSU_Base::handle_channel_idle_signal(flash_channel_ID_type channelID)
	{
		for (unsigned int i = 0; i < _my_instance->chip_no_per_channel; i++) {
			//The TSU does not check if the chip is idle or not since it is possible to suspend a busy chip and issue a new command
			_my_instance->process_chip_requests(_my_instance->_NVMController->Get_chip(channelID, _my_instance->Round_robin_turn_of_channel[channelID]));
			_my_instance->Round_robin_turn_of_channel[channelID] = (flash_chip_ID_type)(_my_instance->Round_robin_turn_of_channel[channelID] + 1) % _my_instance->chip_no_per_channel;

			//A transaction has been started, so TSU should stop searching for another chip
			if (_my_instance->_NVMController->Get_channel_status(channelID) == BusChannelStatus::BUSY) {
				break;
			}
		}
	}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
movq 0x43abd(%rip), %rcx     # 0xdec58
cmpl 0x48(%rcx), %eax
jae 0x9b245
movq 0x43aad(%rip), %rax     # 0xdec58
movq %rax, 0x8(%rsp)
movq 0x43aa1(%rip), %rax     # 0xdec58
movq 0x38(%rax), %rdi
movl 0x14(%rsp), %esi
movq 0x43a92(%rip), %rax     # 0xdec58
movq 0x70(%rax), %rax
movl 0x14(%rsp), %ecx
movl (%rax,%rcx,4), %edx
movq (%rdi), %rax
callq *0x30(%rax)
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x9b780
movq 0x43a6d(%rip), %rax     # 0xdec58
movq 0x70(%rax), %rax
movl 0x14(%rsp), %ecx
movl (%rax,%rcx,4), %eax
addl $0x1, %eax
movq 0x43a58(%rip), %rcx     # 0xdec58
xorl %edx, %edx
divl 0x48(%rcx)
movq 0x43a4c(%rip), %rax     # 0xdec58
movq 0x70(%rax), %rax
movl 0x14(%rsp), %ecx
movl %edx, (%rax,%rcx,4)
movq 0x43a3a(%rip), %rax     # 0xdec58
movq 0x38(%rax), %rdi
movl 0x14(%rsp), %esi
movq (%rdi), %rax
callq *0x28(%rax)
cmpl $0x0, %eax
jne 0x9b233
jmp 0x9b245
jmp 0x9b235
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x9b190
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/TSU_Base.h
// Function: SSD_Components::TSU_Base::transaction_is_ready(SSD_Components::NVM_Transaction_Flash*)
bool transaction_is_ready(NVM_Transaction_Flash* transaction)
	{
		switch (transaction->Type)
		{
		case Transaction_Type::READ:
			return true;
		case Transaction_Type::WRITE:
			return static_cast<NVM_Transaction_Flash_WR*>(transaction)->RelatedRead == NULL;
		case Transaction_Type::ERASE:
			return static_cast<NVM_Transaction_Flash_ER*>(transaction)->Page_movement_activities.size() == 0;
		default:
			return true;
		}
	}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x9b816
jmp 0x9b800
movl 0xc(%rsp), %eax
subl $0x1, %eax
je 0x9b81d
jmp 0x9b80b
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x9b835
jmp 0x9b855
movb $0x1, 0x27(%rsp)
jmp 0x9b85a
movq 0x10(%rsp), %rax
cmpq $0x0, 0x88(%rax)
sete %al
andb $0x1, %al
movb %al, 0x27(%rsp)
jmp 0x9b85a
movq 0x10(%rsp), %rdi
addq $0x80, %rdi
callq 0x9b870
cmpq $0x0, %rax
sete %al
andb $0x1, %al
movb %al, 0x27(%rsp)
jmp 0x9b85a
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: CMU-SAFARI[P]MQSim/src/ssd/TSU_OutofOrder.cpp
// Function: SSD_Components::TSU_OutOfOrder::service_erase_transaction(NVM::FlashMemory::Flash_Chip*)
bool TSU_OutOfOrder::service_erase_transaction(NVM::FlashMemory::Flash_Chip *chip)
{
	if (_NVMController->GetChipStatus(chip) != ChipStatus::IDLE)
	{
		return false;
	}

	Flash_Transaction_Queue *source_queue = &GCEraseTRQueue[chip->ChannelID][chip->ChipID];
	if (source_queue->size() == 0)
	{
		return false;
	}

	issue_command_to_chip(source_queue, NULL, Transaction_Type::ERASE, false);

	return true;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
movq 0x38(%rax), %rdi
movq 0x10(%rsp), %rsi
movq (%rdi), %rax
callq *0x48(%rax)
cmpl $0x0, %eax
je 0x9f452
movb $0x0, 0x27(%rsp)
jmp 0x9f4ba
movq (%rsp), %rax
movq 0xd0(%rax), %rax
movq 0x10(%rsp), %rcx
movl 0x2c(%rcx), %ecx
movq (%rax,%rcx,8), %rax
movq 0x10(%rsp), %rcx
movl 0x30(%rcx), %ecx
imulq $0x108, %rcx, %rcx      # imm = 0x108
addq %rcx, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
callq 0x91c80
cmpq $0x0, %rax
jne 0x9f49b
movb $0x0, 0x27(%rsp)
jmp 0x9f4ba
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
xorl %eax, %eax
movl %eax, %edx
movl $0x2, %ecx
xorl %r8d, %r8d
callq 0x9b2a0
movb $0x1, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
nop
// File: CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe_Priorities.h
// Function: IO_Flow_Priority_Class::get_scheduling_weight(IO_Flow_Priority_Class::Priority)
static int get_scheduling_weight(Priority priority)
    {
        switch (priority)
        {
        case URGENT:
            return INT32_MAX;
        case HIGH:
            return 4;
        case MEDIUM:
            return 2;
        case LOW:
            return 1;
        default:
            return 0;
        }
    }

// Assembly:
movl %edi, -0x8(%rsp)
movl -0x8(%rsp), %eax
movq %rax, -0x10(%rsp)
subq $0x3, %rax
ja 0xa3e90
movq -0x10(%rsp), %rax
leaq 0xabd5(%rip), %rcx      # 0xaea34
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x7fffffff, -0x4(%rsp) # imm = 0x7FFFFFFF
jmp 0xa3e98
movl $0x4, -0x4(%rsp)
jmp 0xa3e98
movl $0x2, -0x4(%rsp)
jmp 0xa3e98
movl $0x1, -0x4(%rsp)
jmp 0xa3e98
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe_Priorities.h
// Function: IO_Flow_Priority_Class::to_priority(int)
static Priority to_priority(int priorityInt)
    {
        switch (priorityInt)
        {
        case 0:
            return URGENT;
        case 1:
            return HIGH;
        case 2:
            return MEDIUM;
        case 3:
            return LOW;
        default:
            throw std::invalid_argument("Priority level integer value");
        }
    }

// Assembly:
subq $0x28, %rsp
movl %edi, 0x20(%rsp)
movl 0x20(%rsp), %eax
movq %rax, 0x8(%rsp)
subq $0x3, %rax
ja 0xa3f24
movq 0x8(%rsp), %rax
leaq 0xab51(%rip), %rcx      # 0xaea44
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, 0x24(%rsp)
jmp 0xa3f76
movl $0x1, 0x24(%rsp)
jmp 0xa3f76
movl $0x2, 0x24(%rsp)
jmp 0xa3f76
movl $0x3, 0x24(%rsp)
jmp 0xa3f76
movl $0x10, %edi
callq 0x8200
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
leaq 0xab8b(%rip), %rsi      # 0xaeaca
callq 0x87d0
jmp 0xa3f46
movq (%rsp), %rdi
movq 0x36077(%rip), %rsi     # 0xd9fc8
movq 0x36058(%rip), %rdx     # 0xd9fb0
callq 0x8710
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
callq 0x8330
jmp 0xa3f7f
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0x8770
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Host_Interface_NVMe_Priorities.h
// Function: IO_Flow_Priority_Class::to_string[abi:cxx11](IO_Flow_Priority_Class::Priority)
static std::string to_string(Priority priority)
    {
        switch (priority)
        {
        case URGENT:
            return "URGENT";
        case HIGH:
            return "HIGH";
        case MEDIUM:
            return "MEDIUM";
        case LOW:
            return "LOW";
        default:
            return "";
        }
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x30(%rsp)
movq %rdi, %rax
movq %rax, 0x38(%rsp)
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movl 0x5c(%rsp), %eax
movq %rax, 0x40(%rsp)
subq $0x3, %rax
ja 0xa4118
movq 0x40(%rsp), %rax
leaq 0xaa8b(%rip), %rcx      # 0xaea54
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x5b(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x8780
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %rdx
leaq 0x7303(%rip), %rsi      # 0xab2f5
callq 0x85d0
jmp 0xa3ff9
leaq 0x5b(%rsp), %rdi
callq 0x84a0
jmp 0xa4165
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x5b(%rsp), %rdi
callq 0x84a0
jmp 0xa416f
leaq 0x4b(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x8780
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rdx
leaq 0x72b7(%rip), %rsi      # 0xab2fc
callq 0x85d0
jmp 0xa404c
leaq 0x4b(%rsp), %rdi
callq 0x84a0
jmp 0xa4165
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x4b(%rsp), %rdi
callq 0x84a0
jmp 0xa416f
leaq 0x4a(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x8780
movq 0x30(%rsp), %rdi
movq 0x18(%rsp), %rdx
leaq 0x7269(%rip), %rsi      # 0xab301
callq 0x85d0
jmp 0xa409f
leaq 0x4a(%rsp), %rdi
callq 0x84a0
jmp 0xa4165
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x4a(%rsp), %rdi
callq 0x84a0
jmp 0xa416f
leaq 0x49(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x8780
movq 0x30(%rsp), %rdi
movq 0x10(%rsp), %rdx
leaq 0x721d(%rip), %rsi      # 0xab308
callq 0x85d0
jmp 0xa40f2
leaq 0x49(%rsp), %rdi
callq 0x84a0
jmp 0xa4165
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x49(%rsp), %rdi
callq 0x84a0
jmp 0xa416f
leaq 0x48(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x8780
movq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rdx
leaq 0x7947(%rip), %rsi      # 0xaba7f
callq 0x85d0
jmp 0xa413f
leaq 0x48(%rsp), %rdi
callq 0x84a0
jmp 0xa4165
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x84a0
jmp 0xa416f
movq 0x38(%rsp), %rax
addq $0x68, %rsp
retq
movq 0x50(%rsp), %rdi
callq 0x8770
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/CMRRandomGenerator.cpp
// Function: Utils::CMRRandomGenerator::CMRRandomGenerator(long, int)
CMRRandomGenerator::CMRRandomGenerator(int64_t n, int32_t e)
	{
		for (int i = 0; i <= 1; i++) {
			for (int j = 0; j <= 2; j++) {
				s[i][j] = init_s[i][j];
			}
		}
		Advance(n, e);
	}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl %edx, 0x14(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movl $0x0, 0x10(%rsp)
cmpl $0x1, 0x10(%rsp)
jg 0xa42fc
movl $0x0, 0xc(%rsp)
cmpl $0x2, 0xc(%rsp)
jg 0xa42ed
movq (%rsp), %rax
movslq 0x10(%rsp), %rdx
leaq 0x36307(%rip), %rcx     # 0xda5c0
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0xc(%rsp), %rdx
movsd (%rcx,%rdx,8), %xmm0
movslq 0x10(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0xc(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xa42a2
jmp 0xa42ef
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0xa4293
movq (%rsp), %rdi
movq 0x18(%rsp), %rsi
movl 0x14(%rsp), %edx
callq 0xa4320
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/CMRRandomGenerator.cpp
// Function: Utils::CMRRandomGenerator::NextDouble()
double CMRRandomGenerator::NextDouble()
	{
		double p1 = mod(a12 * s[0][1] + a13 * s[0][0], m1);
		s[0][0] = s[0][1];
		s[0][1] = s[0][2];
		s[0][2] = p1;
		double p2 = mod(a21 * s[1][2] + a23 * s[1][0], m2);
		s[1][0] = s[1][1];
		s[1][1] = s[1][2];
		s[1][2] = p2;
		double p = p1 - p2;
		if (p < 0.0) {
			p += m1;
		}

		return (p + 1) * norm;
	}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movsd 0x35fae(%rip), %xmm0    # 0xda598
movsd 0x8(%rax), %xmm2
movsd 0x35fa9(%rip), %xmm1    # 0xda5a0
mulsd (%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x35f7d(%rip), %xmm1    # 0xda588
callq 0xa4a30
movq (%rsp), %rax
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, (%rax)
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
movsd 0x35f68(%rip), %xmm0    # 0xda5a8
movsd 0x28(%rax), %xmm2
movsd 0x35f63(%rip), %xmm1    # 0xda5b0
mulsd 0x18(%rax), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x35f2e(%rip), %xmm1    # 0xda590
callq 0xa4a30
movq (%rsp), %rax
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x18(%rax)
movsd 0x28(%rax), %xmm0
movsd %xmm0, 0x20(%rax)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x28(%rax)
movsd 0x18(%rsp), %xmm0
subsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
ucomisd 0x8(%rsp), %xmm0
jbe 0xa46c1
movsd 0x35ed3(%rip), %xmm0    # 0xda588
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x75f7(%rip), %xmm0     # 0xabcc0
addsd 0x8(%rsp), %xmm0
mulsd 0x35ea9(%rip), %xmm0    # 0xda580
addq $0x28, %rsp
retq
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/CMRRandomGenerator.h
// Function: Utils::CMRRandomGenerator::mm_mul(long (*) [3], long (*) [3], long (*) [3], long)
static void mm_mul(int64_t a[][3], int64_t b[][3], int64_t c[][3], int64_t m)
			{
				int64_t d [3][3];

				for (int i = 0; i <= 2; i++) {
					for (int j = 0; j <= 2; j++) {
						d[i][j] = 0;
						for (int k = 0; k <= 2; k++) {
							d[i][j] = (a[i][k] * b[k][j] + d[i][j]) % m;
						}
					}
				}
				m_copy(d, c);
			}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x2, 0xc(%rsp)
jg 0xa48f3
movl $0x0, 0x8(%rsp)
cmpl $0x2, 0x8(%rsp)
jg 0xa48e1
movslq 0xc(%rsp), %rcx
leaq 0x10(%rsp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x8(%rsp), %rcx
movq $0x0, (%rax,%rcx,8)
movl $0x0, 0x4(%rsp)
cmpl $0x2, 0x4(%rsp)
jg 0xa48cf
movq 0x70(%rsp), %rax
movslq 0xc(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rsp), %rcx
movslq 0x4(%rsp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x8(%rsp), %rdx
imulq (%rcx,%rdx,8), %rax
movslq 0xc(%rsp), %rdx
leaq 0x10(%rsp), %rcx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movslq 0x8(%rsp), %rdx
addq (%rcx,%rdx,8), %rax
cqto
idivq 0x58(%rsp)
movslq 0xc(%rsp), %rcx
leaq 0x10(%rsp), %rax
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x8(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xa4844
jmp 0xa48d1
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xa4813
jmp 0xa48e3
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xa4800
leaq 0x10(%rsp), %rdi
movq 0x60(%rsp), %rsi
callq 0xa4b00
addq $0x78, %rsp
retq
nopw (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/CMRRandomGenerator.h
// Function: Utils::CMRRandomGenerator::mv_mul(long (*) [3], long*, long*, long)
static void mv_mul(int64_t a[][3], int64_t* u, int64_t* v, int64_t m)
			{
				int64_t w[3];
				for (int i = 0; i <= 2; i++) {
					w[i] = 0;
					for (int j = 0; j <= 2; j++) {
						w[i] = (a[i][j] * u[j] + w[i]) % m;
					}
				}
				v_copy(w, v);
			}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movl $0x0, 0xc(%rsp)
cmpl $0x2, 0xc(%rsp)
jg 0xa49bb
movslq 0xc(%rsp), %rax
movq $0x0, 0x10(%rsp,%rax,8)
movl $0x0, 0x8(%rsp)
cmpl $0x2, 0x8(%rsp)
jg 0xa49a9
movq 0x40(%rsp), %rax
movslq 0xc(%rsp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq 0x8(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rsp), %rcx
movslq 0x8(%rsp), %rdx
imulq (%rcx,%rdx,8), %rax
movslq 0xc(%rsp), %rcx
addq 0x10(%rsp,%rcx,8), %rax
cqto
idivq 0x28(%rsp)
movslq 0xc(%rsp), %rax
movq %rdx, 0x10(%rsp,%rax,8)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xa4951
jmp 0xa49ab
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xa4930
leaq 0x10(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0xa4b80
addq $0x48, %rsp
retq
nop
// File: CMU-SAFARI[P]MQSim/src/utils/CMRRandomGenerator.h
// Function: Utils::CMRRandomGenerator::mod(double, double)
static double mod(double x, double m)
			{
				int64_t k = (int64_t)(x / m);
				x -= (double)k * m;
				if (x < 0.0) {
					x += m;
				}
				return x;
			}

// Assembly:
movsd %xmm0, -0x8(%rsp)
movsd %xmm1, -0x10(%rsp)
movsd -0x8(%rsp), %xmm0
divsd -0x10(%rsp), %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x18(%rsp)
cvtsi2sdq -0x18(%rsp), %xmm0
movsd -0x10(%rsp), %xmm2
movsd -0x8(%rsp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
xorps %xmm0, %xmm0
ucomisd -0x8(%rsp), %xmm0
jbe 0xa4aa7
movsd -0x10(%rsp), %xmm0
addsd -0x8(%rsp), %xmm0
movsd %xmm0, -0x8(%rsp)
movsd -0x8(%rsp), %xmm0
retq
nop
// File: CMU-SAFARI[P]MQSim/src/utils/Helper_Functions.cpp
// Function: Utils::Combination_count(double, double)
double Combination_count(double n, double k)
	{
		if (k > n) {
			return 0;
		}
		
		if (k * 2 > n) {
			k = n - k;
		}

		if (k == 0) {
			return 1;
		}

		double result = n;
		for (int i = 2; i <= k; ++i) {
			result *= (n - i + 1);
			result /= i;
		}

		return result;
	}

// Assembly:
movsd %xmm0, -0x10(%rsp)
movsd %xmm1, -0x18(%rsp)
movsd -0x18(%rsp), %xmm0
ucomisd -0x10(%rsp), %xmm0
jbe 0xa4c18
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0xa4cde
movsd 0x8720(%rip), %xmm0     # 0xad340
mulsd -0x18(%rsp), %xmm0
ucomisd -0x10(%rsp), %xmm0
jbe 0xa4c40
movsd -0x10(%rsp), %xmm0
subsd -0x18(%rsp), %xmm0
movsd %xmm0, -0x18(%rsp)
movsd -0x18(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xa4c61
jp 0xa4c61
movsd 0x7067(%rip), %xmm0     # 0xabcc0
movsd %xmm0, -0x8(%rsp)
jmp 0xa4cde
movsd -0x10(%rsp), %xmm0
movsd %xmm0, -0x20(%rsp)
movl $0x2, -0x24(%rsp)
cvtsi2sdl -0x24(%rsp), %xmm1
movsd -0x18(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0xa4cd2
movsd -0x10(%rsp), %xmm0
cvtsi2sdl -0x24(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd 0x7021(%rip), %xmm1     # 0xabcc0
addsd %xmm1, %xmm0
mulsd -0x20(%rsp), %xmm0
movsd %xmm0, -0x20(%rsp)
cvtsi2sdl -0x24(%rsp), %xmm1
movsd -0x20(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rsp)
movl -0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rsp)
jmp 0xa4c75
movsd -0x20(%rsp), %xmm0
movsd %xmm0, -0x8(%rsp)
movsd -0x8(%rsp), %xmm0
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/Logical_Address_Partitioning_Unit.cpp
// Function: Utils::Logical_Address_Partitioning_Unit::Reset()
void Logical_Address_Partitioning_Unit::Reset()
	{
		initialized = false;
		pdas_per_flow.clear();
		start_lhas_per_flow.clear();
		end_lhas_per_flow.clear();
		stream_channel_ids.clear();
		stream_chip_ids.clear();
		stream_die_ids.clear();
		stream_plane_ids.clear();

		for (flash_channel_ID_type channel_id = 0; channel_id < channel_count; channel_id++) {
			for (flash_chip_ID_type chip_id = 0; chip_id < chip_no_per_channel; chip_id++) {
				for (flash_die_ID_type die_id = 0; die_id < die_no_per_chip; die_id++) {
					delete[] resource_list[channel_id][chip_id][die_id];
				}
				delete[] resource_list[channel_id][chip_id];
			}
			delete[] resource_list[channel_id];
		}

		delete[] resource_list;
	}

// Assembly:
subq $0x38, %rsp
movb $0x0, 0x39899(%rip)     # 0xded84
leaq 0x39896(%rip), %rdi     # 0xded88
callq 0xa6ce0
leaq 0x398a2(%rip), %rdi     # 0xdeda0
callq 0xa6ce0
leaq 0x398ae(%rip), %rdi     # 0xdedb8
callq 0xa6ce0
leaq 0x3980a(%rip), %rdi     # 0xded20
callq 0xa6d00
leaq 0x39816(%rip), %rdi     # 0xded38
callq 0xa6d00
leaq 0x39822(%rip), %rdi     # 0xded50
callq 0xa6d00
leaq 0x3982e(%rip), %rdi     # 0xded68
callq 0xa6d00
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x3987f(%rip), %eax     # 0xdedd0
jae 0xa563a
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
cmpl 0x3986b(%rip), %eax     # 0xdedd4
jae 0xa5604
movl $0x0, 0x2c(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x39857(%rip), %eax     # 0xdedd8
jae 0xa55c6
movq 0x3978e(%rip), %rax     # 0xded18
movl 0x34(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x30(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x2c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0xa55b7
movq 0x20(%rsp), %rdi
callq 0x8570
jmp 0xa55b9
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0xa5577
movq 0x3974b(%rip), %rax     # 0xded18
movl 0x34(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x30(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0xa55f2
movq 0x18(%rsp), %rdi
callq 0x8570
jmp 0xa55f4
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0xa555f
movq 0x3970d(%rip), %rax     # 0xded18
movl 0x34(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0xa5628
movq 0x10(%rsp), %rdi
callq 0x8570
jmp 0xa562a
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xa5547
movq 0x396d7(%rip), %rax     # 0xded18
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0xa5656
movq 0x8(%rsp), %rdi
callq 0x8570
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/Logical_Address_Partitioning_Unit.cpp
// Function: Utils::Logical_Address_Partitioning_Unit::Get_share_of_physcial_pages_in_plane(unsigned int, unsigned int, unsigned int, unsigned int)
double Logical_Address_Partitioning_Unit::Get_share_of_physcial_pages_in_plane(flash_channel_ID_type channel_id, flash_chip_ID_type chip_id, flash_die_ID_type die_id, flash_plane_ID_type plane_id)
	{
		switch (hostinterface_type) {
			case HostInterface_Types::NVME:
				return 1.0 / double(resource_list[channel_id][chip_id][die_id][plane_id]);
			case HostInterface_Types::SATA:
			default:
				break;
		}

		return 1.0;
	}

// Assembly:
movl %edi, -0xc(%rsp)
movl %esi, -0x10(%rsp)
movl %edx, -0x14(%rsp)
movl %ecx, -0x18(%rsp)
movl 0x3857a(%rip), %eax     # 0xded80
movl %eax, -0x1c(%rsp)
testl %eax, %eax
je 0xa6857
jmp 0xa6810
movl -0x1c(%rsp), %eax
subl $0x1, %eax
jne 0xa6859
jmp 0xa681b
movq 0x384f6(%rip), %rax     # 0xded18
movl -0xc(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x10(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x14(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl -0x18(%rsp), %ecx
cvtsi2sdl (%rax,%rcx,4), %xmm1
movsd 0x5475(%rip), %xmm0     # 0xabcc0
divsd %xmm1, %xmm0
movsd %xmm0, -0x8(%rsp)
jmp 0xa6869
jmp 0xa6859
jmp 0xa685b
movsd 0x545d(%rip), %xmm0     # 0xabcc0
movsd %xmm0, -0x8(%rsp)
movsd -0x8(%rsp), %xmm0
retq
// File: CMU-SAFARI[P]MQSim/src/utils/Logical_Address_Partitioning_Unit.cpp
// Function: Utils::Logical_Address_Partitioning_Unit::Start_lha_available_to_flow(unsigned short)
LHA_type Logical_Address_Partitioning_Unit::Start_lha_available_to_flow(stream_id_type stream_id)
	{
		if (initialized) {
			switch (hostinterface_type) {
				case HostInterface_Types::SATA:
					return start_lhas_per_flow[stream_id];
					break;
				case HostInterface_Types::NVME:
					return start_lhas_per_flow[stream_id];
					break;
				default:
					break;
			}
		}

		PRINT_ERROR("The address partitioning unit is not initialized!")
	}

// Assembly:
subq $0x18, %rsp
movw %di, %ax
movw %ax, 0xe(%rsp)
testb $0x1, 0x38501(%rip)     # 0xded84
je 0xa68de
movl 0x384f5(%rip), %eax     # 0xded80
movl %eax, 0x8(%rsp)
testl %eax, %eax
je 0xa68a0
jmp 0xa6895
movl 0x8(%rsp), %eax
subl $0x1, %eax
je 0xa68bd
jmp 0xa68da
movzwl 0xe(%rsp), %eax
movl %eax, %esi
leaq 0x384f2(%rip), %rdi     # 0xdeda0
callq 0x3b3c0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0xa6929
movzwl 0xe(%rsp), %eax
movl %eax, %esi
leaq 0x384d5(%rip), %rdi     # 0xdeda0
callq 0x3b3c0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0xa6929
jmp 0xa68dc
jmp 0xa68de
movq 0x3370b(%rip), %rdi     # 0xd9ff0
leaq 0x3ffc(%rip), %rsi      # 0xaa8e8
callq 0x8440
movq 0x336f8(%rip), %rdi     # 0xd9ff0
leaq 0x8281(%rip), %rsi      # 0xaeb80
callq 0x8440
movq %rax, %rdi
movq 0x3364a(%rip), %rsi     # 0xd9f58
callq 0x8480
movq 0x336b6(%rip), %rdi     # 0xd9fd0
callq 0x84f0
movl $0x1, %edi
callq 0x8500
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/Logical_Address_Partitioning_Unit.cpp
// Function: Utils::Logical_Address_Partitioning_Unit::End_lha_available_to_flow(unsigned short)
LHA_type Logical_Address_Partitioning_Unit::End_lha_available_to_flow(stream_id_type stream_id)
	{
		if (initialized) {
			switch (hostinterface_type) {
				case HostInterface_Types::SATA:
					return end_lhas_per_flow[stream_id];
					break;
				case HostInterface_Types::NVME:
					return end_lhas_per_flow[stream_id];
					break;
				default:
					break;
			}
		}
		PRINT_ERROR("The address partitioning unit is not initialized!")
	}

// Assembly:
subq $0x18, %rsp
movw %di, %ax
movw %ax, 0xe(%rsp)
testb $0x1, 0x38431(%rip)     # 0xded84
je 0xa69ae
movl 0x38425(%rip), %eax     # 0xded80
movl %eax, 0x8(%rsp)
testl %eax, %eax
je 0xa6970
jmp 0xa6965
movl 0x8(%rsp), %eax
subl $0x1, %eax
je 0xa698d
jmp 0xa69aa
movzwl 0xe(%rsp), %eax
movl %eax, %esi
leaq 0x3843a(%rip), %rdi     # 0xdedb8
callq 0x3b3c0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0xa69f9
movzwl 0xe(%rsp), %eax
movl %eax, %esi
leaq 0x3841d(%rip), %rdi     # 0xdedb8
callq 0x3b3c0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0xa69f9
jmp 0xa69ac
jmp 0xa69ae
movq 0x3363b(%rip), %rdi     # 0xd9ff0
leaq 0x3f2c(%rip), %rsi      # 0xaa8e8
callq 0x8440
movq 0x33628(%rip), %rdi     # 0xd9ff0
leaq 0x81b1(%rip), %rsi      # 0xaeb80
callq 0x8440
movq %rax, %rdi
movq 0x3357a(%rip), %rsi     # 0xd9f58
callq 0x8480
movq 0x335e6(%rip), %rdi     # 0xd9fd0
callq 0x84f0
movl $0x1, %edi
callq 0x8500
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/Logical_Address_Partitioning_Unit.cpp
// Function: Utils::Logical_Address_Partitioning_Unit::LHA_count_allocate_to_flow_from_host_view(unsigned short)
LHA_type Logical_Address_Partitioning_Unit::LHA_count_allocate_to_flow_from_host_view(stream_id_type stream_id)
	{
		if (initialized) {
			switch (hostinterface_type) {
				case HostInterface_Types::SATA:
					return (end_lhas_per_flow[stream_id] - start_lhas_per_flow[stream_id] + 1);
					break;
				case HostInterface_Types::NVME:
					return (end_lhas_per_flow[stream_id] - start_lhas_per_flow[stream_id] + 1);
					break;
				default:
					break;
			}
		}
		PRINT_ERROR("The address partitioning unit is not initialized!")
	}

// Assembly:
subq $0x28, %rsp
movw %di, %ax
movw %ax, 0x1e(%rsp)
testb $0x1, 0x38361(%rip)     # 0xded84
je 0xa6ad6
movl 0x38351(%rip), %eax     # 0xded80
movl %eax, 0x18(%rsp)
testl %eax, %eax
je 0xa6a47
jmp 0xa6a39
movl 0x18(%rsp), %eax
subl $0x1, %eax
je 0xa6a8e
jmp 0xa6ad2
movzwl 0x1e(%rsp), %eax
movl %eax, %esi
leaq 0x38363(%rip), %rdi     # 0xdedb8
callq 0x3b3c0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movzwl 0x1e(%rsp), %eax
movl %eax, %esi
leaq 0x38330(%rip), %rdi     # 0xdeda0
callq 0x3b3c0
movq %rax, %rcx
movq 0x10(%rsp), %rax
subq (%rcx), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0xa6b21
movzwl 0x1e(%rsp), %eax
movl %eax, %esi
leaq 0x3831c(%rip), %rdi     # 0xdedb8
callq 0x3b3c0
movq (%rax), %rax
movq %rax, 0x8(%rsp)
movzwl 0x1e(%rsp), %eax
movl %eax, %esi
leaq 0x382e9(%rip), %rdi     # 0xdeda0
callq 0x3b3c0
movq %rax, %rcx
movq 0x8(%rsp), %rax
subq (%rcx), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0xa6b21
jmp 0xa6ad4
jmp 0xa6ad6
movq 0x33513(%rip), %rdi     # 0xd9ff0
leaq 0x3e04(%rip), %rsi      # 0xaa8e8
callq 0x8440
movq 0x33500(%rip), %rdi     # 0xd9ff0
leaq 0x8089(%rip), %rsi      # 0xaeb80
callq 0x8440
movq %rax, %rdi
movq 0x33452(%rip), %rsi     # 0xd9f58
callq 0x8480
movq 0x334be(%rip), %rdi     # 0xd9fd0
callq 0x84f0
movl $0x1, %edi
callq 0x8500
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nopl (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/Logical_Address_Partitioning_Unit.cpp
// Function: Utils::Logical_Address_Partitioning_Unit::LHA_count_allocate_to_flow_from_device_view(unsigned short)
LHA_type Logical_Address_Partitioning_Unit::LHA_count_allocate_to_flow_from_device_view(stream_id_type stream_id)
	{
		if (initialized) {
			switch (hostinterface_type) {
				case HostInterface_Types::SATA://It is not possible to differentiate between streams inside the device when a SATA host interface is used, so all lha space is available to all streams
					return total_lha_no;
					break;
				case HostInterface_Types::NVME:
					return (end_lhas_per_flow[stream_id] - start_lhas_per_flow[stream_id] + 1);
					break;
				default:
					break;
			}
		}
		PRINT_ERROR("The address partitioning unit is not initialized!")
	}

// Assembly:
subq $0x18, %rsp
movw %di, %ax
movw %ax, 0xe(%rsp)
testb $0x1, 0x38241(%rip)     # 0xded84
je 0xa6bb7
movl 0x38235(%rip), %eax     # 0xded80
movl %eax, 0x8(%rsp)
testl %eax, %eax
je 0xa6b60
jmp 0xa6b55
movl 0x8(%rsp), %eax
subl $0x1, %eax
je 0xa6b71
jmp 0xa6bb3
movq 0x38281(%rip), %rax     # 0xdede8
movq %rax, 0x10(%rsp)
jmp 0xa6c02
movzwl 0xe(%rsp), %eax
movl %eax, %esi
leaq 0x38239(%rip), %rdi     # 0xdedb8
callq 0x3b3c0
movq (%rax), %rax
movq %rax, (%rsp)
movzwl 0xe(%rsp), %eax
movl %eax, %esi
leaq 0x38207(%rip), %rdi     # 0xdeda0
callq 0x3b3c0
movq %rax, %rcx
movq (%rsp), %rax
subq (%rcx), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0xa6c02
jmp 0xa6bb5
jmp 0xa6bb7
movq 0x33432(%rip), %rdi     # 0xd9ff0
leaq 0x3d23(%rip), %rsi      # 0xaa8e8
callq 0x8440
movq 0x3341f(%rip), %rdi     # 0xd9ff0
leaq 0x7fa8(%rip), %rsi      # 0xaeb80
callq 0x8440
movq %rax, %rdi
movq 0x33371(%rip), %rsi     # 0xd9f58
callq 0x8480
movq 0x333dd(%rip), %rdi     # 0xd9fd0
callq 0x84f0
movl $0x1, %edi
callq 0x8500
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/Logical_Address_Partitioning_Unit.cpp
// Function: Utils::Logical_Address_Partitioning_Unit::PDA_count_allocate_to_flow(unsigned short)
PDA_type Logical_Address_Partitioning_Unit::PDA_count_allocate_to_flow(stream_id_type stream_id)
	{
		if (initialized) {
			switch (hostinterface_type) {
				case HostInterface_Types::SATA://It is not possible to differentiate between streams inside the device when a SATA host interface is used, so all lha space is available to all streams
					return total_pda_no;
				case HostInterface_Types::NVME:
					return pdas_per_flow[stream_id];
					break;
				default:
					break;
			}
		}
		PRINT_ERROR("The address partitioning unit is not initialized!")
	}

// Assembly:
subq $0x18, %rsp
movw %di, %ax
movw %ax, 0xe(%rsp)
testb $0x1, 0x38161(%rip)     # 0xded84
je 0xa6c6f
movl 0x38155(%rip), %eax     # 0xded80
movl %eax, 0x8(%rsp)
testl %eax, %eax
je 0xa6c40
jmp 0xa6c35
movl 0x8(%rsp), %eax
subl $0x1, %eax
je 0xa6c4e
jmp 0xa6c6b
movq 0x38199(%rip), %rax     # 0xdede0
movq %rax, 0x10(%rsp)
jmp 0xa6cba
movzwl 0xe(%rsp), %eax
movl %eax, %esi
leaq 0x3812c(%rip), %rdi     # 0xded88
callq 0x3b3c0
movq (%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0xa6cba
jmp 0xa6c6d
jmp 0xa6c6f
movq 0x3337a(%rip), %rdi     # 0xd9ff0
leaq 0x3c6b(%rip), %rsi      # 0xaa8e8
callq 0x8440
movq 0x33367(%rip), %rdi     # 0xd9ff0
leaq 0x7ef0(%rip), %rsi      # 0xaeb80
callq 0x8440
movq %rax, %rdi
movq 0x332b9(%rip), %rsi     # 0xd9f58
callq 0x8480
movq 0x33325(%rip), %rdi     # 0xd9fd0
callq 0x84f0
movl $0x1, %edi
callq 0x8500
movq 0x10(%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/RandomGenerator.cpp
// Function: Utils::RandomGenerator::Erlang(double, double)
double RandomGenerator::Erlang(double x, double s)
	{
		int64_t i, k;
		double z;
		z = x / s;
		k = (uint64_t)(z * z);
		z = 1.0;
		for (i = 0; i < k; i++) {
			z *= FloatRandom();
		}
		return -(x / (double) k) * log(z);
	}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movsd %xmm1, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movsd 0x38(%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
mulsd %xmm0, %xmm0
movsd 0x1e21(%rip), %xmm2     # 0xa9008
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rcx
cvttsd2si %xmm0, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, 0x20(%rsp)
movsd 0x4aae(%rip), %xmm0     # 0xabcc0
movsd %xmm0, 0x18(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
cmpq 0x20(%rsp), %rax
jge 0xa7253
movq 0x10(%rsp), %rdi
callq 0xa6f20
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0xa7221
movsd 0x38(%rsp), %xmm0
cvtsi2sdq 0x20(%rsp), %xmm1
divsd %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x8380
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
addq $0x48, %rsp
retq
nop
// File: CMU-SAFARI[P]MQSim/src/utils/RandomGenerator.cpp
// Function: Utils::RandomGenerator::HyperExponential(double, double)
double RandomGenerator::HyperExponential(double x, double s)
	{
		if (s < x) {
			throw std::logic_error("RandomGenerator::HyperExponential: Mean must be greater than standard deviation.");
		}

		double cv, z, p;
		cv = s / x;
		z = cv * cv;
		p = 0.5 * (1.0 - sqrt((z - 1.0) / (z + 1.0)));
		z = (FloatRandom() > p) ? (x / (1.0 - p)) : (x / p);
		return -0.5 * z * log(FloatRandom());
	}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movsd %xmm0, 0x58(%rsp)
movsd %xmm1, 0x50(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x20(%rsp)
movsd 0x50(%rsp), %xmm1
movsd 0x58(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xa7329
movl $0x10, %edi
callq 0x8200
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
leaq 0x78db(%rip), %rsi      # 0xaebc8
callq 0x8610
jmp 0xa72f4
movq 0x18(%rsp), %rdi
movq 0x32cc0(%rip), %rsi     # 0xd9fc0
movq 0x32c89(%rip), %rdx     # 0xd9f90
callq 0x8710
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
callq 0x8330
jmp 0xa7419
movsd 0x50(%rsp), %xmm0
divsd 0x58(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
mulsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
movsd 0x4965(%rip), %xmm1     # 0xabcc0
subsd %xmm1, %xmm0
movsd 0x4959(%rip), %xmm1     # 0xabcc0
addsd 0x30(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x8360
movq 0x20(%rsp), %rdi
movsd 0x493d(%rip), %xmm1     # 0xabcc0
subsd %xmm0, %xmm1
movsd 0x5f89(%rip), %xmm0     # 0xad318
mulsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
callq 0xa6f20
ucomisd 0x28(%rsp), %xmm0
jbe 0xa73c6
movsd 0x58(%rsp), %xmm0
movsd 0x490c(%rip), %xmm1     # 0xabcc0
subsd 0x28(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0xa73d8
movsd 0x58(%rsp), %xmm0
divsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x20(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x77c7(%rip), %xmm0     # 0xaebb8
mulsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0xa6f20
callq 0x8380
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
addq $0x68, %rsp
retq
movq 0x48(%rsp), %rdi
callq 0x8770
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/RandomGenerator.cpp
// Function: Utils::RandomGenerator::Normal(double, double)
double RandomGenerator::Normal(double x, double s)
	{
		double v1, v2, w, z1;
		if (Normal_z2 != 0.0) {
			/* use value from previous call */
			z1 = Normal_z2;
			Normal_z2 = 0.0;
		} else {
			do {
				v1 = 2.0 * FloatRandom() - 1.0;
				v2 = 2.0 * FloatRandom() - 1.0;
				w = v1 * v1 + v2 * v2;
			} while (w >= 1.0);

			w = sqrt((-2.0*log(w)) / w);
			z1 = v1 * w;
			Normal_z2 = v2 * w;
		}

		return x + z1 * s;
	}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movsd %xmm0, 0x38(%rsp)
movsd %xmm1, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movsd 0x10(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xa7461
jp 0xa7461
jmp 0xa747e
movq 0x8(%rsp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
jmp 0xa754d
jmp 0xa7480
movq 0x8(%rsp), %rdi
callq 0xa6f20
movq 0x8(%rsp), %rdi
addsd %xmm0, %xmm0
movsd 0x481d(%rip), %xmm1     # 0xabcb8
addsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
callq 0xa6f20
addsd %xmm0, %xmm0
movsd 0x4802(%rip), %xmm1     # 0xabcb8
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x28(%rsp), %xmm0
movsd 0x28(%rsp), %xmm2
movsd 0x20(%rsp), %xmm1
mulsd 0x20(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x18(%rsp), %xmm0
movsd 0x47cc(%rip), %xmm1     # 0xabcc0
ucomisd %xmm1, %xmm0
jae 0xa7480
movsd 0x18(%rsp), %xmm0
callq 0x8380
movaps %xmm0, %xmm1
movsd 0x76b0(%rip), %xmm0     # 0xaebc0
mulsd %xmm1, %xmm0
divsd 0x18(%rsp), %xmm0
callq 0x8360
movq 0x8(%rsp), %rax
movsd %xmm0, 0x18(%rsp)
movsd 0x28(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
movsd 0x38(%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
movsd 0x30(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
addq $0x48, %rsp
retq
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/RandomGenerator.cpp
// Function: Utils::RandomGenerator::Geometric0(double)
int64_t RandomGenerator::Geometric0(double x)
	{
		double p = 1 / x;
		int64_t i = 0;
		while (FloatRandom() < p) {
			++i;
		}

		return i;
	}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movsd 0x46f0(%rip), %xmm0     # 0xabcc0
divsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq $0x0, 0x8(%rsp)
movq (%rsp), %rdi
callq 0xa6f20
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xa760d
movq 0x8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x8(%rsp)
jmp 0xa75e5
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
nopw (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/utils/RandomGenerator.cpp
// Function: Utils::RandomGenerator::Hyper_geometric(double, double)
double RandomGenerator::Hyper_geometric(double x, double s)
	{
		double sqrtz = s / x;
		double z = sqrtz * sqrtz;
		double p = 0.5 * (1 - sqrt((z - 1) / (z + 1)));
		double d = (FloatRandom() > p) ? (1 - p) : p;

		return -x * log(FloatRandom()) / (2 * d);
	}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movsd %xmm0, 0x48(%rsp)
movsd %xmm1, 0x40(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
movsd 0x40(%rsp), %xmm0
divsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
mulsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x30(%rsp), %xmm0
movsd 0x461f(%rip), %xmm1     # 0xabcc0
subsd %xmm1, %xmm0
movsd 0x4613(%rip), %xmm1     # 0xabcc0
addsd 0x30(%rsp), %xmm1
divsd %xmm1, %xmm0
callq 0x8360
movq 0x18(%rsp), %rdi
movsd 0x45f7(%rip), %xmm1     # 0xabcc0
subsd %xmm0, %xmm1
movsd 0x5c43(%rip), %xmm0     # 0xad318
mulsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rsp)
callq 0xa6f20
ucomisd 0x28(%rsp), %xmm0
jbe 0xa7702
movsd 0x45cc(%rip), %xmm0     # 0xabcc0
subsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
jmp 0xa770e
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x18(%rsp), %rdi
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x48(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0xa6f20
callq 0x8380
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd 0x5bdf(%rip), %xmm1     # 0xad340
mulsd 0x20(%rsp), %xmm1
divsd %xmm1, %xmm0
addq $0x58, %rsp
retq
// File: CMU-SAFARI[P]MQSim/src/utils/RandomGenerator.cpp
// Function: Utils::RandomGenerator::Binomial(long, double)
int64_t RandomGenerator::Binomial(int64_t n, double u)
	{
		int64_t k = 0;
		for (long i = 0; i < n; i++) {
			if (FloatRandom() < u) {
				++k;
			}
		}

		return k;
	}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movsd %xmm0, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x28(%rsp), %rax
jge 0xa77e5
movq 0x8(%rsp), %rdi
callq 0xa6f20
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xa77d3
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0xa77d5
movq 0x10(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
jmp 0xa77a0
movq 0x18(%rsp), %rax
addq $0x38, %rsp
retq
nop