// File: /workspace/github_cpp_makefile_star2_O3/ys1998[P]spsim/src/issuer.cpp
// Function: Issuer::flush(int)
void Issuer::flush(int id){
	iq->flush(id);

	for(int j=0; j < NUM_ALU; ++j){
		if(i[j].is_valid() && i[j].get_id() > id){
			i[j] = Instruction();
		}
	}

	for(int j=0; j < NUM_ALU; ++j){
		if(l[j]->valid()){
			auto inp = l[j]->read();
			auto iRead = std::get<0>(inp);
			auto in1 = std::get<1>(inp);
			auto in2 = std::get<2>(inp);
			if(iRead.get_id() < id){
				l[j]->write(std::make_tuple(iRead, in1, in2 ));
			}
		}
	}
	if(outer_latch->valid()){
			auto inp = outer_latch->read();
			auto iRead = std::get<0>(inp);
			auto in1 = std::get<1>(inp);
			if(iRead.get_id() < id){
				outer_latch->write(std::make_tuple(iRead, in1));
			}
		}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movl %esi, %ebx
movq %rdi, %r14
movq 0x208(%rdi), %rdi
callq 0x12c6a
leaq 0x60(%rsp), %rbp
movq %r14, (%rsp)
leaq 0x58(%r14), %r15
movl $0x4, %r14d
leaq 0x10(%rsp), %r12
cmpl $-0x1, -0x4c(%r15)
je 0xb3fb
movl -0x50(%r15), %eax
cmpl $-0x1, %eax
je 0xb3fb
cmpl %ebx, %eax
jle 0xb3fb
leaq -0x50(%r15), %r13
movq %r12, %rdi
callq 0x7a5a
movl $0xa, %ecx
movq %r13, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
movq %rbp, %rsi
callq 0x3270
movq 0x80(%rsp), %rax
movq %rax, 0x20(%r15)
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0xb3fb
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3200
addq $0x78, %r15
decq %r14
jne 0xb39a
leaq 0x18(%rsp), %r12
leaq 0x110(%rsp), %r14
leaq 0x160(%rsp), %rbp
xorl %r13d, %r13d
movl %ebx, 0xc(%rsp)
movq (%rsp), %rax
movq 0x1e8(%rax,%r13,8), %r15
cmpb $0x1, 0x80(%r15)
jne 0xb5f4
movb $0x0, 0x80(%r15)
movq (%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x8(%r15), %rsi
movl $0xa, %ecx
movq %r12, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x58(%r15), %rsi
movq 0x60(%r15), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x5274
movq 0x78(%r15), %rax
movq %rax, 0x88(%rsp)
movl $0xa, %ecx
leaq 0x90(%rsp), %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq 0x68(%rsp), %rsi
movq 0x70(%rsp), %rdx
addq %rsi, %rdx
leaq 0xe0(%rsp), %rdi
callq 0x5274
movq 0x88(%rsp), %rax
movq %rax, 0x100(%rsp)
cmpl %ebx, 0x90(%rsp)
jge 0xb5b3
movq (%rsp), %rax
movq 0x1e8(%rax,%r13,8), %r15
movq 0x10(%rsp), %rax
movq %rax, 0x108(%rsp)
movl $0xa, %ecx
movq %r14, %r12
movq %r14, %rdi
leaq 0x90(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x170(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0xe0(%rsp), %rsi
movq 0xe8(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rbx
movq %rbp, %rdi
callq 0x5274
movq 0x100(%rsp), %rax
movq %rax, 0x180(%rsp)
movb $0x1, 0x80(%r15)
leaq 0x8(%r15), %rdi
movl $0xa, %ecx
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x58(%r15), %rdi
movq %rbx, %rsi
callq 0x3140
movq 0x180(%rsp), %rax
movq %rax, 0x78(%r15)
movq 0x108(%rsp), %rax
movq %rax, (%r15)
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %r12
je 0xb5af
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3200
movl 0xc(%rsp), %ebx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xb5d8
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xb5f4
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3200
incq %r13
cmpq $0x4, %r13
jne 0xb420
movq (%rsp), %rax
movq 0x238(%rax), %r12
cmpb $0x0, 0x80(%r12)
je 0xb7c3
movb $0x0, 0x80(%r12)
movl (%r12), %eax
leaq 0x18(%rsp), %r14
movl %eax, -0x8(%r14)
leaq 0x8(%r12), %rsi
movl $0xa, %ecx
movq %r14, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x68(%rsp), %r15
leaq 0x78(%rsp), %rax
movq %rax, (%r15)
movq 0x58(%r12), %rsi
movq 0x60(%r12), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x5274
movq 0x78(%r12), %rax
movq %rax, 0x20(%r15)
leaq 0x90(%rsp), %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
movq %rax, (%rdi)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
callq 0x5274
movq 0x88(%rsp), %rax
movq %rax, 0x100(%rsp)
cmpl %ebx, 0x90(%rsp)
jge 0xb782
movl 0x10(%rsp), %eax
movq (%rsp), %rcx
movq 0x238(%rcx), %r15
leaq 0x110(%rsp), %rbx
movl %eax, -0x8(%rbx)
leaq 0x90(%rsp), %rax
movl $0xa, %ecx
movq %rbx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x160(%rsp), %r14
leaq 0x170(%rsp), %rcx
movq %rcx, (%r14)
movq 0x50(%rax), %rsi
movq 0x58(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x5274
movq 0x100(%rsp), %rax
movq %rax, 0x180(%rsp)
movb $0x1, 0x80(%r15)
leaq 0x8(%r15), %rdi
movl $0xa, %ecx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x58(%r15), %rdi
movq %r14, %rsi
callq 0x3140
movq 0x180(%rsp), %rax
movq %rax, 0x78(%r15)
movl 0x108(%rsp), %eax
movl %eax, (%r15)
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0xb782
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xb7a7
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xb7c3
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3200
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb7db
jmp 0xb805
jmp 0xb82f
movq %rax, %rbx
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0xb808
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0xb808
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xb832
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0xb832
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xb84e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x3340
nop