// File: /workspace/github_cpp_makefile_star2_O2/jacky860226[P]JinkelaSat/src/include/JinkelaSat.hpp
// Function: MiniSat::JinkelaSat::analyze(MiniSat::Clause*, std::vector<MiniSat::Literal, std::allocator<MiniSat::Literal>>&, int&)
void analyze(Clause *confl, std::vector<Literal> &out_learnt,
               int &out_btlevel) {
    int pathC = 0;
    Literal p;
    out_learnt.emplace_back();
    int index = int(trail.size()) - 1;
    do {
      Clause &c = *confl;
      if (c.learnt())
        claBumpActivity(c);
      for (size_t j = p.isUndef() ? 0 : 1; j < c.size(); ++j) {
        Literal q = c[j];
        if (!seen[q.var()] && level(q.var()) > 0) {
          varBumpActivity(q.var());
          seen[q.var()] = 1;
          if (level(q.var()) >= decisionLevel())
            pathC++;
          else
            out_learnt.emplace_back(q);
        }
      }
      while (!seen[trail[index--].var()])
        ;
      p = trail[index + 1];
      confl = reason(p.var());
      seen[p.var()] = 0;
      pathC--;
    } while (pathC > 0);
    out_learnt[0] = ~p;
    auto analyze_toclear = out_learnt;
    size_t j = 1;
    for (size_t i = 1; i < out_learnt.size(); ++i)
      if (reason(out_learnt[i].var()) == nullptr ||
          !litRedundant(out_learnt[i], analyze_toclear))
        out_learnt[j++] = out_learnt[i];
    out_learnt.resize(j);
    if (out_learnt.size() > 1) {
      int max_i = 1;
      for (size_t i = 2; i < out_learnt.size(); ++i)
        if (level(out_learnt[i].var()) > level(out_learnt[max_i].var()))
          max_i = i;
      std::swap(out_learnt[1], out_learnt[max_i]);
      out_btlevel = level(out_learnt[1].var());
    } else
      out_btlevel = 0;
    for (auto v : analyze_toclear)
      seen[v.var()] = 0;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x20(%rsp)
movq %rsi, %r13
movq %rdi, %rbx
movq %rdx, (%rsp)
movq %rdx, %rdi
callq 0x617c
movq 0x10(%rbx), %rbp
subq 0x8(%rbx), %rbp
shrq $0x2, %rbp
decq %rbp
xorl %r14d, %r14d
pushq $-0x1
popq %r15
cmpb $0x1, 0x18(%r13)
jne 0x5c9b
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5ef4
xorl %r12d, %r12d
cmpl $-0x1, %r15d
setne %r12b
movq (%rsp), %r15
movq (%r13), %rax
movq 0x8(%r13), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r12
jae 0x5d49
movl (%rax,%r12,4), %esi
movl %esi, 0x8(%rsp)
sarl %esi
movslq %esi, %rax
movq 0xd8(%rbx), %rcx
cmpb $0x0, (%rcx,%rax)
je 0x5ce1
incq %r12
jmp 0x5caa
movq 0x80(%rbx), %rcx
shlq $0x4, %rax
cmpq $0x0, 0x8(%rcx,%rax)
je 0x5cdc
movq %rbx, %rdi
callq 0x61ac
movl 0x8(%rsp), %eax
sarl %eax
cltq
movq 0xd8(%rbx), %rcx
movb $0x1, (%rcx,%rax)
movl 0x8(%rsp), %eax
sarl %eax
cltq
movq 0x58(%rbx), %rcx
movq 0x80(%rbx), %rdx
subq 0x50(%rbx), %rcx
shlq $0x4, %rax
sarq $0x2, %rcx
cmpq %rcx, 0x8(%rdx,%rax)
jae 0x5d44
movq %r15, %rdi
leaq 0x8(%rsp), %rsi
callq 0x4632
jmp 0x5cdc
incl %r14d
jmp 0x5cdc
movq 0x8(%rbx), %rcx
movq 0xd8(%rbx), %rax
movslq %ebp, %rbp
movl (%rcx,%rbp,4), %r15d
decq %rbp
movl %r15d, %edx
sarl %edx
movslq %edx, %rdx
cmpb $0x0, (%rax,%rdx)
je 0x5d57
movq 0x80(%rbx), %rcx
movq %rdx, %rsi
shlq $0x4, %rsi
movq (%rcx,%rsi), %r13
movb $0x0, (%rax,%rdx)
leal -0x1(%r14), %eax
cmpl $0x1, %r14d
movl %eax, %r14d
jg 0x5c89
xorl $0x1, %r15d
movq (%rsp), %rcx
movq (%rcx), %rax
movl %r15d, (%rax)
movq %rcx, %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %rcx, %rsi
callq 0x62a2
pushq $0x1
popq %r13
movq %r13, %r14
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r14
jae 0x5e0d
movl (%rax,%r14,4), %esi
movl %esi, %ecx
sarl %ecx
movslq %ecx, %rcx
movq 0x80(%rbx), %rdx
shlq $0x4, %rcx
cmpq $0x0, (%rdx,%rcx)
je 0x5e01
movq %rbx, %rdi
movq %r12, %rdx
callq 0x62f0
testb %al, %al
jne 0x5e08
movq (%r15), %rax
movl (%rax,%r14,4), %esi
movl %esi, (%rax,%r13,4)
incq %r13
incq %r14
jmp 0x5dbb
movq %r15, %rdi
movq %r13, %rsi
callq 0x2cf2
movq (%r15), %rax
movq 0x8(%r15), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
xorl %ecx, %ecx
cmpq $0x2, %rdx
jb 0x5e96
movq 0x80(%rbx), %rcx
pushq $0x2
popq %rsi
pushq $0x1
popq %rdi
movslq %edi, %r8
cmpq %rsi, %rdx
je 0x5e79
movl (%rax,%rsi,4), %r9d
sarl %r9d
movslq %r9d, %r9
shlq $0x4, %r9
movq 0x8(%rcx,%r9), %r9
movl (%rax,%r8,4), %r8d
sarl %r8d
movslq %r8d, %r10
shlq $0x4, %r10
movl %esi, %r8d
cmpq 0x8(%rcx,%r10), %r9
ja 0x5e71
movl %edi, %r8d
incq %rsi
movl %r8d, %edi
jmp 0x5e3b
movl 0x4(%rax), %edx
movl (%rax,%r8,4), %esi
movl %esi, 0x4(%rax)
movl %edx, (%rax,%r8,4)
movl 0x4(%rax), %eax
sarl %eax
cltq
shlq $0x4, %rax
movl 0x8(%rcx,%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq %rcx, %rax
je 0x5ec4
movl (%rax), %edx
sarl %edx
movslq %edx, %rdx
movq 0xd8(%rbx), %rsi
movb $0x0, (%rsi,%rdx)
addq $0x4, %rax
jmp 0x5ea7
leaq 0x8(%rsp), %rdi
callq 0x45fa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5edf
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x45fa
movq %rbx, %rdi
callq 0x2250