// File: 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
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x3940
movq -0x18(%rbp), %rdi
callq 0x14330
movq -0xb8(%rbp), %rdi
addq $0x8, %rdi
callq 0x3b30
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0xf6d0
testb $0x1, %al
jne 0x137ec
jmp 0x137fc
movq -0xb8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x13da0
leaq -0x28(%rbp), %rdi
callq 0x142d0
movb %al, %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cltq
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x38(%rbp), %rdi
callq 0x3b30
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
jae 0x13958
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3a20
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0x44(%rbp)
addq $0xd8, %rax
movq %rax, -0xc8(%rbp)
leaq -0x44(%rbp), %rdi
callq 0x37d0
movq -0xc8(%rbp), %rdi
movslq %eax, %rsi
callq 0x143a0
cmpb $0x0, (%rax)
jne 0x13945
leaq -0x44(%rbp), %rdi
callq 0x37d0
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x143c0
cmpq $0x0, %rax
jbe 0x13945
leaq -0x44(%rbp), %rdi
callq 0x37d0
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x143f0
movq -0xb8(%rbp), %rax
addq $0xd8, %rax
movq %rax, -0xd8(%rbp)
leaq -0x44(%rbp), %rdi
callq 0x37d0
movq -0xd8(%rbp), %rdi
movslq %eax, %rsi
callq 0x143a0
movb $0x1, (%rax)
leaq -0x44(%rbp), %rdi
callq 0x37d0
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x143c0
movq -0xb8(%rbp), %rdi
movq %rax, -0xd0(%rbp)
callq 0xbe90
movq %rax, %rcx
movq -0xd0(%rbp), %rax
cmpq %rcx, %rax
jb 0x13936
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x13943
movq -0x18(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0xbed0
jmp 0x13945
jmp 0x13947
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1381a
jmp 0x1395a
movq -0xb8(%rbp), %rdi
movq %rdi, %rax
addq $0xd8, %rax
movq %rax, -0xe0(%rbp)
addq $0x8, %rdi
movl -0x2c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x2c(%rbp)
movslq %eax, %rsi
callq 0x3a20
movq %rax, %rdi
callq 0x37d0
movq -0xe0(%rbp), %rdi
movslq %eax, %rsi
callq 0x143a0
cmpb $0x0, (%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x139ad
jmp 0x139af
jmp 0x1395a
movq -0xb8(%rbp), %rdi
addq $0x8, %rdi
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x3a20
movl (%rax), %eax
movl %eax, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x37d0
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x145a0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movq %rcx, -0x10(%rbp)
addq $0xd8, %rax
movq %rax, -0xe8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x37d0
movq -0xe8(%rbp), %rdi
movslq %eax, %rsi
callq 0x143a0
movb $0x0, (%rax)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jg 0x137d5
leaq -0x28(%rbp), %rdi
callq 0x39f0
movl %eax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x3a20
movl -0x48(%rbp), %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x145d0
movq $0x1, -0x68(%rbp)
movq $0x1, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3b30
movq %rax, %rcx
movq -0xf0(%rbp), %rax
cmpq %rcx, %rax
jae 0x13b67
movq -0x18(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x3a20
movq %rax, %rdi
callq 0x37d0
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x145a0
movq %rax, -0xf8(%rbp)
jmp 0x13abb
movq -0xf8(%rbp), %rax
cmpq $0x0, %rax
je 0x13b01
movq -0x18(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x3a20
movq -0xb8(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %esi
leaq -0x60(%rbp), %rdx
callq 0x146c0
movb %al, -0xf9(%rbp)
jmp 0x13af5
movb -0xf9(%rbp), %al
testb $0x1, %al
jne 0x13b54
jmp 0x13b01
movq -0x18(%rbp), %rdi
movq -0x70(%rbp), %rsi
callq 0x3a20
movq %rax, -0x108(%rbp)
movq -0x18(%rbp), %rdi
movq -0x68(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
callq 0x3a20
movq -0x108(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, (%rax)
jmp 0x13b54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x2db0
jmp 0x13d97
jmp 0x13b56
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x13a68
movq -0x18(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x3a40
jmp 0x13b76
movq -0x18(%rbp), %rdi
callq 0x3b30
cmpq $0x1, %rax
jbe 0x13cda
movl $0x1, -0x84(%rbp)
movq $0x2, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3b30
movq %rax, %rcx
movq -0x110(%rbp), %rax
cmpq %rcx, %rax
jae 0x13c5f
movq -0x18(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x3a20
movq %rax, %rdi
callq 0x37d0
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x143c0
movq %rax, -0x118(%rbp)
jmp 0x13bf7
movq -0x18(%rbp), %rdi
movslq -0x84(%rbp), %rsi
callq 0x3a20
movq %rax, %rdi
callq 0x37d0
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x143c0
movq %rax, -0x120(%rbp)
jmp 0x13c26
movq -0x118(%rbp), %rax
movq -0x120(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x13c46
movq -0x90(%rbp), %rax
movl %eax, -0x84(%rbp)
jmp 0x13c48
movq -0x90(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x90(%rbp)
jmp 0x13b9e
movq -0x18(%rbp), %rdi
movl $0x1, %esi
movq %rsi, -0x130(%rbp)
callq 0x3a20
movq %rax, -0x138(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x84(%rbp), %rsi
callq 0x3a20
movq -0x138(%rbp), %rdi
movq %rax, %rsi
callq 0xa4a0
movq -0x130(%rbp), %rsi
movq -0x18(%rbp), %rdi
callq 0x3a20
movq %rax, %rdi
callq 0x37d0
movq -0xb8(%rbp), %rdi
movl %eax, %esi
callq 0x143c0
movq %rax, -0x128(%rbp)
jmp 0x13cc9
movq -0x128(%rbp), %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0x13ce4
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
leaq -0x60(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rdi
callq 0x3710
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
callq 0x3740
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3770
testb $0x1, %al
jne 0x13d2e
jmp 0x13d85
leaq -0xa0(%rbp), %rdi
callq 0x37b0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, -0xac(%rbp)
addq $0xd8, %rax
movq %rax, -0x140(%rbp)
leaq -0xac(%rbp), %rdi
callq 0x37d0
movq -0x140(%rbp), %rdi
movslq %eax, %rsi
callq 0x143a0
movb $0x0, (%rax)
leaq -0xa0(%rbp), %rdi
callq 0x38e0
jmp 0x13d15
leaq -0x60(%rbp), %rdi
callq 0x2db0
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x22f0