// File: /workspace/github_cpp_makefile_star2_O3/ys1998[P]spsim/src/writer.cpp
// Function: Writer::flush(int)
void Writer::flush(int id){
	if(in1->valid()){
		auto inp = in1->read();
		auto iRead = std::get<0>(inp);
		auto inp1 = std::get<1>(inp);
		if(iRead.get_id() < id){
			in1->write(std::make_tuple(iRead, inp1));
		}
	}
	if(in3->valid()){
		auto inp = in3->read();
		auto iRead = std::get<0>(inp);
		auto inp1 = std::get<1>(inp);
		if(iRead.get_id() < id){
			in3->write(std::make_tuple(iRead, inp1));
		}
	}
	if(in2->valid()){
		auto inp = in2->read();
		auto iRead = std::get<0>(inp);
		auto inp1 = std::get<1>(inp);
		auto inp2 = std::get<2>(inp);
		if(iRead.get_id() < id){
			in2->write(std::make_tuple(iRead, inp1, inp2 ));
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movl %esi, %ebp
movq %rdi, %rbx
movq 0x188(%rdi), %r15
cmpb $0x1, 0x80(%r15)
jne 0x15999
movb $0x0, 0x80(%r15)
movl (%r15), %eax
leaq 0x100(%rsp), %r14
movl %eax, -0x8(%r14)
leaq 0x8(%r15), %rsi
movl $0xa, %ecx
movq %r14, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x58(%r15), %rsi
movq 0x60(%r15), %rdx
addq %rsi, %rdx
callq 0x5274
movq 0x78(%r15), %rax
movq %rax, 0x10(%r12)
movq %rsp, %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq -0x10(%r12), %rsi
movq -0x8(%r12), %rdx
addq %rsi, %rdx
callq 0x5274
movq 0x170(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpl %ebp, (%rsp)
jge 0x15965
movl 0xf8(%rsp), %eax
movq 0x188(%rbx), %r13
leaq 0x80(%rsp), %r14
movl %eax, -0x8(%r14)
movq %rsp, %rax
movl $0xa, %ecx
movq %r14, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xd0(%rsp), %r15
leaq 0xe0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x50(%rax), %rsi
movq 0x58(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x5274
movq 0x70(%rsp), %rax
movq %rax, 0xf0(%rsp)
movb $0x1, 0x80(%r13)
leaq 0x8(%r13), %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x58(%r13), %rdi
movq %r15, %rsi
callq 0x3140
movq 0xf0(%rsp), %rax
movq %rax, 0x78(%r13)
movl 0x78(%rsp), %eax
movl %eax, (%r13)
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
leaq 0x60(%rsp), %r14
je 0x15965
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x1597c
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x150(%rsp), %rdi
cmpq %r12, %rdi
je 0x15999
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x190(%rbx), %r15
cmpb $0x1, 0x80(%r15)
jne 0x15b3a
movb $0x0, 0x80(%r15)
movl (%r15), %eax
leaq 0x100(%rsp), %r14
movl %eax, -0x8(%r14)
leaq 0x8(%r15), %rsi
movl $0xa, %ecx
movq %r14, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x58(%r15), %rsi
movq 0x60(%r15), %rdx
addq %rsi, %rdx
callq 0x5274
movq 0x78(%r15), %rax
movq %rax, 0x10(%r12)
movq %rsp, %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %r14
movq %r14, -0x10(%r14)
movq -0x10(%r12), %rsi
movq -0x8(%r12), %rdx
addq %rsi, %rdx
callq 0x5274
movq 0x170(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpl %ebp, (%rsp)
jge 0x15b06
movl 0xf8(%rsp), %eax
movq 0x190(%rbx), %r13
leaq 0x80(%rsp), %r14
movl %eax, -0x8(%r14)
movq %rsp, %rax
movl $0xa, %ecx
movq %r14, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xd0(%rsp), %r15
leaq 0xe0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x50(%rax), %rsi
movq 0x58(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x5274
movq 0x70(%rsp), %rax
movq %rax, 0xf0(%rsp)
movb $0x1, 0x80(%r13)
leaq 0x8(%r13), %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x58(%r13), %rdi
movq %r15, %rsi
callq 0x3140
movq 0xf0(%rsp), %rax
movq %rax, 0x78(%r13)
movl 0x78(%rsp), %eax
movl %eax, (%r13)
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
leaq 0x60(%rsp), %r14
je 0x15b06
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x15b1d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x150(%rsp), %rdi
cmpq %r12, %rdi
je 0x15b3a
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x198(%rbx), %r12
cmpb $0x1, 0x80(%r12)
jne 0x15cd4
movb $0x0, 0x80(%r12)
movq (%r12), %rax
leaq 0x100(%rsp), %r14
movq %rax, -0x8(%r14)
leaq 0x8(%r12), %rsi
movl $0xa, %ecx
movq %r14, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x150(%rsp), %rdi
leaq 0x160(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x58(%r12), %rsi
movq 0x60(%r12), %rdx
addq %rsi, %rdx
callq 0x5274
movq 0x78(%r12), %rax
movq %rax, 0x10(%r15)
movq %rsp, %rdi
movl $0xa, %ecx
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
movq -0x10(%r15), %rsi
movq -0x8(%r15), %rdx
addq %rsi, %rdx
callq 0x5274
movq 0x170(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpl %ebp, (%rsp)
jge 0x15ca0
movq 0x198(%rbx), %r13
movq 0xf8(%rsp), %rax
leaq 0x80(%rsp), %rbx
movq %rax, -0x8(%rbx)
movq %rsp, %rax
movl $0xa, %ecx
movq %rbx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xd0(%rsp), %r14
leaq 0xe0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x50(%rax), %rsi
movq 0x58(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x5274
movq 0x70(%rsp), %rax
movq %rax, 0xf0(%rsp)
movb $0x1, 0x80(%r13)
leaq 0x8(%r13), %rdi
movl $0xa, %ecx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x58(%r13), %rdi
movq %r14, %rsi
callq 0x3140
movq 0xf0(%rsp), %rax
movq %rax, 0x78(%r13)
movq 0x78(%rsp), %rax
movq %rax, (%r13)
movq 0xd0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x15ca0
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x15cb7
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x15cd4
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3200
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x15d0b
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x15d0b
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x15d76
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x15d76
jmp 0x15d28
jmp 0x15d52
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x15d55
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x15d55
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x15d8a
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x15d8a
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
jne 0x15d97
jmp 0x15da7
jmp 0x15d87
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r12, %rdi
je 0x15da7
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x3340