// File: /workspace/github_cpp_makefile_star2_O1/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 0x16661
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 0x52b6
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 0x52b6
movq 0x170(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpl %ebp, (%rsp)
jge 0x1662d
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 0x52b6
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 0x1662d
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x16644
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x150(%rsp), %rdi
cmpq %r12, %rdi
je 0x16661
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x190(%rbx), %r15
cmpb $0x1, 0x80(%r15)
jne 0x16802
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 0x52b6
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 0x52b6
movq 0x170(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpl %ebp, (%rsp)
jge 0x167ce
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 0x52b6
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 0x167ce
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x50(%rsp), %rdi
cmpq %r14, %rdi
je 0x167e5
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x150(%rsp), %rdi
cmpq %r12, %rdi
je 0x16802
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x198(%rbx), %r12
cmpb $0x1, 0x80(%r12)
jne 0x169a3
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 0x52b6
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 0x52b6
movq 0x170(%rsp), %rax
movq %rax, 0x70(%rsp)
cmpl %ebp, (%rsp)
jge 0x1696f
movq 0xf8(%rsp), %rax
movq 0x198(%rbx), %r13
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 0x52b6
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)
movl 0x7c(%rsp), %eax
movl %eax, 0x4(%r13)
movl 0x78(%rsp), %eax
movl %eax, (%r13)
movq 0xd0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1696f
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x16986
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
je 0x169a3
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 0x169da
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x169da
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x16a45
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x16a45
jmp 0x169f7
jmp 0x16a21
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x16a24
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x16a24
movq %rax, %rbx
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x16a59
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x16a59
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r15, %rdi
jne 0x16a66
jmp 0x16a76
jmp 0x16a56
movq %rax, %rbx
movq 0x150(%rsp), %rdi
cmpq %r12, %rdi
je 0x16a76
movq 0x160(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x3340