// File: /workspace/github_cpp_makefile_star2_O3/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 0x5b8a
movl $0xffffffff, (%rsi)     # imm = 0xFFFFFFFF
addq $0x4, %rsi
movq %rsi, 0x8(%rdx)
jmp 0x5b92
movq %rdx, %rdi
callq 0x65b6
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 0x5bbd
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5e98
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 0x5ca2
movl (%rax,%r13,4), %esi
movl %esi, (%rsp)
sarl %esi
movslq %esi, %rax
movq 0xd8(%rbx), %rcx
cmpb $0x0, (%rcx,%rax)
je 0x5c1c
incq %r13
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r13
jb 0x5be6
jmp 0x5ca2
movq 0x80(%rbx), %rcx
shlq $0x4, %rax
cmpq $0x0, 0x8(%rcx,%rax)
je 0x5bff
movq %rbx, %rdi
callq 0x6202
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 0x5c8a
movq 0x8(%r15), %rsi
cmpq 0x10(%r15), %rsi
je 0x5c92
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r15)
jmp 0x5bff
incl %r14d
jmp 0x5bff
movq %r15, %rdi
movq %rsp, %rdx
callq 0x4602
jmp 0x5bff
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 0x5cb0
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 0x5baa
xorl $0x1, %r15d
movq 0x18(%rsp), %rcx
movq (%rcx), %rax
movl %r15d, (%rax)
movq %rcx, %r15
movq %rsp, %rdi
movq %rcx, %rsi
callq 0x6304
movq (%r15), %rcx
movq 0x8(%r15), %rax
subq %rcx, %rax
movl $0x1, %r12d
cmpq $0x5, %rax
jb 0x5d74
movl $0x1, %r14d
movq %rsp, %r13
movl (%rcx,%r14,4), %esi
movl %esi, %eax
sarl %eax
cltq
movq 0x80(%rbx), %rdx
shlq $0x4, %rax
cmpq $0x0, (%rdx,%rax)
je 0x5d5a
movq %rbx, %rdi
movq %r13, %rdx
callq 0x6378
movq (%r15), %rcx
testb %al, %al
jne 0x5d61
movl (%rcx,%r14,4), %esi
movl %esi, (%rcx,%r12,4)
incq %r12
incq %r14
movq 0x8(%r15), %rax
subq %rcx, %rax
sarq $0x2, %rax
cmpq %rax, %r14
jb 0x5d28
movq %r15, %rdi
movq %r12, %rsi
callq 0x309e
movq (%r15), %rax
movq 0x8(%r15), %rdx
subq %rax, %rdx
movq %rdx, %rsi
sarq $0x2, %rsi
xorl %ecx, %ecx
cmpq $0x2, %rsi
jb 0x5e1f
movq 0x80(%rbx), %rcx
movl $0x1, %edi
cmpq $0x8, %rdx
je 0x5e04
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 0x5df6
movl %edi, %r8d
incq %rsi
movl %r8d, %edi
cmpq %rsi, %rdx
jne 0x5dc5
movslq %r8d, %rdi
movl 0x4(%rax), %edx
movl (%rax,%rdi,4), %esi
movl %esi, 0x4(%rax)
movl %edx, (%rax,%rdi,4)
movl 0x4(%rax), %eax
sarl %eax
cltq
shlq $0x4, %rax
movl 0x8(%rcx,%rax), %ecx
movq 0x20(%rsp), %rax
movl %ecx, (%rax)
movq (%rsp), %rdi
movq 0x8(%rsp), %rax
cmpq %rax, %rdi
je 0x5e53
movl (%rdi), %ecx
sarl %ecx
movslq %ecx, %rcx
movq 0xd8(%rbx), %rdx
movb $0x0, (%rdx,%rcx)
addq $0x4, %rdi
cmpq %rax, %rdi
jne 0x5e34
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5e65
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 0x5e76
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x5e8f
movq 0x10(%rsp), %rsi
subq %rdi, %rsi
callq 0x2180
movq %rbx, %rdi
callq 0x2240
nop