// File: /workspace/github_cpp_makefile_star2_O1/sighingnow[P]compile-pascal/pl0_opt.cpp
// Function: BasicBlock::findNode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, Value*, int, int)
int BasicBlock::findNode(std::string op, Value *val, int rs, int rt) {
    // find op and target.
    auto iter = std::find_if(G.begin(), G.end(), [&](DAGNode & node) {
        return op == node.op && rs == node.lhs && rt == node.rhs;
    });
    if (iter != G.end()) {
        return iter - G.begin();
    }
    else {
        int k = G.size();
        G.emplace_back(DAGNode(k, op, val, rs, rt));
        G[rs].moreFa(); G[rt].moreFa();
        return k;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %r15
leaq 0x1c(%rsp), %rax
movl %ecx, (%rax)
leaq 0x18(%rsp), %rcx
movl %r8d, (%rcx)
movq 0x60(%rdi), %r12
movq %rdi, 0x20(%rsp)
movq 0x68(%rdi), %rdx
movq %rsi, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movq %rcx, 0x60(%rsp)
movq %rdx, %r14
subq %r12, %r14
sarq $0x3, %r14
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %r14
movq %r14, %rbx
sarq $0x2, %rbx
movq %r12, %r13
testq %rbx, %rbx
jle 0x8043a
movq %rdx, (%rsp)
movq %r15, 0x10(%rsp)
imulq $0x160, %rbx, %r13      # imm = 0x160
addq %r12, %r13
incq %rbx
leaq 0x50(%rsp), %r15
movq %r12, 0x8(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x81b08
testb %al, %al
jne 0x80477
leaq 0x58(%r12), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x81b08
testb %al, %al
jne 0x8047a
leaq 0xb0(%r12), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x81b08
testb %al, %al
jne 0x8047a
leaq 0x108(%r12), %rbp
movq %r15, %rdi
movq %rbp, %rsi
callq 0x81b08
testb %al, %al
jne 0x8047a
addq $0x160, %r12            # imm = 0x160
decq %rbx
cmpq $0x1, %rbx
jg 0x803b9
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r12
movq (%rsp), %rdx
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
movq %rdx, %rax
subq %r13, %rax
sarq $0x3, %rax
imulq %rcx, %rax
cmpq $0x1, %rax
je 0x804a6
cmpq $0x2, %rax
je 0x8048a
movq %rdx, %rbp
cmpq $0x3, %rax
jne 0x804c8
movq %rdx, %rbx
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x81b08
testb %al, %al
jne 0x8049e
addq $0x58, %r13
jmp 0x8048d
movq %r12, %rbp
movq 0x10(%rsp), %r15
movq 0x8(%rsp), %r12
movq (%rsp), %rdx
jmp 0x804c8
movq %rdx, %rbx
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x81b08
testb %al, %al
je 0x804ab
movq %r13, %rbp
movq %rbx, %rdx
jmp 0x804c8
movq %rdx, %rbx
jmp 0x804af
addq $0x58, %r13
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x81b08
testb %al, %al
movq %rbx, %rdx
cmoveq %rbx, %r13
movq %r13, %rbp
cmpq %rdx, %rbp
je 0x804e0
subq %r12, %rbp
shrq $0x3, %rbp
imull $0xba2e8ba3, %ebp, %r14d # imm = 0xBA2E8BA3
jmp 0x805a2
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x36590
movl 0x1c(%rsp), %r8d
movl 0x18(%rsp), %r9d
leaq 0x50(%rsp), %rdi
movl %r14d, %esi
movq %r15, %rdx
movq 0x28(%rsp), %rcx
callq 0x81cfc
movq 0x20(%rsp), %rbx
addq $0x60, %rbx
leaq 0x50(%rsp), %rsi
movq %rbx, %rdi
callq 0x81cca
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x80557
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x8056e
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x5260
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x80585
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5260
movslq 0x1c(%rsp), %rax
movq (%rbx), %rcx
imulq $0x58, %rax, %rax
incl 0x4(%rcx,%rax)
movslq 0x18(%rsp), %rax
imulq $0x58, %rax, %rax
incl 0x4(%rcx,%rax)
movl %r14d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x81d7c
jmp 0x805c9
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x805e0
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5260
movq %rbx, %rdi
callq 0x53d0