// File: /workspace/github_cpp_makefile_star2_O2/sighingnow[P]compile-pascal/pl0_opt.cpp
// Function: BasicBlock::buildDAG()
void BasicBlock::buildDAG() {
    size_t p = this->s;
    int rd, rs, rt, t;
    for (p = 1; code[p].op != "cmp" && code[p].op != "goto" && code[p].op != "call"
            && code[p].op != "loadret" && code[p].op != "exit" && code[p].op != "endproc"; ++p)
    {
        if (code[p].op == "*" || code[p].op == "/" || code[p].op == "%"
                || code[p].op == "+" || code[p].op == "-"
                || code[p].op == "cmp"
                || code[p].op == "=[]" || code[p].op == "[]=") {
            rs = findNode(code[p].rs);
            setMap(code[p].rs, rs);
            rt = findNode(code[p].rt);
            setMap(code[p].rt, rt);
            rd = findNode(code[p].op, code[p].rd, rs, rt);
            setMap(code[p].rd, rd);
        }
        else if (code[p].op == "=") {
            // rs = findNode(code[p].rs);
            // setMap(code[p].rs, rs);
            // setMap(code[p].rd, rs);
            code[p].rt = new Value(0, "integer");
            rs = findNode(code[p].rs);
            setMap(code[p].rs, rs);
            rt = findNode(code[p].rt);
            setMap(code[p].rt, rt);
            rd = findNode(code[p].op, code[p].rd, rs, rt);
            setMap(code[p].rd, rd);
        }
        else if (code[p].op == "write_s") {
            IOBuf.emplace_back(make_pair(p, code[p]));
        }
        else if (code[p].op == "write_e") {
            rd = findNode(code[p].rd);
            t = G.size();
            G.emplace_back(DAGNode(t, "write_e", new Value("~write_e", "cmd"), rd, p));
            G[rd].moreFa();
        }
        else if (code[p].op == "read") {
            rd = findNode(code[p].rd);
            t = G.size();
            G.emplace_back(DAGNode(t, "read", code[p].rd, rd, p));
            G[rd].moreFa();
            setMap(code[p].rd, t);
        }
    }
    this->t = p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, %rbx
leaq 0x60(%rdi), %r14
leaq 0xa8(%rdi), %rax
movq %rax, 0x28(%rsp)
pushq $0x1
popq %r15
leaq 0x38(%rsp), %r12
xorl %ebp, %ebp
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10cde(%rip), %rsi     # 0x5aabe
callq 0x47a19
testb %al, %al
je 0x4a3da
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10cc2(%rip), %rsi     # 0x5aac2
callq 0x47a19
testb %al, %al
je 0x4a3da
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0xfc73(%rip), %rsi      # 0x59a93
callq 0x47a19
testb %al, %al
je 0x4a3da
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10b88(%rip), %rsi     # 0x5a9c8
callq 0x47a19
testb %al, %al
je 0x4a3da
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10af6(%rip), %rsi     # 0x5a956
callq 0x47a19
testb %al, %al
je 0x4a3da
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10adb(%rip), %rsi     # 0x5a95b
callq 0x47a19
testb %al, %al
je 0x4a3da
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x11296(%rip), %rsi     # 0x5b136
callq 0x15c52
testb %al, %al
jne 0x49f7d
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10e56(%rip), %rsi     # 0x5ad16
callq 0x15c52
testb %al, %al
jne 0x49f7d
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10e38(%rip), %rsi     # 0x5ad18
callq 0x15c52
testb %al, %al
jne 0x49f7d
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10cb8(%rip), %rsi     # 0x5abb8
callq 0x15c52
testb %al, %al
jne 0x49f7d
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x111b3(%rip), %rsi     # 0x5b0cf
callq 0x15c52
testb %al, %al
jne 0x49f7d
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10b86(%rip), %rsi     # 0x5aabe
callq 0x15c52
testb %al, %al
jne 0x49f7d
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10cf2(%rip), %rsi     # 0x5ac46
callq 0x15c52
testb %al, %al
jne 0x49f7d
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10b28(%rip), %rsi     # 0x5aa98
callq 0x15c52
testb %al, %al
je 0x4a049
movq %r15, 0x8(%rsp)
movq %r14, %r13
movq 0x18(%rbx), %rax
movq 0x78(%rax,%rbp), %rsi
movq %rbx, %rdi
callq 0x4a4ca
movl %eax, %r12d
movq 0x18(%rbx), %rax
movq 0x78(%rax,%rbp), %rsi
movq %rbx, %rdi
movl %r12d, %edx
callq 0x4a558
movq 0x18(%rbx), %rax
movq 0x80(%rax,%rbp), %rsi
movq %rbx, %rdi
callq 0x4a4ca
movl %eax, %r14d
movq 0x18(%rbx), %rax
movq 0x80(%rax,%rbp), %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x4a558
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rsi
addq $0x50, %rsi
leaq 0x148(%rsp), %r15
movq %r15, %rdi
callq 0x5340
movq 0x18(%rbx), %rax
movq 0x70(%rax,%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %ecx
movl %r14d, %r8d
callq 0x4a63e
movl %eax, %r12d
movq %r15, %rdi
callq 0x5120
movq 0x18(%rbx), %rax
movq 0x70(%rax,%rbp), %rsi
movq %rbx, %rdi
movl %r12d, %edx
callq 0x4a558
leaq 0x38(%rsp), %r12
movq %r13, %r14
movq 0x8(%rsp), %r15
incq %r15
addq $0x50, %rbp
jmp 0x49dcd
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0xf0bc(%rip), %rsi      # 0x59118
callq 0x15c52
testb %al, %al
je 0x4a170
pushq $0x48
popq %rdi
callq 0x5260
movq %rax, %r13
leaq 0x128(%rsp), %r12
movq %r12, %rdi
leaq 0xf089(%rip), %rsi      # 0x5910f
leaq 0x30(%rsp), %rdx
callq 0xfa26
movq %r14, 0x8(%rsp)
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x46ac6
movq 0x18(%rbx), %rax
movq %r13, 0x80(%rax,%rbp)
movq %r12, %rdi
callq 0x5120
movq 0x18(%rbx), %rax
movq 0x78(%rax,%rbp), %rsi
movq %rbx, %rdi
callq 0x4a4ca
movl %eax, %r12d
movq 0x18(%rbx), %rax
movq 0x78(%rax,%rbp), %rsi
movq %rbx, %rdi
movl %r12d, %edx
callq 0x4a558
movq 0x18(%rbx), %rax
movq 0x80(%rax,%rbp), %rsi
movq %rbx, %rdi
callq 0x4a4ca
movl %eax, %r14d
movq 0x18(%rbx), %rax
movq 0x80(%rax,%rbp), %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x4a558
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rsi
addq $0x50, %rsi
leaq 0x108(%rsp), %r13
movq %r13, %rdi
callq 0x5340
movq 0x18(%rbx), %rax
movq 0x70(%rax,%rbp), %rdx
movq %rbx, %rdi
movq %r13, %rsi
movl %r12d, %ecx
movl %r14d, %r8d
callq 0x4a63e
movl %eax, %r12d
movq %r13, %rdi
callq 0x5120
movq 0x18(%rbx), %rax
movq 0x70(%rax,%rbp), %rsi
movq %rbx, %rdi
movl %r12d, %edx
callq 0x4a558
leaq 0x38(%rsp), %r12
movq 0x8(%rsp), %r14
jmp 0x4a03d
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10a53(%rip), %rsi     # 0x5abd6
callq 0x15c52
testb %al, %al
je 0x4a1c1
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rsi
addq $0x50, %rsi
movq %r15, 0x30(%rsp)
movq %r12, %rdi
callq 0x3cc92
movq 0x28(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x4b7f6
movq %r12, %rdi
callq 0x3ccde
jmp 0x4a03d
movq 0x18(%rbx), %rax
leaq (%rax,%rbp), %rdi
addq $0x50, %rdi
leaq 0x10b47(%rip), %r13     # 0x5ad1b
movq %r13, %rsi
callq 0x15c52
movq 0x18(%rbx), %rcx
testb %al, %al
je 0x4a304
movq 0x70(%rcx,%rbp), %rsi
movq %rbx, %rdi
callq 0x4a4ca
movl %eax, 0x4(%rsp)
movq 0x68(%rbx), %rax
subq 0x60(%rbx), %rax
cqto
pushq $0x58
popq %rcx
idivq %rcx
movq %rax, 0x20(%rsp)
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
leaq 0x3(%rsp), %rdx
callq 0xfa26
pushq $0x48
popq %rdi
callq 0x5260
movq %rax, 0x18(%rsp)
leaq 0xa8(%rsp), %rdi
leaq 0x10adb(%rip), %rsi     # 0x5ad1a
leaq 0x17(%rsp), %rdx
callq 0xfa26
movq %r14, 0x8(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x10ac6(%rip), %rsi     # 0x5ad23
leaq 0x16(%rsp), %rdx
callq 0xfa26
movb $0x1, %r14b
movq 0x18(%rsp), %r13
movq %r13, %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0x46fc0
leaq 0x30(%rsp), %rdi
xorl %r14d, %r14d
movq 0x20(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
movq %r13, %rcx
movl 0x4(%rsp), %r8d
movl %r15d, %r9d
callq 0x4b86e
leaq 0x30(%rsp), %rsi
movq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x4b832
leaq 0x30(%rsp), %rdi
callq 0x4b8ce
leaq 0x88(%rsp), %rdi
callq 0x5120
leaq 0xa8(%rsp), %rdi
callq 0x5120
leaq 0xc8(%rsp), %rdi
callq 0x5120
movslq 0x4(%rsp), %rax
movq (%r14), %rcx
imulq $0x58, %rax, %rax
incl 0x4(%rcx,%rax)
jmp 0x4a03d
leaq (%rcx,%rbp), %rdi
addq $0x50, %rdi
leaq 0xee19(%rip), %rsi      # 0x5912c
callq 0x15c52
testb %al, %al
leaq 0xe8(%rsp), %r13
je 0x4a03d
movq 0x18(%rbx), %rax
movq 0x70(%rax,%rbp), %rsi
movq %rbx, %rdi
callq 0x4a4ca
movl %eax, 0x4(%rsp)
movq 0x68(%rbx), %rax
subq 0x60(%rbx), %rax
cqto
pushq $0x58
popq %rcx
idivq %rcx
movq %rax, 0x8(%rsp)
movq %r13, %rdi
leaq 0xedd0(%rip), %rsi      # 0x5912c
leaq 0x3(%rsp), %rdx
callq 0xfa26
movq %r13, %rdx
movq 0x18(%rbx), %rax
movq 0x70(%rax,%rbp), %rcx
leaq 0x30(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl 0x4(%rsp), %r8d
movl %r8d, %r13d
movl %r15d, %r9d
callq 0x4b86e
movq %r14, %rdi
leaq 0x30(%rsp), %rsi
callq 0x4b832
leaq 0x30(%rsp), %rdi
callq 0x4b8ce
leaq 0xe8(%rsp), %rdi
callq 0x5120
movslq %r13d, %rax
movq 0x60(%rbx), %rcx
imulq $0x58, %rax, %rax
incl 0x4(%rcx,%rax)
movq 0x18(%rbx), %rax
movq 0x70(%rax,%rbp), %rsi
movq %rbx, %rdi
movq 0x8(%rsp), %rdx
callq 0x4a558
jmp 0x4a03d
movl %r15d, 0x14(%rbx)
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4a411
movq %rax, %rbx
jmp 0x4a404
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4b8ce
leaq 0xe8(%rsp), %rdi
jmp 0x4a4bd
movq %rax, %rbx
jmp 0x4a4c2
movq %rax, %rbx
movb $0x1, %r14b
jmp 0x4a44d
movq %rax, %rbx
jmp 0x4a46c
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x4b8ce
xorl %r14d, %r14d
jmp 0x4a440
movq %rax, %rbx
jmp 0x4a45f
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x5120
leaq 0xa8(%rsp), %rdi
callq 0x5120
testb %r14b, %r14b
je 0x4a46c
pushq $0x48
popq %rsi
movq 0x18(%rsp), %rdi
callq 0x5270
leaq 0xc8(%rsp), %rdi
jmp 0x4a4bd
movq %rax, %rbx
movq %r12, %rdi
callq 0x3ccde
jmp 0x4a4c2
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
jmp 0x4a4bd
movq %rax, %rbx
jmp 0x4a4a5
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x5120
pushq $0x48
popq %rsi
movq %r13, %rdi
callq 0x5270
jmp 0x4a4c2
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x5120
movq %rbx, %rdi
callq 0x53f0