// File: /workspace/github_cpp_makefile_star2_O1/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, %r12
movq %rdi, %rbx
movq 0x8(%rdx), %rsi
cmpq 0x10(%rdx), %rsi
movq %rdx, 0x18(%rsp)
je 0x5bb2
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
addq $0x4, %rsi
movq %rsi, 0x8(%rdx)
jmp 0x5bba
movq %rdx, %rdi
callq 0x65fa
movq 0x10(%rbx), %rbp
subq 0x8(%rbx), %rbp
shrq $0x2, %rbp
decq %rbp
xorl %r14d, %r14d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
cmpb $0x1, 0x18(%r12)
jne 0x5be5
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5ec6
xorl %r13d, %r13d
cmpl $-0x1, %r15d
setne %r13b
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
movq 0x18(%rsp), %r15
jbe 0x5cca
movl (%rax,%r13,4), %esi
movl %esi, (%rsp)
sarl %esi
movslq %esi, %rax
movq 0xd8(%rbx), %rcx
cmpb $0x0, (%rcx,%rax)
je 0x5c44
incq %r13
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r13
jb 0x5c0e
jmp 0x5cca
movq 0x80(%rbx), %rcx
shlq $0x4, %rax
cmpq $0x0, 0x8(%rcx,%rax)
je 0x5c27
movq %rbx, %rdi
callq 0x622e
movl (%rsp), %eax
sarl %eax
cltq
movq 0xd8(%rbx), %rcx
movb $0x1, (%rcx,%rax)
movl (%rsp), %eax
movl %eax, %ecx
sarl %ecx
movslq %ecx, %rcx
movq 0x58(%rbx), %rdx
movq 0x80(%rbx), %rsi
subq 0x50(%rbx), %rdx
shlq $0x4, %rcx
sarq $0x2, %rdx
cmpq %rdx, 0x8(%rsi,%rcx)
jae 0x5cb2
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x5cba
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r15)
jmp 0x5c27
incl %r14d
jmp 0x5c27
movq %r15, %rdi
movq %rsp, %rdx
callq 0x469e
jmp 0x5c27
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 0x5cd8
movq 0x80(%rbx), %rcx
movq %rdx, %rsi
shlq $0x4, %rsi
movq (%rcx,%rsi), %r12
movb $0x0, (%rax,%rdx)
leal -0x1(%r14), %eax
cmpl $0x1, %r14d
movl %eax, %r14d
jg 0x5bd2
xorl $0x1, %r15d
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movl %r15d, (%rax)
movq %rcx, %r15
movq %rsp, %rdi
movq %rcx, %rsi
callq 0x633a
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
movl $0x1, %r12d
cmpq $0x5, %rcx
jb 0x5d9f
movl $0x1, %r14d
movq %rsp, %r13
movl (%rax,%r14,4), %esi
movl %esi, %eax
sarl %eax
cltq
movq 0x80(%rbx), %rcx
shlq $0x4, %rax
cmpq $0x0, (%rcx,%rax)
je 0x5d7b
movq %rbx, %rdi
movq %r13, %rdx
callq 0x63ae
testb %al, %al
jne 0x5d89
movq (%r15), %rax
movl (%rax,%r14,4), %ecx
movl %ecx, (%rax,%r12,4)
incq %r12
incq %r14
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r14
jb 0x5d50
movq %r15, %rdi
movq %r12, %rsi
callq 0x30c4
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
movq %rcx, %rsi
sarq $0x2, %rsi
xorl %edx, %edx
cmpq $0x2, %rsi
jb 0x5e51
movl $0x1, %edx
cmpq $0x8, %rcx
je 0x5e2f
movq 0x80(%rbx), %rcx
cmpq $0x4, %rsi
movl $0x3, %edx
cmovaeq %rsi, %rdx
movl $0x1, %edi
movl $0x2, %esi
movl (%rax,%rsi,4), %r8d
sarl %r8d
movslq %r8d, %r8
shlq $0x4, %r8
movq 0x8(%rcx,%r8), %r9
movslq %edi, %r8
movl (%rax,%r8,4), %r8d
sarl %r8d
movslq %r8d, %r10
shlq $0x4, %r10
movl %esi, %r8d
cmpq 0x8(%rcx,%r10), %r9
ja 0x5e21
movl %edi, %r8d
incq %rsi
movl %r8d, %edi
cmpq %rsi, %rdx
jne 0x5df0
movslq %r8d, %rdx
movl 0x4(%rax), %ecx
movl (%rax,%rdx,4), %esi
movl %esi, 0x4(%rax)
movl %ecx, (%rax,%rdx,4)
movl 0x4(%rax), %eax
sarl %eax
cltq
movq 0x80(%rbx), %rcx
shlq $0x4, %rax
movl 0x8(%rcx,%rax), %edx
movq 0x20(%rsp), %rax
movl %edx, (%rax)
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
cmpq %rcx, %rax
je 0x5e7e
movl (%rax), %edx
sarl %edx
movslq %edx, %rdx
movq 0xd8(%rbx), %rsi
movb $0x0, (%rsi,%rdx)
addq $0x4, %rax
jmp 0x5e61
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5e94
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5ea5
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5ebe
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2240