// File: /workspace/github_cpp_makefile_star2_O1/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 0x1345c
leaq 0x60(%rsp), %rbp
movq %r14, (%rsp)
leaq 0x58(%r14), %r15
movl $0x4, %r14d
leaq 0x10(%rsp), %r12
cmpl $-0x1, -0x4c(%r15)
je 0xb7ed
movl -0x50(%r15), %eax
cmpl $-0x1, %eax
je 0xb7ed
cmpl %ebx, %eax
jle 0xb7ed
leaq -0x50(%r15), %r13
movq %r12, %rdi
callq 0x7c0a
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 0xb7ed
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x3200
addq $0x78, %r15
decq %r14
jne 0xb78c
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 0xb9f0
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 0x52b6
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 0x52b6
movq 0x88(%rsp), %rax
movq %rax, 0x100(%rsp)
cmpl %ebx, 0x90(%rsp)
jge 0xb9af
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq 0x1e8(%rcx,%r13,8), %r15
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 0x52b6
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)
movl 0x10c(%rsp), %eax
movl %eax, 0x4(%r15)
movl 0x108(%rsp), %eax
movl %eax, (%r15)
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %r12
je 0xb9ab
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3200
movl 0xc(%rsp), %ebx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xb9d4
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xb9f0
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3200
incq %r13
cmpq $0x4, %r13
jne 0xb812
movq (%rsp), %rax
movq 0x238(%rax), %r12
cmpb $0x0, 0x80(%r12)
je 0xbbbf
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 0x52b6
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 0x52b6
movq 0x88(%rsp), %rax
movq %rax, 0x100(%rsp)
cmpl %ebx, 0x90(%rsp)
jge 0xbb7e
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 0x52b6
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 0xbb7e
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xbba3
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xbbbf
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 0xbbd7
jmp 0xbc01
jmp 0xbc2b
movq %rax, %rbx
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0xbc04
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0xbc04
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0xbc2e
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0xbc2e
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xbc4a
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x3340
nop