// File: /workspace/github_cpp_makefile_star2_O2/sighingnow[P]compile-pascal/pl0_opt.cpp
// Function: BasicBlock::trans(std::vector<TAC, std::allocator<TAC>>&, int)
void BasicBlock::trans(std::vector<TAC> & irs, int nno) {
    if (G[nno].op == "=") {
        irs.emplace_back(TAC(G[nno].op, G[nno].item, G[G[nno].lhs].item));
    }
    else if (G[nno].op == "read") {
        while (!this->IOBuf.empty()) {
            if (this->IOBuf[0].first < G[nno].rhs) {
                irs.emplace_back(this->IOBuf[0].second);
                this->IOBuf.erase(IOBuf.begin());
            }
            else {
                break;
            }
        }
        irs.emplace_back(TAC("read", G[G[nno].lhs].item));
    }
    else if (G[nno].op == "write_e") {
        while (!this->IOBuf.empty()) {
            if (this->IOBuf[0].first < G[nno].rhs) {
                irs.emplace_back(this->IOBuf[0].second);
                this->IOBuf.erase(IOBuf.begin());
            }
            else {
                break;
            }
        }
        irs.emplace_back(TAC("write_e", G[G[nno].lhs].item));
    }
    else {
        irs.emplace_back(TAC(G[nno].op, G[nno].item, G[G[nno].lhs].item, G[G[nno].rhs].item));
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movslq %edx, %rax
movq 0x60(%rdi), %rcx
imulq $0x58, %rax, %r12
leaq (%rcx,%r12), %rdi
addq $0x30, %rdi
leaq 0xe3b0(%rip), %rsi      # 0x59118
callq 0x15c52
testb %al, %al
je 0x4add8
movq 0x60(%r14), %rax
leaq (%rax,%r12), %rsi
addq $0x30, %rsi
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
callq 0x5340
movq 0x60(%r14), %rax
movq 0x10(%rax,%r12), %rdx
movslq 0x50(%rax,%r12), %rcx
imulq $0x58, %rcx, %rcx
movq 0x10(%rax,%rcx), %rcx
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
xorl %r8d, %r8d
callq 0x47f44
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x47f08
leaq 0x8(%rsp), %rdi
callq 0x3ccde
leaq 0xb8(%rsp), %rdi
jmp 0x4afbe
movq 0x60(%r14), %rax
leaq (%rax,%r12), %rdi
addq $0x30, %rdi
leaq 0xe341(%rip), %rsi      # 0x5912c
callq 0x15c52
testb %al, %al
je 0x4ae35
leaq 0xa8(%r14), %r15
movq 0xa8(%r14), %rsi
cmpq 0xb0(%r14), %rsi
je 0x4ae9a
movl (%rsi), %eax
movq 0x60(%r14), %rcx
cmpl 0x54(%rcx,%r12), %eax
jge 0x4ae9a
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x4b6f0
movq (%r15), %rsi
movq %r15, %rdi
callq 0x4bab6
jmp 0x4adfb
movq 0x60(%r14), %rax
leaq (%rax,%r12), %rdi
addq $0x30, %rdi
leaq 0xfed3(%rip), %rsi      # 0x5ad1b
callq 0x15c52
testb %al, %al
je 0x4aef7
leaq 0xa8(%r14), %r15
movq 0xa8(%r14), %rsi
cmpq 0xb0(%r14), %rsi
je 0x4af66
movl (%rsi), %eax
movq 0x60(%r14), %rcx
cmpl 0x54(%rcx,%r12), %eax
jge 0x4af66
addq $0x8, %rsi
movq %rbx, %rdi
callq 0x4b6f0
movq (%r15), %rsi
movq %r15, %rdi
callq 0x4bab6
jmp 0x4ae5c
leaq 0xe28b(%rip), %rsi      # 0x5912c
leaq 0x78(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xfa26
movq 0x60(%r14), %rax
movslq 0x50(%rax,%r12), %rcx
imulq $0x58, %rcx, %rcx
movq 0x10(%rax,%rcx), %rdx
leaq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x47f44
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x47f08
leaq 0x8(%rsp), %rdi
callq 0x3ccde
leaq 0x78(%rsp), %rdi
jmp 0x4afbe
movq 0x60(%r14), %rax
leaq (%rax,%r12), %rsi
addq $0x30, %rsi
leaq 0x98(%rsp), %r15
movq %r15, %rdi
callq 0x5340
movq 0x60(%r14), %rax
movq 0x10(%rax,%r12), %rdx
movslq 0x50(%rax,%r12), %rcx
imulq $0x58, %rcx, %rcx
movq 0x10(%rax,%rcx), %rcx
movslq 0x54(%rax,%r12), %rsi
imulq $0x58, %rsi, %rsi
movq 0x10(%rax,%rsi), %r8
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x47f44
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x47f08
leaq 0x8(%rsp), %rdi
callq 0x3ccde
leaq 0x98(%rsp), %rdi
jmp 0x4afbe
leaq 0xfdae(%rip), %rsi      # 0x5ad1b
leaq 0x58(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xfa26
movq 0x60(%r14), %rax
movslq 0x50(%rax,%r12), %rcx
imulq $0x58, %rcx, %rcx
movq 0x10(%rax,%rcx), %rdx
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x47f44
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x47f08
leaq 0x8(%rsp), %rdi
callq 0x3ccde
leaq 0x58(%rsp), %rdi
callq 0x5120
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3ccde
jmp 0x4afe4
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x4b041
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3ccde
jmp 0x4afff
jmp 0x4b022
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x4b041
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3ccde
jmp 0x4b01b
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x4b041
movq %rax, %rbx
jmp 0x4b046
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3ccde
jmp 0x4b039
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0x5120
movq %rbx, %rdi
callq 0x53f0