// File: vsklad[P]cgen/./bal/cnf/processor/cnfprocessor.hpp
// Function: void bal::CnfProcessor::rebuild_clauses<bal::CnfOptimizer, &bal::CnfOptimizer::_normalize_clause(unsigned int*) const>(bal::CnfOptimizer const*, bool) const
inline void rebuild_clauses(const CALLER_T* const p_caller, const bool b_safe_mode) const {
            _assert_level_1(!cnf_.transaction_is_in());
            if (b_safe_mode) {
                // make a sorted list of all used container offsets
                // then basically d the same thing as unsafe while limiting to these offsets
                std::vector<container_offset_t> offsets;
                for (auto it: cnf_.clauses()) {
                    offsets.push_back((container_offset_t)(it - clauses_data_));
                };
                std::sort(offsets.begin(), offsets.end());
                // rollback after collecting the offsets
                cnf_.rollback(0, 0, 0);
                // add the clauses back
                for (auto i = 0; i < offsets.size(); i++) {
                    uint32_t* const p_clause = _clauses_offset_clause(clauses_data_, offsets[i]);
                    if ((p_caller->*p_update_clause)(p_clause)) {
                        Cnf::insertion_point_t insertion_point;
                        __insertion_point_t_init(insertion_point);
                        clauses_.append<false>(p_clause, insertion_point);
                    };
                };
            } else {
                const container_size_t original_size_ = cnf_.size_;
                cnf_.rollback(0, 0, 0);
                uint32_t offset = 0;
                while (offset < original_size_) {
                    uint32_t* const p_clause = _clauses_offset_clause(clauses_data_, offset);
                    // p_clause size may change
                    const clause_size_t clause_size = _clause_size(p_clause);
                    if ((p_caller->*p_update_clause)(p_clause)) {
                        Cnf::insertion_point_t insertion_point;
                        __insertion_point_t_init(insertion_point);
                        clauses_.append<false>(p_clause, insertion_point);
                    };
                    _clauses_offset_size_next(offset, clause_size);
                };
            };
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq 0x8(%rax), %rdi
addq $0x78, %rdi
callq 0x178b0
xorb $-0x1, %al
testb $0x1, %al
jne 0x1792a
jmp 0x1792c
jmp 0x1794b
leaq 0x46a5d(%rip), %rdi     # 0x5e390
leaq 0x46a70(%rip), %rsi     # 0x5e3aa
movl $0x52, %edx
leaq 0x46a89(%rip), %rcx     # 0x5e3cf
callq 0xd1c0
testb $0x1, -0x11(%rbp)
je 0x17bf1
leaq -0x30(%rbp), %rdi
callq 0x17e70
movq -0x100(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x78, %rdi
callq 0x17e90
movq %rax, -0x108(%rbp)
jmp 0x1797b
movq -0x108(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x17ec0
jmp 0x1799d
movq -0x38(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x17ef0
jmp 0x179af
jmp 0x179b1
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x17f20
movb %al, -0x109(%rbp)
jmp 0x179c9
movb -0x109(%rbp), %al
testb $0x1, %al
jne 0x179d8
jmp 0x17a58
leaq -0x70(%rbp), %rdi
callq 0x17f50
movq %rax, -0x118(%rbp)
jmp 0x179ea
movq -0x100(%rbp), %rcx
movq -0x118(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq 0x18(%rcx), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
shrq $0x2, %rax
movl %eax, -0x9c(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x9c(%rbp), %rsi
callq 0xfa10
jmp 0x17a2c
jmp 0x17a2e
leaq -0x70(%rbp), %rdi
callq 0x17fe0
jmp 0x17a39
jmp 0x179b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x18050
jmp 0x17d29
leaq -0x30(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x10a10
movq -0x120(%rbp), %rdi
movq %rax, -0xa8(%rbp)
callq 0x10ce0
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
callq 0x18010
jmp 0x17a97
movq -0x100(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, %rdi
addq $0x78, %rdi
movq 0x78(%rax), %rax
movq (%rax), %rax
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq *%rax
jmp 0x17aba
movl $0x0, -0xb4(%rbp)
movslq -0xb4(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xf9f0
movq %rax, %rcx
movq -0x128(%rbp), %rax
cmpq %rcx, %rax
jae 0x17be3
movq -0x100(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq %rax, -0x138(%rbp)
movslq -0xb4(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0xfd50
movq %rax, %rcx
movq -0x138(%rbp), %rax
movl (%rcx), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
addq $0xc, %rax
movq %rax, -0xc0(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x17b44
jmp 0x17b66
movq -0x130(%rbp), %rax
movq (%rax), %rax
leaq 0x23b(%rip), %rcx       # 0x17d90
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x140(%rbp)
jmp 0x17b76
leaq 0x223(%rip), %rax       # 0x17d90
movq %rax, -0x140(%rbp)
jmp 0x17b76
movq -0x130(%rbp), %rdi
movq -0x140(%rbp), %rax
movq -0xc0(%rbp), %rsi
callq *%rax
movb %al, -0x141(%rbp)
jmp 0x17b95
movb -0x141(%rbp), %al
testb $0x1, %al
jne 0x17ba1
jmp 0x17bcd
movq -0x100(%rbp), %rax
movl $0xffffffff, -0xcc(%rbp) # imm = 0xFFFFFFFF
movq 0x10(%rax), %rdi
movq -0xc0(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0x13f90
jmp 0x17bcb
jmp 0x17bcd
jmp 0x17bcf
movl -0xb4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xb4(%rbp)
jmp 0x17ac4
leaq -0x30(%rbp), %rdi
callq 0x18050
jmp 0x17d20
movq -0x100(%rbp), %rax
movq 0x8(%rax), %rcx
movl 0x88(%rcx), %ecx
movl %ecx, -0xd4(%rbp)
movq 0x8(%rax), %rax
movq %rax, %rdi
addq $0x78, %rdi
movq 0x78(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq *(%rax)
movl $0x0, -0xd8(%rbp)
movl -0xd8(%rbp), %eax
cmpl -0xd4(%rbp), %eax
jae 0x17d1e
movq -0x100(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movl -0xd8(%rbp), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
addq $0xc, %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movl (%rax), %eax
andl $0x7fff, %eax           # imm = 0x7FFF
movw %ax, -0xe2(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x150(%rbp)
xorl %eax, %eax
testb $0x1, %al
jne 0x17c89
jmp 0x17cab
movq -0x150(%rbp), %rax
movq (%rax), %rax
leaq 0xf6(%rip), %rcx        # 0x17d90
subq $0x1, %rcx
movq (%rax,%rcx), %rax
movq %rax, -0x158(%rbp)
jmp 0x17cbb
leaq 0xde(%rip), %rax        # 0x17d90
movq %rax, -0x158(%rbp)
jmp 0x17cbb
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rax
movq -0xe0(%rbp), %rsi
callq *%rax
testb $0x1, %al
jne 0x17cd8
jmp 0x17d00
movq -0x100(%rbp), %rax
movl $0xffffffff, -0xf0(%rbp) # imm = 0xFFFFFFFF
movq 0x10(%rax), %rdi
movq -0xe0(%rbp), %rsi
leaq -0xf4(%rbp), %rdx
callq 0x13f90
movzwl -0xe2(%rbp), %eax
addl $0x1, %eax
addl $0x3, %eax
addl -0xd8(%rbp), %eax
movl %eax, -0xd8(%rbp)
jmp 0x17c29
jmp 0x17d20
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0xd5a0
nopw %cs:(%rax,%rax)
nopl (%rax)