// File: /workspace/github_cpp_makefile_star2_O1/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)
xorl %r13d, %r13d
movabsq $-0x1111111111111111, %r10 # imm = 0xEEEEEEEEEEEEEEEF
xorl %r12d, %r12d
xorl %r15d, %r15d
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 %r10, %rcx
leaq (%rcx,%rdx,4), %rcx
movq 0x10(%r14), %rbp
movq 0x20(%r14), %rbx
subq %rbp, %rbx
sarq $0x3, %rbx
imulq %r10, %rbx
addq %rcx, %rbx
cmpq %rbx, %r15
jae 0x14a1d
movq 0x68(%r14), %rdx
movq %rdx, %rcx
subq 0x70(%r14), %rcx
sarq $0x2, %rcx
addq %r15, %rcx
cmpq $0x7f, %rcx
ja 0x14749
leaq (%rdx,%r12), %rsi
jmp 0x14783
movq %rcx, %rsi
shrq $0x7, %rsi
movq %rsi, %rdi
movabsq $-0x200000000000000, %r8 # imm = 0xFE00000000000000
orq %r8, %rdi
testq %rcx, %rcx
cmovgq %rsi, %rdi
movq 0x80(%r14), %r8
movq %rdi, %r9
shlq $0x7, %r9
movq %rcx, %rsi
subq %r9, %rsi
shlq $0x2, %rsi
addq (%r8,%rdi,8), %rsi
cmpl $-0x2, (%rsi)
jne 0x148bc
cmpq $0x7f, %rcx
ja 0x14797
addq %r12, %rdx
jmp 0x147d1
movq %rcx, %rdx
shrq $0x7, %rdx
movq %rdx, %rsi
movabsq $-0x200000000000000, %rdi # imm = 0xFE00000000000000
orq %rdi, %rsi
testq %rcx, %rcx
cmovgq %rdx, %rsi
movq 0x80(%r14), %rdx
movq %rsi, %rdi
shlq $0x7, %rdi
subq %rdi, %rcx
shlq $0x2, %rcx
addq (%rdx,%rsi,8), %rcx
movq %rcx, %rdx
cmpl $-0x1, (%rdx)
je 0x148bc
movq %rbp, %rcx
subq 0x18(%r14), %rcx
sarq $0x3, %rcx
imulq %r10, %rcx
leaq (%r15,%rcx), %rdx
cmpq $0x3, %rdx
ja 0x147f8
addq %r13, %rbp
jmp 0x14829
movq %rdx, %rsi
shrq $0x2, %rsi
movabsq $-0x4000000000000000, %rdi # imm = 0xC000000000000000
addq %rsi, %rdi
testq %rdx, %rdx
cmovgq %rsi, %rdi
leaq (,%rdi,4), %rdx
subq %rdx, %rcx
addq %r15, %rcx
imulq $0x78, %rcx, %rbp
addq (%rax,%rdi,8), %rbp
movl $0xa, %ecx
leaq 0x10(%rsp), %rdi
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x50(%rbp), %rsi
movq 0x58(%rbp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x52b6
movq 0x70(%rbp), %rax
movq %rax, 0x80(%rsp)
cmpl $-0x1, 0x14(%rsp)
je 0x14896
cmpl $-0x1, 0x10(%rsp)
je 0x14896
leaq 0x108(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xac5a
movq 0x50(%r14), %rax
movslq 0x110(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x148cc
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x148b2
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3200
movabsq $-0x1111111111111111, %r10 # imm = 0xEEEEEEEEEEEEEEEF
incq %r15
addq $0x4, %r12
addq $0x78, %r13
jmp 0x146de
movq 0x68(%r14), %rcx
movq %rcx, %rax
subq 0x70(%r14), %rax
sarq $0x2, %rax
leaq (%rax,%r15), %rdx
cmpq $0x7f, %rdx
ja 0x148ea
addq %r12, %rcx
jmp 0x14924
movq 0x80(%r14), %rcx
movq %rdx, %rsi
shrq $0x7, %rsi
movabsq $-0x200000000000000, %rdi # imm = 0xFE00000000000000
orq %rsi, %rdi
testq %rdx, %rdx
cmovgq %rsi, %rdi
movq %rdi, %rdx
shlq $0x7, %rdx
subq %rdx, %rax
addq %r15, %rax
shlq $0x2, %rax
addq (%rcx,%rdi,8), %rax
movq %rax, %rcx
movq 0x8(%rsp), %r13
movl $0xffffffff, (%rcx)     # imm = 0xFFFFFFFF
leaq 0x90(%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 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x50(%rax), %rsi
movq 0x58(%rax), %rdx
addq %rsi, %rdx
callq 0x52b6
movq 0x80(%rsp), %rax
movq %rax, 0x100(%rsp)
movl 0x88(%rsp), %ecx
movl %ecx, (%r13)
leaq 0x8(%r13), %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x68(%r13), %rcx
movq %rcx, 0x58(%r13)
movq 0xe0(%rsp), %rdx
cmpq %r12, %rdx
je 0x149c4
movq %rdx, 0x58(%r13)
movq 0xf0(%rsp), %rcx
movq %rcx, 0x68(%r13)
jmp 0x149cc
movups (%r12), %xmm0
movups %xmm0, (%rcx)
movq 0xe8(%rsp), %rcx
movq %rcx, 0x60(%r13)
movq %r12, 0xe0(%rsp)
movq $0x0, 0xe8(%rsp)
movb $0x0, 0xf0(%rsp)
movq %rax, 0x78(%r13)
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x14a14
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3200
cmpq %rbx, %r15
jb 0x14aad
leaq 0x88(%rsp), %r14
movq %r14, %rdi
callq 0x7c0a
movq 0x8(%rsp), %r8
movl $0xffffffff, (%r8)      # imm = 0xFFFFFFFF
leaq 0x8(%r8), %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x68(%r8), %rcx
movq %rcx, 0x58(%r8)
movq 0x50(%r14), %rdx
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdx
je 0x14a73
movq %rdx, 0x58(%r8)
movq 0xe8(%rsp), %rcx
movq %rcx, 0x68(%r8)
jmp 0x14a79
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0xe0(%rsp), %rcx
movq %rcx, 0x60(%r8)
movq %rax, 0xd8(%rsp)
movq $0x0, 0xe0(%rsp)
movb $0x0, 0xe8(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x78(%r8)
movq 0x8(%rsp), %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x14ac6
movq %rax, %rbx
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x14ae5
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x3340
nop