// File: /workspace/github_cpp_makefile_star2_O3/ys1998[P]spsim/src/queues.cpp
// Function: AddressQueue::ALUissue()
std::tuple<Instruction, int> AddressQueue::ALUissue(){
	for(size_t i=0; i < _q.size(); ++i){
		if (_addr[i]!=-2||_addr[i]==-1)
			continue;
		Instruction temp = _q[i];
		if(temp.is_valid()){
			auto regs = temp.physical_regs();
			if(!*(b + std::get<1>(regs))){
				_addr[i] = -1;
				return std::make_tuple(temp, i);
			}
		}
	}
	return std::make_tuple(Instruction(), -1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
leaq 0x70(%rsp), %r13
xorl %r15d, %r15d
movabsq $-0x1111111111111111, %rbx # imm = 0xEEEEEEEEEEEEEEEF
leaq 0x10(%rsp), %r12
movq 0x48(%r14), %rcx
movq 0x28(%r14), %rax
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
movq 0x30(%r14), %rcx
subq 0x38(%r14), %rcx
sarq $0x3, %rcx
imulq %rbx, %rcx
leaq (%rcx,%rdx,4), %rcx
movq 0x10(%r14), %rbp
movq 0x20(%r14), %rdx
subq %rbp, %rdx
sarq $0x3, %rdx
imulq %rbx, %rdx
addq %rcx, %rdx
cmpq %rdx, %r15
jae 0x13d7e
movq 0x68(%r14), %rdx
movq 0x80(%r14), %rsi
movq %rdx, %rcx
subq 0x70(%r14), %rcx
sarq $0x2, %rcx
addq %r15, %rcx
js 0x13c7d
cmpq $0x80, %rcx
jae 0x13c86
cmpl $-0x2, (%rdx,%r15,4)
je 0x13cb1
jmp 0x13d76
movq %rcx, %rdx
sarq $0x7, %rdx
jmp 0x13c8d
movq %rcx, %rdx
shrq $0x7, %rdx
movq (%rsi,%rdx,8), %rsi
movl %ecx, %edi
andl $0x7f, %edi
cmpl $-0x2, (%rsi,%rdi,4)
jne 0x13d76
shlq $0x7, %rdx
subq %rdx, %rcx
cmpl $-0x1, (%rsi,%rcx,4)
je 0x13d76
movq %rbp, %rcx
subq 0x18(%r14), %rcx
sarq $0x3, %rcx
imulq %rbx, %rcx
addq %r15, %rcx
js 0x13cd4
cmpq $0x3, %rcx
ja 0x13cdd
imulq $0x78, %r15, %rax
addq %rax, %rbp
jmp 0x13cf7
movq %rcx, %rdx
sarq $0x2, %rdx
jmp 0x13ce4
movq %rcx, %rdx
shrq $0x2, %rdx
leaq (,%rdx,4), %rsi
subq %rsi, %rcx
imulq $0x78, %rcx, %rbp
addq (%rax,%rdx,8), %rbp
movl $0xa, %ecx
movq %r12, %rdi
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r13, 0x60(%rsp)
movq 0x50(%rbp), %rsi
movq 0x58(%rbp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x5274
movq 0x70(%rbp), %rax
movq %rax, 0x80(%rsp)
cmpl $-0x1, 0x14(%rsp)
je 0x13d5f
cmpl $-0x1, 0x10(%rsp)
je 0x13d5f
leaq 0x88(%rsp), %rdi
movq %r12, %rsi
callq 0xa88e
movq 0x50(%r14), %rax
movslq 0x90(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x13e07
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x13d76
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3200
incq %r15
jmp 0x13c00
leaq 0x98(%rsp), %r14
movq %r14, %rdi
callq 0x7a5a
movq 0x8(%rsp), %r15
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
leaq 0x8(%r15), %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x68(%r15), %rax
movq %rax, 0x58(%r15)
movq 0x50(%r14), %rcx
leaq 0xf8(%rsp), %rdx
cmpq %rdx, %rcx
je 0x13dd4
movq %rcx, 0x58(%r15)
movq 0xf8(%rsp), %rax
movq %rax, 0x68(%r15)
jmp 0x13dda
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq 0xf0(%rsp), %rax
movq %rax, 0x60(%r15)
movq 0x108(%rsp), %rax
movq %rax, 0x78(%r15)
movq %r15, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x68(%r14), %rdx
movq 0x80(%r14), %rcx
movq %rdx, %rax
subq 0x70(%r14), %rax
sarq $0x2, %rax
addq %r15, %rax
js 0x13e2e
cmpq $0x7f, %rax
ja 0x13e37
leaq (%rdx,%r15,4), %rax
jmp 0x13e50
movq %rax, %rdx
sarq $0x7, %rdx
jmp 0x13e3e
movq %rax, %rdx
shrq $0x7, %rdx
movq %rdx, %rsi
shlq $0x7, %rsi
subq %rsi, %rax
shlq $0x2, %rax
addq (%rcx,%rdx,8), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
leaq 0xa0(%rsp), %r14
movq %r15, -0x8(%r14)
leaq 0x10(%rsp), %rax
movl $0xa, %ecx
movq %r14, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf0(%rsp), %rdi
leaq 0x100(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x50(%rax), %rsi
movq 0x58(%rax), %rdx
addq %rsi, %rdx
callq 0x5274
movq 0x80(%rsp), %rax
movq %rax, 0x110(%rsp)
movl 0x98(%rsp), %ecx
movq 0x8(%rsp), %r15
movl %ecx, (%r15)
leaq 0x8(%r15), %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x68(%r15), %rcx
movq %rcx, 0x58(%r15)
movq 0xf0(%rsp), %rdx
cmpq %rbx, %rdx
je 0x13eee
movq %rdx, 0x58(%r15)
movq 0x100(%rsp), %rcx
movq %rcx, 0x68(%r15)
jmp 0x13ef4
movups (%rbx), %xmm0
movups %xmm0, (%rcx)
movq 0xf8(%rsp), %rcx
movq %rcx, 0x60(%r15)
movq %rax, 0x78(%r15)
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x13df2
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x13df2
jmp 0x13f26
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r13, %rdi
je 0x13f40
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x3340