// File: ys1998[P]spsim/src/writer.cpp
// Function: Writer::tock()
void Writer::tock(void){
	Instruction i1 = std::get<0>(t1), i2 = std::get<0>(t2), i3 = std::get<0>(t3);
	if(i1.is_valid()){
		i1.WB = CLOCK;
		a->graduate(i1);
		Instruction reset; t1 = std::make_tuple(reset, 0);
	}
	if(i2.is_valid()){
		i2.WB = CLOCK;
		a->graduate(i2);
		Instruction reset; t2 = std::make_tuple(reset, 0, 0);
	}
	if(i3.is_valid()){
		i3.WB = CLOCK;
		a->graduate(i3);
		Instruction reset; t3 = std::make_tuple(reset, 0);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x490, %rsp            # imm = 0x490
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x488(%rbp)
addq $0x8, %rdi
callq 0x12590
movq %rax, %rsi
leaq -0x80(%rbp), %rdi
callq 0x6c70
movq -0x488(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
callq 0x6360
movq %rax, %rsi
leaq -0xf8(%rbp), %rdi
callq 0x6c70
jmp 0x20be3
movq -0x488(%rbp), %rdi
addq $0x88, %rdi
callq 0x12590
movq %rax, %rsi
leaq -0x180(%rbp), %rdi
callq 0x6c70
jmp 0x20c07
leaq -0x80(%rbp), %rdi
callq 0x6280
movb %al, -0x489(%rbp)
jmp 0x20c18
movb -0x489(%rbp), %al
testb $0x1, %al
jne 0x20c27
jmp 0x20d19
movq -0x488(%rbp), %rax
leaq 0xe687(%rip), %rcx      # 0x2f2bc
movl (%rcx), %ecx
movl %ecx, -0x34(%rbp)
movq 0x1a0(%rax), %rdi
leaq -0x80(%rbp), %rsi
callq 0x13680
jmp 0x20c4c
leaq -0x1f8(%rbp), %rdi
callq 0xe8a0
jmp 0x20c5a
movl $0x0, -0x27c(%rbp)
leaq -0x278(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
leaq -0x27c(%rbp), %rdx
callq 0x214b0
jmp 0x20c80
movq -0x488(%rbp), %rdi
addq $0x8, %rdi
leaq -0x278(%rbp), %rsi
callq 0x213b0
leaq -0x278(%rbp), %rdi
callq 0x64b0
leaq -0x1f8(%rbp), %rdi
callq 0x61d0
jmp 0x20d19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x20f1b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x20f0f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
jmp 0x20f03
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x1f8(%rbp), %rdi
callq 0x61d0
jmp 0x20f03
leaq -0xf8(%rbp), %rdi
callq 0x6280
movb %al, -0x48a(%rbp)
jmp 0x20d2d
movb -0x48a(%rbp), %al
testb $0x1, %al
jne 0x20d3c
jmp 0x20e03
movq -0x488(%rbp), %rax
leaq 0xe572(%rip), %rcx      # 0x2f2bc
movl (%rcx), %ecx
movl %ecx, -0xac(%rbp)
movq 0x1a0(%rax), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x13680
jmp 0x20d67
leaq -0x2f8(%rbp), %rdi
callq 0xe8a0
jmp 0x20d75
movl $0x0, -0x37c(%rbp)
movl $0x0, -0x380(%rbp)
leaq -0x378(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
leaq -0x37c(%rbp), %rdx
leaq -0x380(%rbp), %rcx
callq 0x12610
jmp 0x20dac
movq -0x488(%rbp), %rdi
addq $0x108, %rdi            # imm = 0x108
leaq -0x378(%rbp), %rsi
callq 0x21430
leaq -0x378(%rbp), %rdi
callq 0x62f0
leaq -0x2f8(%rbp), %rdi
callq 0x61d0
jmp 0x20e03
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x2f8(%rbp), %rdi
callq 0x61d0
jmp 0x20f03
leaq -0x180(%rbp), %rdi
callq 0x6280
movb %al, -0x48b(%rbp)
jmp 0x20e17
movb -0x48b(%rbp), %al
testb $0x1, %al
jne 0x20e26
jmp 0x20ed9
movq -0x488(%rbp), %rax
leaq 0xe488(%rip), %rcx      # 0x2f2bc
movl (%rcx), %ecx
movl %ecx, -0x134(%rbp)
movq 0x1a0(%rax), %rdi
leaq -0x180(%rbp), %rsi
callq 0x13680
jmp 0x20e51
leaq -0x3f8(%rbp), %rdi
callq 0xe8a0
jmp 0x20e5f
movl $0x0, -0x47c(%rbp)
leaq -0x478(%rbp), %rdi
leaq -0x3f8(%rbp), %rsi
leaq -0x47c(%rbp), %rdx
callq 0x214b0
jmp 0x20e85
movq -0x488(%rbp), %rdi
addq $0x88, %rdi
leaq -0x478(%rbp), %rsi
callq 0x213b0
leaq -0x478(%rbp), %rdi
callq 0x64b0
leaq -0x3f8(%rbp), %rdi
callq 0x61d0
jmp 0x20ed9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x100(%rbp)
movl %eax, -0x104(%rbp)
leaq -0x3f8(%rbp), %rdi
callq 0x61d0
jmp 0x20f03
leaq -0x180(%rbp), %rdi
callq 0x61d0
leaq -0xf8(%rbp), %rdi
callq 0x61d0
leaq -0x80(%rbp), %rdi
callq 0x61d0
addq $0x490, %rsp            # imm = 0x490
popq %rbp
retq
leaq -0x180(%rbp), %rdi
callq 0x61d0
leaq -0xf8(%rbp), %rdi
callq 0x61d0
leaq -0x80(%rbp), %rdi
callq 0x61d0
movq -0x100(%rbp), %rdi
callq 0x3480