// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/sat/minisat220/minisat-220/minisat/core/Solver.cc
// Function: Minisat::Solver::relocAll(Minisat::ClauseAllocator&)
void Solver::relocAll(ClauseAllocator& to)
{
    // All watchers:
    //
    watches.cleanAll();
    for (int v = 0; v < nVars(); v++)
        for (int s = 0; s < 2; s++){
            Lit p = mkLit(v, s);
            vec<Watcher>& ws = watches[p];
            for (int j = 0; j < ws.size(); j++)
                ca.reloc(ws[j].cref, to);
        }

    // All reasons:
    //
    for (int i = 0; i < trail.size(); i++){
        Var v = var(trail[i]);

        // Note: it is not safe to call 'locked()' on a relocated clause. This is why we keep
        // 'dangling' reasons here. It is safe and does not hurt.
        if (reason(v) != CRef_Undef && (ca[reason(v)].reloced() || locked(ca[reason(v)]))){
            assert(!isRemoved(reason(v)));
            ca.reloc(vardata[v].reason, to);
        }
    }

    // All learnt:
    //
    int i, j;
    for (i = j = 0; i < learnts.size(); i++)
        if (!isRemoved(learnts[i])){
            ca.reloc(learnts[i], to);
            learnts[j++] = learnts[i];
        }
    learnts.shrink(i - j);

    // All original:
    //
    for (i = j = 0; i < clauses.size(); i++)
        if (!isRemoved(clauses[i])){
            ca.reloc(clauses[i], to);
            clauses[j++] = clauses[i];
        }
    clauses.shrink(i - j);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
addq $0x228, %rdi            # imm = 0x228
movq %rdi, 0x18(%rsp)
callq 0x6c6a
leaq 0x2d8(%r14), %r15
xorl %ecx, %ecx
movq %r14, 0x8(%rsp)
movslq 0x2d4(%r14), %rax
cmpq %rax, %rcx
jge 0x61d2
movq %rcx, 0x10(%rsp)
leaq (%rcx,%rcx), %rax
movq %rax, 0x20(%rsp)
xorl %r13d, %r13d
cmpq $0x2, %r13
je 0x61c3
movq %r13, %r14
orq 0x20(%rsp), %r14
shlq $0x4, %r14
movq 0x18(%rsp), %rax
addq (%rax), %r14
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq 0x8(%r14), %rax
cmpq %rax, %rbp
jge 0x61be
movq (%r14), %rsi
addq %r12, %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x6cb6
incq %rbp
addq $0x8, %r12
jmp 0x619b
incq %r13
jmp 0x617c
movq 0x10(%rsp), %rcx
incq %rcx
movq 0x8(%rsp), %r14
jmp 0x615f
xorl %r12d, %r12d
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq 0x8(%rsp), %rdx
movslq 0x170(%rdx), %rax
cmpq %rax, %r12
jge 0x6247
movq 0x168(%rdx), %rcx
movq 0x210(%rdx), %rax
movl (%rcx,%r12,4), %ecx
sarl %ecx
movslq %ecx, %r14
movl (%rax,%r14,8), %ecx
cmpq %r13, %rcx
je 0x6242
movq (%r15), %rdx
testb $0x10, (%rdx,%rcx,4)
jne 0x6233
leaq (%rdx,%rcx,4), %rsi
movq 0x8(%rsp), %rdi
callq 0x6788
testb %al, %al
je 0x6242
movq 0x8(%rsp), %rax
movq 0x210(%rax), %rax
leaq (%rax,%r14,8), %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x6cb6
incq %r12
jmp 0x61db
leaq 0x158(%rdx), %r14
xorl %ebp, %ebp
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
movslq 0x160(%rax), %rax
cmpq %rax, %r13
jge 0x62a2
movq (%r14), %rsi
movl (%rsi,%rbp), %eax
movq (%r15), %rcx
movl (%rcx,%rax,4), %eax
andl $0x3, %eax
cmpl $0x1, %eax
je 0x6299
addq %rbp, %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x6cb6
movq (%r14), %rax
movl (%rax,%r13,4), %ecx
movslq %r12d, %rdx
incl %r12d
movl %ecx, (%rax,%rdx,4)
incq %r13
addq $0x4, %rbp
jmp 0x6256
subl %r12d, %r13d
movq %r14, %rdi
movl %r13d, %esi
callq 0x6aba
movq 0x8(%rsp), %rax
leaq 0x148(%rax), %r14
xorl %ebp, %ebp
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x8(%rsp), %rax
movslq 0x150(%rax), %rax
cmpq %rax, %r13
jge 0x6310
movq (%r14), %rsi
movl (%rsi,%rbp), %eax
movq (%r15), %rcx
movl (%rcx,%rax,4), %eax
andl $0x3, %eax
cmpl $0x1, %eax
je 0x6307
addq %rbp, %rsi
movq %r15, %rdi
movq %rbx, %rdx
callq 0x6cb6
movq (%r14), %rax
movl (%rax,%r13,4), %ecx
movslq %r12d, %rdx
incl %r12d
movl %ecx, (%rax,%rdx,4)
incq %r13
addq $0x4, %rbp
jmp 0x62c4
subl %r12d, %r13d
movq %r14, %rdi
movl %r13d, %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6aba