// File: /workspace/github_cpp_makefile_star2_O1/luooofan[P]hblzbd_compiler/src/Pass/loop_invariant_extrapolation.cpp
// Function: check3(int, std::vector<std::vector<int, std::allocator<int>>, std::allocator<std::vector<int, std::allocator<int>>>>, std::vector<int, std::allocator<int>>, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::map<int, IRBasicBlock*, std::less<int>, std::allocator<std::pair<int const, IRBasicBlock*>>>, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>)
bool check3(int enter, vector<vector<int> > to, vector<int> out, int def, string name, map<int, IRBasicBlock*> id_bb,
            vector<pair<int, int> > use)  // 这个入口节点直接用新建的那个基本块，好写
// enter用新建的那个空基本块作为入口，to就是图，out是出口节点，不能出去，因为有check2，所以def只会有1次，
//所以这里def是int，然后x的use情况
{
  queue<int> qqq;
  set<int> vis;
  qqq.push(enter);
  while (!qqq.empty()) {
    int x = qqq.front();
    qqq.pop();
    if (x == def) continue;  // 条件2保证只有1个def。此处是遇到def则可以了
    if (vis.find(x) != vis.end()) continue;
    auto bb = id_bb[x];
    for (int i = 0; i < bb->ir_list_.size(); i++) {
      auto op1 = bb->ir_list_[i]->opn1_.name_, op2 = bb->ir_list_[i]->opn2_.name_, res = bb->ir_list_[i]->res_.name_;
      if (op1 == name || op2 == name) return false;
      if (res == name) break;
    }
    vis.insert(x);
    for (int i = 0; i < to[x].size(); i++) {
      int y = to[x][i];
      if (vis.find(y) != vis.end()) continue;
      qqq.push(y);
    }
  }
  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %r9, 0xb0(%rsp)
movq %r8, 0x8(%rsp)
movl %ecx, %r13d
movq %rsi, 0x38(%rsp)
movl %edi, 0x4(%rsp)
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rbx
movaps %xmm0, 0x40(%rbx)
movaps %xmm0, 0x30(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x26f56
leaq 0xe0(%rsp), %rbp
movl $0x0, (%rbp)
movq %r14, 0x8(%rbp)
movq %rbp, 0x10(%rbp)
movq %rbp, 0x18(%rbp)
movq %r14, 0x20(%rbp)
movq 0x30(%rbx), %rax
movq 0x40(%rbx), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x5bb23
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
addq $0x4, %rax
movq %rax, 0x90(%rsp)
jmp 0x5bb32
leaq 0x60(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0x270cc
movq 0x70(%rsp), %rax
cmpq %rax, 0x90(%rsp)
sete %r12b
je 0x5bedb
movl %r13d, 0x14(%rsp)
movl (%rax), %ecx
movl %ecx, (%rsp)
movq 0x80(%rsp), %rcx
addq $-0x4, %rcx
cmpq %rcx, %rax
je 0x5bb6a
addq $0x4, %rax
jmp 0x5bba5
movq 0x78(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x82a0
movq 0x88(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x88(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x78(%rsp)
leaq 0x200(%rax), %rcx
movq %rcx, 0x80(%rsp)
movq %rax, 0x70(%rsp)
movl (%rsp), %eax
movl $0x2, %r15d
cmpl %r13d, %eax
je 0x5bebe
movq 0xe8(%rsp), %rdx
movq %rbp, %rcx
testq %rdx, %rdx
je 0x5bbe6
movq %rbp, %rcx
xorl %esi, %esi
cmpl %eax, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x5bbcf
movq %rbp, %rdx
cmpq %rbp, %rcx
je 0x5bbf8
cmpl 0x20(%rcx), %eax
cmovlq %rbp, %rcx
movq %rcx, %rdx
cmpq %rbp, %rdx
jne 0x5bebe
movq 0xb0(%rsp), %rdi
movq %rsp, %rsi
callq 0x61372
movq (%rax), %r13
movq 0x10(%r13), %rax
cmpq 0x8(%r13), %rax
je 0x5bdc9
xorl %ebx, %ebx
movq 0x8(%r13), %rax
movq (%rax,%rbx,8), %rax
leaq 0x28(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
leaq 0x18(%rsp), %rdi
callq 0xca10
movq 0x8(%r13), %rax
movq (%rax,%rbx,8), %rax
leaq 0x50(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq 0x50(%rax), %rsi
movq 0x58(%rax), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0xca10
movq 0x8(%r13), %rax
movq (%rax,%rbx,8), %rax
leaq 0xc8(%rsp), %rcx
movq %rcx, 0xb8(%rsp)
movq 0x90(%rax), %rsi
movq 0x98(%rax), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0xca10
movq 0x20(%rsp), %rdx
movq 0x8(%rsp), %rax
movq 0x8(%rax), %r14
cmpq %r14, %rdx
jne 0x5bcdc
movl $0x1, %r15d
testq %rdx, %rdx
je 0x5bd36
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x18(%rsp), %rdi
callq 0x82b0
testl %eax, %eax
je 0x5bd36
movq 0x48(%rsp), %rdx
cmpq %r14, %rdx
jne 0x5bd07
movl $0x1, %r15d
testq %rdx, %rdx
je 0x5bd36
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0x40(%rsp), %rdi
callq 0x82b0
testl %eax, %eax
je 0x5bd36
movq 0xc0(%rsp), %rdx
cmpq %r14, %rdx
jne 0x5bd3b
testq %rdx, %rdx
je 0x5bd40
movq 0x8(%rsp), %rax
movq (%rax), %rsi
movq 0xb8(%rsp), %rdi
callq 0x82b0
testl %eax, %eax
sete %r14b
jmp 0x5bd43
xorl %r14d, %r14d
jmp 0x5bd4f
xorl %r14d, %r14d
jmp 0x5bd43
movb $0x1, %r14b
movzbl %r14b, %r15d
xorb $0x1, %r14b
shll $0x2, %r15d
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x5bd74
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x5bd90
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x5bdac
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x82a0
testb %r14b, %r14b
je 0x5bdcf
incq %rbx
movq 0x10(%r13), %rax
subq 0x8(%r13), %rax
sarq $0x3, %rax
cmpq %rbx, %rax
ja 0x5bc24
movl $0x4, %r15d
cmpl $0x4, %r15d
movl 0x14(%rsp), %r13d
jne 0x5bebe
leaq 0xd8(%rsp), %rdi
movq %rsp, %rsi
callq 0x3ac8e
movslq (%rsp), %rax
movq 0x38(%rsp), %rcx
movq (%rcx), %rcx
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx,8), %rax
xorl %r15d, %r15d
cmpq %rax, 0x8(%rcx,%rdx,8)
je 0x5bebe
xorl %ebx, %ebx
movl (%rax,%rbx,4), %eax
movl %eax, 0x18(%rsp)
movq 0xe8(%rsp), %rdx
movq %rbp, %rcx
testq %rdx, %rdx
je 0x5be43
movq %rbp, %rcx
xorl %esi, %esi
cmpl %eax, 0x20(%rdx)
setl %sil
cmovgeq %rdx, %rcx
movq 0x10(%rdx,%rsi,8), %rdx
testq %rdx, %rdx
jne 0x5be2c
movq %rbp, %rdx
cmpq %rbp, %rcx
je 0x5be55
cmpl 0x20(%rcx), %eax
cmovlq %rbp, %rcx
movq %rcx, %rdx
cmpq %rbp, %rdx
jne 0x5be92
movq 0x90(%rsp), %rcx
movq 0xa0(%rsp), %rdx
addq $-0x4, %rdx
cmpq %rdx, %rcx
je 0x5be83
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, 0x90(%rsp)
jmp 0x5be92
leaq 0x60(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x270cc
incq %rbx
movslq (%rsp), %rax
movq 0x38(%rsp), %rcx
movq (%rcx), %rcx
leaq (%rax,%rax,2), %rdx
movq (%rcx,%rdx,8), %rax
movq 0x8(%rcx,%rdx,8), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rbx, %rcx
ja 0x5be12
testb $0x5, %r15b
jne 0x5bedb
movq 0x70(%rsp), %rax
cmpq %rax, 0x90(%rsp)
sete %r12b
jne 0x5bb4e
leaq 0xd8(%rsp), %rdi
callq 0x3b482
leaq 0x60(%rsp), %rdi
callq 0x25a46
andb $0x1, %r12b
movl %r12d, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5bf53
jmp 0x5bf53
jmp 0x5bf53
movq %rax, %r14
jmp 0x5bf35
movq %rax, %r14
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x5bf35
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x82a0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x5bf56
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x82a0
jmp 0x5bf56
movq %rax, %r14
leaq 0xd8(%rsp), %rdi
callq 0x3b482
leaq 0x60(%rsp), %rdi
callq 0x25a46
movq %r14, %rdi
callq 0x8540