// File: /workspace/github_cpp_makefile_star2_O3/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 %rdi, %rbp
leaq 0x1c(%rsp), %rax
movl %ecx, (%rax)
leaq 0x18(%rsp), %rcx
movl %r8d, (%rcx)
movq 0x60(%rdi), %r12
movq 0x68(%rdi), %rdx
movq %rsi, 0x20(%rsp)
movq %rsi, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movq %rcx, 0x60(%rsp)
movq %rdx, %rax
subq %r12, %rax
movq %rax, %r14
sarq $0x3, %r14
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %r14
movq %r14, %rbx
sarq $0x2, %rbx
movq %r12, %r15
testq %rbx, %rbx
jle 0x7ab8b
movq %rdx, (%rsp)
movq %rbp, 0x10(%rsp)
imulq $0x160, %rbx, %r15      # imm = 0x160
addq %r12, %r15
incq %rbx
leaq 0x50(%rsp), %rbp
movq %r12, 0x8(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0x7c264
testb %al, %al
jne 0x7abbf
leaq 0x58(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x7c264
testb %al, %al
jne 0x7abc2
leaq 0xb0(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x7c264
testb %al, %al
jne 0x7abc2
leaq 0x108(%r12), %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0x7c264
testb %al, %al
jne 0x7abc2
addq $0x160, %r12            # imm = 0x160
decq %rbx
cmpq $0x1, %rbx
jg 0x7ab04
movq (%rsp), %rdx
movq %rdx, %rax
subq %r15, %rax
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %r12
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
sarq $0x3, %rax
imulq %rcx, %rax
cmpq $0x1, %rax
je 0x7abec
cmpq $0x2, %rax
je 0x7abd2
cmpq $0x3, %rax
jne 0x7ac1d
movq %rdx, %rbx
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x7c264
testb %al, %al
jne 0x7ac02
addq $0x58, %r15
jmp 0x7abd5
movq %r12, %r13
movq 0x10(%rsp), %rbp
movq 0x8(%rsp), %r12
movq (%rsp), %rbx
jmp 0x7ac05
movq %rdx, %rbx
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x7c264
testb %al, %al
jne 0x7ac02
addq $0x58, %r15
jmp 0x7abef
movq %rdx, %rbx
leaq 0x50(%rsp), %rdi
movq %r15, %rsi
callq 0x7c264
testb %al, %al
cmoveq %rbx, %r15
movq %r15, %r13
cmpq %rbx, %r13
je 0x7ac1d
subq %r12, %r13
shrq $0x3, %r13
imull $0xba2e8ba3, %r13d, %r14d # imm = 0xBA2E8BA3
jmp 0x7ace0
leaq 0x40(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x20(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x351dc
movl 0x1c(%rsp), %r8d
movl 0x18(%rsp), %r9d
leaq 0x50(%rsp), %rdi
movl %r14d, %esi
movq %r15, %rdx
movq 0x28(%rsp), %rcx
callq 0x7c47c
addq $0x60, %rbp
leaq 0x50(%rsp), %rsi
movq %rbp, %rdi
callq 0x7c442
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7ac94
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5260
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x7acab
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x5260
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x7acc2
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5260
movslq 0x1c(%rsp), %rax
movq (%rbp), %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 0x7c4fc
jmp 0x7ad07
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ad1e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x5260
movq %rbx, %rdi
callq 0x53d0