// File: /workspace/github_cpp_makefile_star2_O1/ys1998[P]spsim/src/issuer.cpp
// Function: Issuer::tock()
void Issuer::tock(void){
	for(int j=0; j < NUM_ALU; ++j){
		if(!l[j]->valid() && i[j].is_valid()){		// write only when previous data has been read
			auto regs = i[j].physical_regs();
			if(j == addrescal_latch){
				int immediate = i[j].get_immediate();
				l[j]->write(std::make_tuple(i[j], immediate, rf->read(std::get<1>(regs))));
				i[j] = Instruction();
			}else if(j == memory_latch){
				l[j]->write(std::make_tuple(i[j], mem_address, rf->read(std::get<0>(regs))));
				i[j] = Instruction();
			}else{
				l[j]->write(std::make_tuple(i[j], rf->read(std::get<0>(regs)), rf->read(std::get<1>(regs))));
				i[j] = Instruction();
			}
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
xorl %r13d, %r13d
leaq 0x80(%rsp), %r15
xorl %r14d, %r14d
movq 0x1e8(%rbx,%r14,8), %rax
cmpb $0x0, 0x80(%rax)
je 0xb3f8
incq %r14
addq $0x78, %r13
cmpq $0x1e0, %r13            # imm = 0x1E0
jne 0xb3d2
jmp 0xb71a
cmpl $-0x1, 0xc(%rbx,%r13)
je 0xb3e3
cmpl $-0x1, 0x8(%rbx,%r13)
je 0xb3e3
leaq (%rbx,%r13), %rbp
addq $0x8, %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0xac5a
movl 0x220(%rbx), %eax
cmpq %rax, %r14
jne 0xb559
movl 0x38(%rbx,%r13), %eax
movq 0x1e8(%rbx,%r14,8), %r12
movq 0x218(%rbx), %rcx
movslq 0x88(%rsp), %rdx
movl (%rcx,%rdx,4), %ecx
movl %ecx, (%rsp)
movl %eax, 0x4(%rsp)
movl $0xa, %ecx
leaq 0x8(%rsp), %rdi
movq %rbp, 0x90(%rsp)
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x68(%rsp), %rbp
movq %rbp, 0x58(%rsp)
movq 0x58(%rbx,%r13), %rsi
movq 0x60(%rbx,%r13), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %r15
movq %r15, %rdi
callq 0x52b6
movq 0x78(%rbx,%r13), %rax
movq %rax, 0x78(%rsp)
movb $0x1, 0x80(%r12)
leaq 0x8(%r12), %rdi
movl $0xa, %ecx
leaq 0x8(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x58(%r12), %rdi
movq %r15, %rsi
callq 0x3140
movq 0x78(%rsp), %rax
movq %rax, 0x78(%r12)
movl 0x4(%rsp), %eax
movl %eax, 0x4(%r12)
movl (%rsp), %eax
movl %eax, (%r12)
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb4ef
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3200
leaq (%rbx,%r13), %r12
addq $0x58, %r12
movq %rsp, %r15
movq %r15, %rdi
callq 0x7c0a
movl $0xa, %ecx
movq 0x90(%rsp), %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
callq 0x3270
movq 0x70(%rsp), %rax
movq %rax, 0x20(%r12)
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
leaq 0x80(%rsp), %r15
je 0xb3e3
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0xb3e3
movl 0x224(%rbx), %eax
movq 0x1e8(%rbx,%r14,8), %r12
cmpq %rax, %r14
jne 0xb5fc
movq 0x218(%rbx), %rax
movslq 0x8c(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, (%rsp)
movl 0x230(%rbx), %eax
movl %eax, 0x4(%rsp)
movl $0xa, %ecx
leaq 0x8(%rsp), %rdi
movq %rbp, %r15
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x68(%rsp), %rbp
movq %rbp, 0x58(%rsp)
movq 0x58(%rbx,%r13), %rsi
movq 0x60(%rbx,%r13), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x52b6
movq 0x78(%rbx,%r13), %rax
movq %rax, 0x78(%rsp)
movb $0x1, 0x80(%r12)
leaq 0x8(%r12), %rdi
movl $0xa, %ecx
leaq 0x8(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x58(%r12), %rdi
leaq 0x58(%rsp), %rsi
callq 0x3140
jmp 0xb688
movq 0x218(%rbx), %rax
movslq 0x8c(%rsp), %rcx
movl (%rax,%rcx,4), %ecx
movslq 0x88(%rsp), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, (%rsp)
movl %ecx, 0x4(%rsp)
movl $0xa, %ecx
leaq 0x8(%rsp), %rdi
movq %rbp, %r15
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x68(%rsp), %rbp
movq %rbp, 0x58(%rsp)
movq 0x58(%rbx,%r13), %rsi
movq 0x60(%rbx,%r13), %rdx
addq %rsi, %rdx
leaq 0x58(%rsp), %rdi
callq 0x52b6
movq 0x78(%rbx,%r13), %rax
movq %rax, 0x78(%rsp)
movb $0x1, 0x80(%r12)
leaq 0x8(%r12), %rdi
movl $0xa, %ecx
leaq 0x8(%rsp), %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x58(%r12), %rdi
leaq 0x58(%rsp), %rsi
callq 0x3140
movq 0x78(%rsp), %rax
movq %rax, 0x78(%r12)
movl 0x4(%rsp), %eax
movl %eax, 0x4(%r12)
movl (%rsp), %eax
movl %eax, (%r12)
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb6b9
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3200
leaq (%rbx,%r13), %r12
addq $0x58, %r12
movq %rsp, %rbp
movq %rbp, %rdi
callq 0x7c0a
movl $0xa, %ecx
movq %r15, %rdi
movq %rbp, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
leaq 0x50(%rsp), %rsi
callq 0x3270
movq 0x70(%rsp), %rax
movq %rax, 0x20(%r12)
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0xb70d
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x80(%rsp), %r15
jmp 0xb3e3
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xb730
jmp 0xb730
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0xb74a
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x3340