// File: 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 %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x230(%rbp)
addq $0x60, %rdi
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq %rax, %rdi
addq $0x30, %rdi
leaq 0x23e70(%rip), %rsi     # 0xef41c
callq 0x2a580
testb $0x1, %al
jne 0xcb5ba
jmp 0xcb6c3
movq -0x230(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x250(%rbp)
addq $0x60, %rdi
movq %rdi, -0x248(%rbp)
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq %rax, %rsi
addq $0x30, %rsi
leaq -0x88(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0x5150
movq -0x248(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq -0x248(%rbp), %rdi
movq 0x10(%rax), %rax
movq %rax, -0x238(%rbp)
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq -0x248(%rbp), %rdi
movslq 0x50(%rax), %rsi
callq 0xcd130
movq -0x240(%rbp), %rsi
movq -0x238(%rbp), %rdx
movq 0x10(%rax), %rcx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x68(%rbp), %rdi
callq 0xc15f0
jmp 0xcb657
movq -0x250(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xc1570
jmp 0xcb669
leaq -0x68(%rbp), %rdi
callq 0xa3cd0
leaq -0x88(%rbp), %rdi
callq 0x5200
jmp 0xcbca5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0xcb6b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xa3cd0
leaq -0x88(%rbp), %rdi
callq 0x5200
jmp 0xcbcae
movq -0x230(%rbp), %rdi
addq $0x60, %rdi
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq %rax, %rdi
addq $0x30, %rdi
leaq 0x23ed2(%rip), %rsi     # 0xef5b7
callq 0x2a580
testb $0x1, %al
jne 0xcb6f3
jmp 0xcb914
jmp 0xcb6f5
movq -0x230(%rbp), %rdi
addq $0xa8, %rdi
callq 0xcdd20
xorb $-0x1, %al
testb $0x1, %al
jne 0xcb713
jmp 0xcb7ed
movq -0x230(%rbp), %rdi
addq $0xa8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xcdd60
movq -0x230(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x254(%rbp)
addq $0x60, %rdi
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq %rax, %rcx
movl -0x254(%rbp), %eax
cmpl 0x54(%rcx), %eax
jge 0xcb7e6
movq -0x230(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x268(%rbp)
addq $0xa8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xcdd60
movq -0x268(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0xccb20
movq -0x230(%rbp), %rdi
movq %rdi, %rax
addq $0xa8, %rax
movq %rax, -0x260(%rbp)
addq $0xa8, %rdi
callq 0xcddf0
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xcde20
movq -0x260(%rbp), %rdi
movq -0xa0(%rbp), %rsi
callq 0xcdd80
movq %rax, -0xb0(%rbp)
jmp 0xcb7e8
jmp 0xcb7ed
jmp 0xcb6f5
movq -0x10(%rbp), %rax
movq %rax, -0x278(%rbp)
leaq -0x121(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x55d0
movq -0x270(%rbp), %rdx
leaq 0x23d9e(%rip), %rsi     # 0xef5b7
leaq -0x120(%rbp), %rdi
callq 0x19840
jmp 0xcb827
movq -0x230(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x280(%rbp)
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq -0x280(%rbp), %rdi
movslq 0x50(%rax), %rsi
callq 0xcd130
movq 0x10(%rax), %rdx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movq %r8, %rcx
callq 0xc15f0
jmp 0xcb873
movq -0x278(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xc1570
jmp 0xcb888
leaq -0x100(%rbp), %rdi
callq 0xa3cd0
leaq -0x120(%rbp), %rdi
callq 0x5200
leaq -0x121(%rbp), %rdi
callq 0x53c0
jmp 0xcbca3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0xcb903
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0xcb8f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x100(%rbp), %rdi
callq 0xa3cd0
leaq -0x120(%rbp), %rdi
callq 0x5200
leaq -0x121(%rbp), %rdi
callq 0x53c0
jmp 0xcbcae
movq -0x230(%rbp), %rdi
addq $0x60, %rdi
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq %rax, %rdi
addq $0x30, %rdi
leaq 0x25add(%rip), %rsi     # 0xf1413
callq 0x2a580
testb $0x1, %al
jne 0xcb944
jmp 0xcbb65
jmp 0xcb946
movq -0x230(%rbp), %rdi
addq $0xa8, %rdi
callq 0xcdd20
xorb $-0x1, %al
testb $0x1, %al
jne 0xcb964
jmp 0xcba3e
movq -0x230(%rbp), %rdi
addq $0xa8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xcdd60
movq -0x230(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x284(%rbp)
addq $0x60, %rdi
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq %rax, %rcx
movl -0x284(%rbp), %eax
cmpl 0x54(%rcx), %eax
jge 0xcba37
movq -0x230(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x298(%rbp)
addq $0xa8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xcdd60
movq -0x298(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0xccb20
movq -0x230(%rbp), %rdi
movq %rdi, %rax
addq $0xa8, %rax
movq %rax, -0x290(%rbp)
addq $0xa8, %rdi
callq 0xcddf0
movq %rax, -0x138(%rbp)
leaq -0x130(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0xcde20
movq -0x290(%rbp), %rdi
movq -0x130(%rbp), %rsi
callq 0xcdd80
movq %rax, -0x140(%rbp)
jmp 0xcba39
jmp 0xcba3e
jmp 0xcb946
movq -0x10(%rbp), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x1b1(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x55d0
movq -0x2a0(%rbp), %rdx
leaq 0x259a9(%rip), %rsi     # 0xf1413
leaq -0x1b0(%rbp), %rdi
callq 0x19840
jmp 0xcba78
movq -0x230(%rbp), %rdi
addq $0x60, %rdi
movq %rdi, -0x2b0(%rbp)
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq -0x2b0(%rbp), %rdi
movslq 0x50(%rax), %rsi
callq 0xcd130
movq 0x10(%rax), %rdx
xorl %eax, %eax
movl %eax, %r8d
leaq -0x190(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
movq %r8, %rcx
callq 0xc15f0
jmp 0xcbac4
movq -0x2a8(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xc1570
jmp 0xcbad9
leaq -0x190(%rbp), %rdi
callq 0xa3cd0
leaq -0x1b0(%rbp), %rdi
callq 0x5200
leaq -0x1b1(%rbp), %rdi
callq 0x53c0
jmp 0xcbca1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0xcbb54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0xcbb48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x190(%rbp), %rdi
callq 0xa3cd0
leaq -0x1b0(%rbp), %rdi
callq 0x5200
leaq -0x1b1(%rbp), %rdi
callq 0x53c0
jmp 0xcbcae
movq -0x230(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x2d8(%rbp)
addq $0x60, %rdi
movq %rdi, -0x2d0(%rbp)
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq %rax, %rsi
addq $0x30, %rsi
leaq -0x228(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x5150
movq -0x2d0(%rbp), %rdi
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq -0x2d0(%rbp), %rdi
movq 0x10(%rax), %rax
movq %rax, -0x2c0(%rbp)
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq -0x2d0(%rbp), %rdi
movslq 0x50(%rax), %rsi
callq 0xcd130
movq -0x2d0(%rbp), %rdi
movq 0x10(%rax), %rax
movq %rax, -0x2b8(%rbp)
movslq -0x14(%rbp), %rsi
callq 0xcd130
movq -0x2d0(%rbp), %rdi
movslq 0x54(%rax), %rsi
callq 0xcd130
movq -0x2c8(%rbp), %rsi
movq -0x2c0(%rbp), %rdx
movq -0x2b8(%rbp), %rcx
movq 0x10(%rax), %r8
leaq -0x208(%rbp), %rdi
callq 0xc15f0
jmp 0xcbc32
movq -0x2d8(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0xc1570
jmp 0xcbc47
leaq -0x208(%rbp), %rdi
callq 0xa3cd0
leaq -0x228(%rbp), %rdi
callq 0x5200
jmp 0xcbca1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0xcbc93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x208(%rbp), %rdi
callq 0xa3cd0
leaq -0x228(%rbp), %rdi
callq 0x5200
jmp 0xcbcae
jmp 0xcbca3
jmp 0xcbca5
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x55b0
nopw (%rax,%rax)