name
stringlengths 1
473k
| code
stringlengths 7
647k
| asm
stringlengths 4
3.39M
| file
stringlengths 8
196
|
---|---|---|---|
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, 0x58(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x57ce8(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
movq %rax, 0x50(%rsp)
leaq 0x60(%r12), %rax
movq %rax, 0x20(%rsp)
leaq 0x100(%r12), %rax
movq %rax, 0x38(%rsp)
leaq 0x80(%r12), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
cmpq 0x58(%rsp), %r14
je 0x404890
movl (%r14), %ebx
movq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl %eax, 0x2c(%rsp)
movl %ebx, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x4048e6
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %rbp
callq 0x40490c
movq 0x68(%r12), %rcx
movslq %ebx, %r15
movl %eax, %r13d
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x404855
leaq 0x61d75(%rip), %rcx # 0x4664b8
movslq %r13d, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x4049f3
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x4047f4
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x4049f3
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x404f40
jmp 0x404852
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x4049f3
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x404ef8
cmpl $-0x2, %eax
jne 0x404852
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %r13d, %edx
callq 0x404a26
jmp 0x404852
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x4049f3
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x404ef8
cmpl $-0x2, %eax
jne 0x404852
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %ebx, %esi
movl %r13d, %ecx
callq 0x404d22
movl %eax, %r8d
movq 0x48(%rsp), %rdx
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq %rbp, %r15
movq %rbp, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
callq 0x404f88
movl 0x2c(%rsp), %ecx
addq $0x4, %r14
orb %al, %cl
movl %ecx, %eax
jmp 0x4046ca
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true> const&, baryonyx::bit_array const&) | int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x180(%r14), %r15d
je 0x4048d9
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x403d4d
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0x4048b6
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::branch_and_bound_solver<baryonyx::itm::maximize_tag, long double>::solve<std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data []>>>(std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data []>>&, int, int, int) | int solve(R& reduced_cost, int r_size, int bk_min, int bk_max)
{
bx_assert(r_size >= 4);
bx_assert(bk_min <= bk_max);
b_min = bk_min;
b_max = bk_max;
items.resize(r_size);
if (!subvector.init(r_size))
throw solver_failure(solver_error_tag::no_solver_available);
solution = subvector.emplace();
bx_assert(solution == 0u);
nodes.clear();
for (int i = 0; i != r_size; ++i) {
items[i].r = reduced_cost[i].value;
items[i].variable = reduced_cost[i].id;
items[i].original_factor = reduced_cost[i].f;
items[i].factor = std::abs(reduced_cost[i].f);
items[i].result = 0;
}
std::fill_n(
subvector.element_data(solution), subvector.element_size(), 0);
std::sort(std::begin(items), std::end(items));
for (std::size_t i = 0, e = items.size(); i != e; ++i) {
if (items[i].original_factor < 0) {
b_min += items[i].factor;
b_max += items[i].factor;
}
}
// Compute the inversion of the sum z
items.back().sum_z = items.back().r;
for (int i = length(items) - 2; i >= 0; --i)
items[i].sum_z = items[i + 1].sum_z + items[i].r;
if (b_max == b_min)
solve_equality();
else
solve_inequality();
for (int i = 0, e = length(items); i != e; ++i) {
if (items[i].original_factor > 0)
items[i].result = subvector[solution + i] == 0 ? 0 : 1;
else
items[i].result = subvector[solution + i] == 0 ? 1 : 0;
}
std::sort(std::begin(items),
std::end(items),
[](const auto& lhs, const auto& rhs) {
if (lhs.result == rhs.result) {
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs.r < rhs.r;
else
return lhs.r > rhs.r;
} else
return lhs.result > rhs.result;
});
auto middle =
std::find_if(std::begin(items),
std::end(items),
[](const auto& item) { return item.result == 0; });
for (std::size_t i = 0, e = items.size(); i != e; ++i) {
reduced_cost[i].value = items[i].r;
reduced_cost[i].id = items[i].variable;
reduced_cost[i].f = items[i].original_factor;
}
if (middle == std::end(items))
return items[0].result == 0 ? -1 : r_size;
return static_cast<int>(std::distance(std::begin(items), middle) - 1);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x3, %edx
jle 0x404c80
cmpl %r8d, %ecx
jg 0x404ca1
leaq 0x20(%rdi), %r13
movl %ecx, 0x74(%rdi)
movl %edx, %ebx
movq %rsi, %r14
movl %edx, %r12d
movq %rdi, %r15
movl %r8d, 0x78(%rdi)
movq %r12, %rsi
movq %r13, %rdi
callq 0x405a4e
movq %r15, %rdi
movl %ebx, %esi
callq 0x36e080
testb %al, %al
je 0x404ce3
movq %r15, %rdi
callq 0x36e100
movl %eax, 0x70(%r15)
testl %eax, %eax
jne 0x404cc2
movq 0x38(%r15), %rax
cmpq %rax, 0x40(%r15)
je 0x404a98
movq %rax, 0x40(%r15)
movq (%r14), %rax
movq (%r13), %rcx
imulq $0x30, %r12, %rdx
xorl %esi, %esi
addq $0x14, %rax
cmpq %rsi, %rdx
je 0x404adf
fldt -0x14(%rax)
fstpt (%rcx,%rsi)
movl -0x4(%rax), %edi
movl %edi, 0x28(%rcx,%rsi)
movl (%rax), %edi
movl %edi, %r8d
negl %r8d
movl %edi, 0x24(%rcx,%rsi)
cmovsl %edi, %r8d
addq $0x20, %rax
movl %r8d, 0x20(%rcx,%rsi)
andl $0x0, 0x2c(%rcx,%rsi)
addq $0x30, %rsi
jmp 0x404aa9
movq %r15, %rdi
xorl %esi, %esi
callq 0x36e156
leaq 0x4(%rsp), %rdx
movl 0x18(%r15), %esi
movq %rax, %rdi
andl $0x0, (%rdx)
callq 0x36e561
movq 0x20(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0x405db8
movq 0x28(%r15), %rdi
movq 0x20(%r15), %rcx
movq %rdi, %rax
subq %rcx, %rax
pushq $0x30
popq %r12
cqto
leaq 0x24(%rcx), %r8
idivq %r12
movl 0x74(%r15), %edx
movl 0x78(%r15), %esi
movq %rax, %r9
subq $0x1, %r9
jb 0x404b54
cmpl $0x0, (%r8)
jns 0x404b4e
movl -0x4(%r8), %r10d
addl %r10d, %edx
addl %r10d, %esi
movl %edx, 0x74(%r15)
movl %esi, 0x78(%r15)
addq $0x30, %r8
jmp 0x404b30
fldt -0x30(%rdi)
fstpt -0x20(%rdi)
addl $-0x2, %eax
leaq 0x40(%rcx), %rdi
testl %eax, %eax
js 0x404b7f
movl %eax, %r8d
imulq $0x30, %r8, %r8
decl %eax
fldt (%rdi,%r8)
fldt (%rcx,%r8)
faddp %st, %st(1)
fstpt 0x10(%rcx,%r8)
jmp 0x404b61
movl %ebx, (%rsp)
movq %r14, %rbx
movq %r15, %rdi
cmpl %edx, %esi
jne 0x404b93
callq 0x405a86
jmp 0x404b98
callq 0x405b48
movq 0x20(%r15), %rcx
movq 0x28(%r15), %rax
xorl %ebp, %ebp
subq %rcx, %rax
cqto
idivq %r12
xorl %r12d, %r12d
movl %eax, %eax
imulq $0x30, %rax, %r13
cmpq %r12, %r13
je 0x404bed
cmpl $0x0, 0x24(%rcx,%r12)
movl 0x70(%r15), %esi
movq %r15, %rdi
setg %r14b
addl %ebp, %esi
callq 0x36e328
cmpb $0x0, (%rax)
movq 0x20(%r15), %rcx
sete %al
incl %ebp
xorb %r14b, %al
movzbl %al, %eax
movl %eax, 0x2c(%rcx,%r12)
addq $0x30, %r12
jmp 0x404bb3
movq 0x20(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0x406d4e
movq 0x20(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0x407506
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdi
movq %rax, %rcx
movq %rdi, %rax
subq %rsi, %rax
cqto
pushq $0x30
popq %r10
idivq %r10
movq (%rbx), %rdx
movl (%rsp), %r9d
movq %rsi, %r8
addq $0x10, %rdx
subq $0x1, %rax
jb 0x404c54
fldt (%r8)
fstpt -0x10(%rdx)
vmovsd 0x24(%r8), %xmm0
addq $0x30, %r8
vshufps $0xe1, %xmm0, %xmm0, %xmm0 # xmm0 = xmm0[1,0,2,3]
vmovlps %xmm0, (%rdx)
addq $0x20, %rdx
jmp 0x404c2f
cmpq %rdi, %rcx
je 0x404c68
subq %rsi, %rcx
movq %rcx, %rax
cqto
idivq %r10
decl %eax
jmp 0x404c71
cmpl $0x1, 0x2c(%rsi)
sbbl %eax, %eax
orl %r9d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x544e5(%rip), %rdi # 0x45916c
leaq 0x61fd7(%rip), %rsi # 0x466c65
leaq 0x61fdc(%rip), %rdx # 0x466c71
leaq 0x6203e(%rip), %rcx # 0x466cda
callq 0x2813f
leaq 0x544c4(%rip), %rdi # 0x45916c
leaq 0x6202f(%rip), %rsi # 0x466cde
leaq 0x61fbb(%rip), %rdx # 0x466c71
leaq 0x62032(%rip), %rcx # 0x466cef
callq 0x2813f
leaq 0x544a3(%rip), %rdi # 0x45916c
leaq 0x62023(%rip), %rsi # 0x466cf3
leaq 0x61f9a(%rip), %rdx # 0x466c71
leaq 0x62024(%rip), %rcx # 0x466d02
callq 0x2813f
pushq $0x18
popq %rdi
callq 0xb210
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x36e0d4
movq 0x2382c0(%rip), %rdx # 0x63cfc0
leaq 0x235709(%rip), %rsi # 0x63a410
movq %rbx, %rdi
callq 0xb3c0
movq %rbx, %rdi
movq %rax, %r14
callq 0xb570
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/branch-and-bound-solver.hpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::default_cost_type<long double>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x58(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
fldt 0xe0(%rsp)
fstpt 0x7c(%rsp)
fldt 0xd0(%rsp)
fstpt 0x70(%rsp)
fldt 0xc0(%rsp)
fstpt 0x64(%rsp)
movq %rax, 0x50(%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x100(%rdi), %rax
movq %rax, 0x38(%rsp)
leaq 0x80(%rdi), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
cmpq 0x58(%rsp), %r14
je 0x40e85a
movl (%r14), %r13d
movq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl %eax, 0x2c(%rsp)
movl %r13d, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x7c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x40ebf2
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %rbp
callq 0x40ec18
movq 0x68(%r12), %rcx
movslq %r13d, %r15
movl %eax, %ebx
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x40e821
leaq 0x57e59(%rip), %rcx # 0x46656c
movslq %ebx, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x40ecff
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x40e7c2
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x40ecff
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x40f24c
jmp 0x40e81e
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x40ecff
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x40f204
cmpl $-0x2, %eax
jne 0x40e81e
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %ebx, %edx
callq 0x40ed32
jmp 0x40e81e
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x40ecff
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x40f204
cmpl $-0x2, %eax
jne 0x40e81e
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %r13d, %esi
movl %ebx, %ecx
callq 0x40f02e
movl %eax, %r8d
movq 0x48(%rsp), %rdx
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %rbp, %r15
movq %rbp, %rsi
movl %r13d, %ecx
movl %ebx, %r9d
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x40f294
movl 0x2c(%rsp), %ecx
addq $0x8, %r14
orb %al, %cl
movl %ecx, %eax
jmp 0x40e69a
andb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, long double, long double, long double, long double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float obj_amp)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value +=
obj_amp * c((std::get<0>(it) + R[i].id)->column, x);
Float pi_change;
int selected;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
default:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rcx, 0x68(%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x3fb3d(%rip), %rdx # 0x45c33f
fldt 0x120(%rsp)
fstpt 0x74(%rsp)
fldt 0x110(%rsp)
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fstpt 0xa0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
pushq $0x19
popq %rsi
leaq 0xa0(%rsp), %rcx
leaq 0x90(%rsp), %r8
leaq 0x80(%rsp), %r9
callq 0x126c32
leaq 0x60(%r12), %rcx
leaq 0x10(%r12), %rax
leaq 0x100(%r12), %rdx
xorl %r14d, %r14d
movq %rcx, 0x38(%rsp)
leaq 0x80(%r12), %rcx
movq %rax, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
cmpq 0x68(%rsp), %rbx
je 0x41cab6
movl (%rbx), %eax
movq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movq %r14, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movslq %eax, %rbp
movl %eax, 0x24(%rsp)
movl %ebp, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x80(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x418c1c
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x418c42
movl %eax, %ebx
shlq $0x5, %rbx
movl %eax, %r13d
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x41c937
movq 0x60(%r12), %rax
movq 0x48(%rsp), %rcx
movq 0x178(%r12), %rdi
movq %r15, %rdx
movslq 0x10(%rax,%r14), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x9c23c
movq 0x60(%r12), %rax
fldt (%rax,%r14)
fldt 0x74(%rsp)
fmulp %st, %st(2)
faddp %st, %st(1)
fstpt (%rax,%r14)
addq $0x20, %r14
jmp 0x41c8f4
movq 0x68(%r12), %rax
movslq %r13d, %rsi
movzbl (%rax,%rbp), %eax
cmpq $0x3, %rax
ja 0x41ca3e
leaq 0x49d28(%rip), %rcx # 0x46667c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x418d31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x41c9cd
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x418d31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rbx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rbx), %edx
movl 0x4(%rax,%rbx), %ecx
callq 0x419236
cmpl $-0x2, %eax
jne 0x41ca6f
movq 0x70(%r12), %rax
movl (%rax,%rbx), %ecx
movl 0x4(%rax,%rbx), %r8d
movq 0x50(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl %r13d, %edx
callq 0x418d64
jmp 0x41ca6f
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x418d31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x419236
cmpl $-0x2, %eax
jne 0x41ca6f
movl 0x24(%rsp), %ebp
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rdx
movl %r13d, %ecx
movl %ebp, %esi
callq 0x419060
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r14
jmp 0x41ca7d
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x418d31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x41927e
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r14
movl 0x24(%rsp), %ebp
movq 0x48(%rsp), %rdx
fldt 0xa0(%rsp)
fldt 0x90(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
movl %r13d, %r9d
callq 0x4192c6
orb %al, %r14b
addq $0x8, %rbx
jmp 0x41c888
andb $0x1, %r14b
movl %r14d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, long double, long double, long double, long double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float obj_amp)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value +=
obj_amp * c((std::get<0>(it) + R[i].id)->column, x);
Float pi_change;
int selected;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
default:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rcx, 0x68(%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x3f849(%rip), %rdx # 0x45c33f
fldt 0x120(%rsp)
fstpt 0x74(%rsp)
fldt 0x110(%rsp)
fldt 0x100(%rsp)
fldt 0xf0(%rsp)
fstpt 0xa0(%rsp)
fstpt 0x90(%rsp)
fstpt 0x80(%rsp)
pushq $0x19
popq %rsi
leaq 0xa0(%rsp), %rcx
leaq 0x90(%rsp), %r8
leaq 0x80(%rsp), %r9
callq 0x126c32
leaq 0x60(%r12), %rcx
leaq 0x10(%r12), %rax
leaq 0x100(%r12), %rdx
xorl %r14d, %r14d
movq %rcx, 0x38(%rsp)
leaq 0x80(%r12), %rcx
movq %rax, 0x60(%rsp)
movq %rdx, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
cmpq 0x68(%rsp), %rbx
je 0x41cdaa
movl (%rbx), %eax
movq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movq %r14, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movslq %eax, %rbp
movl %eax, 0x24(%rsp)
movl %ebp, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x80(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x418c1c
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x418c42
movl %eax, %ebx
shlq $0x5, %rbx
movl %eax, %r13d
xorl %r14d, %r14d
cmpq %r14, %rbx
je 0x41cc2b
movq 0x60(%r12), %rax
movq 0x48(%rsp), %rcx
movq 0x178(%r12), %rdi
movq %r15, %rdx
movslq 0x10(%rax,%r14), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x9c23c
movq 0x60(%r12), %rax
fldt (%rax,%r14)
fldt 0x74(%rsp)
fmulp %st, %st(2)
faddp %st, %st(1)
fstpt (%rax,%r14)
addq $0x20, %r14
jmp 0x41cbe8
movq 0x68(%r12), %rax
movslq %r13d, %rsi
movzbl (%rax,%rbp), %eax
cmpq $0x3, %rax
ja 0x41cd32
leaq 0x49a44(%rip), %rcx # 0x46668c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x418d31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x41ccc1
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x418d31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rbx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rbx), %edx
movl 0x4(%rax,%rbx), %ecx
callq 0x419236
cmpl $-0x2, %eax
jne 0x41cd63
movq 0x70(%r12), %rax
movl (%rax,%rbx), %ecx
movl 0x4(%rax,%rbx), %r8d
movq 0x50(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl %r13d, %edx
callq 0x418d64
jmp 0x41cd63
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x418d31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x419236
cmpl $-0x2, %eax
jne 0x41cd63
movl 0x24(%rsp), %ebp
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rdx
movl %r13d, %ecx
movl %ebp, %esi
callq 0x419060
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r14
jmp 0x41cd71
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x418d31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x41927e
movq 0x30(%rsp), %rbx
movq 0x28(%rsp), %r14
movl 0x24(%rsp), %ebp
movq 0x48(%rsp), %rdx
fldt 0xa0(%rsp)
fldt 0x90(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
movl %r13d, %r9d
callq 0x4192c6
orb %al, %r14b
addq $0x4, %rbx
jmp 0x41cb7c
andb $0x1, %r14b
movl %r14d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x548, %rsp # imm = 0x548
vmovsd %xmm0, 0x88(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x60(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x70(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x108(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x98bf0
fldl 0x20(%r12)
fstpt 0xc8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xd4(%rsp)
fldl 0x30(%r12)
fstpt 0xbc(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x54(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x41e994
movq 0x10(%r14), %rdi
leaq 0x108(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x98cca
fstpt 0xa0(%rsp)
jmp 0x41e9ad
fstp %st(0)
vmovsd %xmm0, 0xe8(%rsp)
fldl 0xe8(%rsp)
fstpt 0xa0(%rsp)
fldl 0x38(%r12)
fstpt 0xfc(%rsp)
fldl 0x40(%r12)
fstpt 0xf0(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x90(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x160(%rsp), %rdi
leaq 0x108(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x4173e8
movl 0xcc(%r12), %esi
leaq 0x128(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x9c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x2f0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x41ea8f
cmpl $0x1, %eax
je 0x41ea69
cmpl $0x2, %eax
jne 0x41eaa0
movq 0x18(%r14), %rdx
leaq 0x2f0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
jmp 0x41ea7a
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
vmovsd 0x355b6(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x96db2
jmp 0x41eaa0
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x96d3f
leaq 0x70(%rsp), %r15
movq %r13, 0x80(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x41ead9
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x48(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x41ead5
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x41eab2
leaq 0x2f8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x2e0(%rsp), %ecx
movl 0x2e4(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x48(%rsp)
leaq 0x3ba66(%rip), %rdx # 0x45a577
leaq 0x2f0(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x417878
vmovsd 0x48(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x70(%rsp), %r13
xorl %r15d, %r15d
vmovsd %xmm0, 0xe0(%rsp)
fldl 0xe0(%rsp)
fldt 0x54(%rsp)
cmpq 0xb0(%r12), %r15
je 0x41ec82
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movq %r13, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x4178ba
movq 0x1b0(%rsp), %rdx
movq 0x1d8(%rsp), %rcx
movl %eax, %ebx
leaq 0x2f0(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x95692
testl %ebx, %ebx
je 0x41ed36
cmpl %ebp, %ebx
jge 0x41ebfa
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x41f7f0
movl %ebx, %ebp
cmpq 0x90(%rsp), %r15
jle 0x41ec4b
movl %ebx, 0xb4(%rsp)
fildl 0xb4(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xb8(%rsp)
fidivl 0xb8(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x41ec4f
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x41ec82
fstp %st(0)
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x41f828
fldt 0x48(%rsp)
fldt 0x54(%rsp)
testb %al, %al
jne 0x41ec82
incq %r15
jmp 0x41eb73
fstp %st(0)
fstp %st(0)
movq 0x60(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x41ecb0
movq 0x60(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x41ece1
movq 0x60(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x9c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x2f0(%rsp), %rdi
callq 0x435d0
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x417d8e
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rax
addq $0x548, %rsp # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0x9706e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x41f7a6
movl $0x0, 0x6c(%rsp)
leaq 0x160(%rsp), %r15
leaq 0x70(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x54(%rsp)
fldt 0x48(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x41ec99
movq 0x18(%r14), %rcx
fldt 0xfc(%rsp)
fld %st(1)
fstpt 0x48(%rsp)
fmulp %st, %st(1)
fldt 0xf0(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x417aea
testl %eax, %eax
jne 0x41ee0c
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x41f7a6
movq %r14, %rdi
callq 0x41f828
fldt 0x54(%rsp)
fldt 0x48(%rsp)
testb %al, %al
jne 0x41ec99
movl %ebx, 0x90(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x41ef55
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x4178ba
testl %eax, %eax
je 0x41ef05
vcvtsi2sd %r13d, %xmm1, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x41eed3
movl %eax, 0xac(%rsp)
fildl 0xac(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xb0(%rsp)
fidivl 0xb0(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x41eed7
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x41ef45
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x41f828
testb %al, %al
jne 0x41ef4d
fldt 0x54(%rsp)
fldt 0x48(%rsp)
incl %ebx
jmp 0x41ee30
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull 0x6c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x41f7a6
fldt 0x54(%rsp)
fldt 0x48(%rsp)
jmp 0x41ef55
fldt 0x54(%rsp)
fxch %st(1)
jmp 0x41ef55
fldt 0x54(%rsp)
fldt 0x48(%rsp)
movl 0x90(%rsp), %ebx
decl 0x6c(%rsp)
incl %ebx
jmp 0x41ed81
jmp 0x41efa2
jmp 0x41ef7b
fstp %st(1)
fstp %st(0)
jmp 0x41efa2
movq %rax, %rbx
jmp 0x41efb2
movq %rax, %rbx
jmp 0x41efbf
movq %rax, %rbx
jmp 0x41efcc
movq %rax, %rbx
jmp 0x41efd9
movq %rax, %rbx
jmp 0x41efe3
jmp 0x41efa2
jmp 0x41efa2
jmp 0x41efa2
leaq 0x2f8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x41efb2
leaq 0x2f0(%rsp), %rdi
movq %rax, %rbx
callq 0x435d0
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x417d8e
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp # imm = 0x308
vmovsd %xmm0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x58(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x68(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x118(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x98bf0
fldl 0x20(%r12)
fstpt 0xd8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xe4(%rsp)
fldl 0x30(%r12)
fstpt 0xcc(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x4c(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x41f0dc
movq 0x10(%r14), %rdi
leaq 0x118(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x98cca
fstpt 0x94(%rsp)
jmp 0x41f0f5
fstp %st(0)
vmovsd %xmm0, 0xf8(%rsp)
fldl 0xf8(%rsp)
fstpt 0x94(%rsp)
fldl 0x38(%r12)
fstpt 0x10c(%rsp)
fldl 0x40(%r12)
fstpt 0x100(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x88(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x170(%rsp), %rdi
leaq 0x118(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x4173e8
movl 0xcc(%r12), %esi
leaq 0x138(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x90(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0xb0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x41f1d7
cmpl $0x1, %eax
je 0x41f1b1
cmpl $0x2, %eax
jne 0x41f1e8
movq 0x18(%r14), %rdx
leaq 0xb0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
jmp 0x41f1c2
movq 0x18(%r14), %rdx
leaq 0x68(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
vmovsd 0x34e6e(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x96db2
jmp 0x41f1e8
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x96d3f
leaq 0x68(%rsp), %r15
movq %r13, 0x78(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x41f21e
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x40(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x41f21a
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x41f1f7
leaq 0xb8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x138(%rsp), %rdi
leaq 0x170(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x417878
vmovsd 0x40(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x68(%rsp), %rbx
xorl %r15d, %r15d
vmovsd %xmm0, 0xf0(%rsp)
fldl 0xf0(%rsp)
fldt 0x4c(%rsp)
cmpq 0xb0(%r12), %r15
je 0x41f379
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x138(%rsp), %rdi
leaq 0x170(%rsp), %rsi
movq %rbx, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x4178ba
movl %eax, %r13d
testl %eax, %eax
je 0x41f420
cmpl %ebp, %r13d
jge 0x41f2f0
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x41f8d2
movl %r13d, %ebp
cmpq 0x88(%rsp), %r15
jle 0x41f342
movl %r13d, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x2f0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x41f346
fldt 0x40(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x41f379
fstp %st(0)
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x41f90a
fldt 0x40(%rsp)
fldt 0x4c(%rsp)
testb %al, %al
jne 0x41f379
incq %r15
jmp 0x41f28a
fstp %st(0)
fstp %st(0)
movq 0x58(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x41f3a7
movq 0x58(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x41f3d8
movq 0x58(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x90(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x138(%rsp), %rdi
callq 0x393ac
leaq 0x170(%rsp), %rdi
callq 0x417d8e
leaq 0x118(%rsp), %rdi
callq 0x968b6
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rax
addq $0x308, %rsp # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
leaq 0x68(%rsp), %rbx
movq %rbx, %rsi
callq 0x9706e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x41f888
movl $0x0, 0x64(%rsp)
leaq 0x170(%rsp), %r15
leaq 0x68(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x41f390
movq 0x18(%r14), %rcx
fldt 0x10c(%rsp)
fld %st(1)
fstpt 0x40(%rsp)
fmulp %st, %st(1)
fldt 0x100(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x138(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x417aea
testl %eax, %eax
jne 0x41f4f0
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x41f888
movq %r14, %rdi
callq 0x41f90a
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
testb %al, %al
jne 0x41f390
movl %ebx, 0x88(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x41f636
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x138(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x4178ba
testl %eax, %eax
je 0x41f5e9
vcvtsi2sd %r13d, %xmm2, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x41f5b7
movl %eax, 0xa0(%rsp)
fildl 0xa0(%rsp)
movl 0x2f0(%rsp), %eax
movl %eax, 0xa4(%rsp)
fidivl 0xa4(%rsp)
fldt 0xcc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xd8(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x41f5bb
fldt 0x40(%rsp)
fldt 0xe4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x41f626
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x41f90a
testb %al, %al
jne 0x41f62e
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
incl %ebx
jmp 0x41f514
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull 0x64(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x41f888
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
jmp 0x41f636
fldt 0x4c(%rsp)
fxch %st(1)
jmp 0x41f636
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
movl 0x88(%rsp), %ebx
decl 0x64(%rsp)
incl %ebx
jmp 0x41f468
jmp 0x41f67e
jmp 0x41f657
fstp %st(1)
fstp %st(0)
jmp 0x41f67e
movq %rax, %rbx
jmp 0x41f68e
movq %rax, %rbx
jmp 0x41f69b
movq %rax, %rbx
jmp 0x41f6a8
movq %rax, %rbx
jmp 0x41f6b2
jmp 0x41f67e
jmp 0x41f67e
jmp 0x41f67e
leaq 0xb8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x41f681
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
callq 0x393ac
leaq 0x170(%rsp), %rdi
callq 0x417d8e
leaq 0x118(%rsp), %rdi
callq 0x968b6
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x41f70c
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x41f786
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::pnm_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x3a311(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, true>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::none_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x3a14d(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::solver_inequalities_Zcoeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::quadratic_cost_type<long double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&) | solver_inequalities_Zcoeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_inequalities_Zcoeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, A(std::make_unique<int[]>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, Z(std::make_unique<subsolver_type[]>(m_))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
// Count the maximum function elements in the constraint where a least
// one coefficient is in Z. To be use with the branch-and-bound and
// exhaustive solvers.
std::size_t z_variables_max = 0;
// Count the maximum constraint number where at leat one coefficient is
// in Z. To be used with the exhaustive solver.
std::size_t z_constraint_exhaustive = 0;
int id = 0;
for (int i = 0, e = length(csts); i != e; ++i) {
int lower = 0, upper = 0;
std::size_t local_z_variables_max = 0;
Z[i] =
subsolver_type::linear; // Default, Z solver use the classical
// Bastert selection for 101 problem.
for (const auto& cst : csts[i].elements) {
bx_ensures(cst.factor);
A[id++] = cst.factor;
++local_z_variables_max;
if (cst.factor > 0)
upper += cst.factor;
else
lower += cst.factor;
if (cst.factor < -1 || cst.factor > 1) {
Z[i] = subsolver_type::branch_and_bound;
}
}
if (Z[i] == subsolver_type::branch_and_bound &&
local_z_variables_max < maximum_factor_exhaustive_solver)
Z[i] = subsolver_type::exhaustive;
if (csts[i].min == csts[i].max) {
b[i].min = csts[i].min;
b[i].max = csts[i].max;
} else {
if (lower >= csts[i].min || upper <= csts[i].max) {
if (Z[i] == subsolver_type::branch_and_bound)
Z[i] = subsolver_type::unconstrained_branch_and_bound;
else if (Z[i] == subsolver_type::exhaustive)
Z[i] = subsolver_type::unconstrained_exhaustive;
}
b[i].min = std::max(lower, csts[i].min);
b[i].max = std::min(upper, csts[i].max);
}
z_variables_max = std::max(z_variables_max, local_z_variables_max);
if (Z[i] == subsolver_type::exhaustive ||
Z[i] == subsolver_type::unconstrained_exhaustive) {
z_constraint_exhaustive++;
ex.build_constraints(i, csts[i].elements, b[i].min, b[i].max);
}
logger::log("Is Z: {} ({}) with {} <= {}\n",
static_cast<int>(Z[i]),
local_z_variables_max,
b[i].min,
b[i].max);
bx_ensures(b[i].min <= b[i].max);
}
if (z_constraint_exhaustive > 0)
ex.reserve(z_variables_max, z_constraint_exhaustive);
bb.reserve(z_variables_max);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
andq $0x0, (%rdi)
leaq 0x10(%rdi), %rbx
movq %rsi, 0x8(%rdi)
movq %rdi, %r15
movq %r8, %r14
movl %ecx, %ebp
movl %edx, %r12d
movq %r9, 0x28(%rsp)
movq %r9, %rsi
movq %rbx, %rdi
callq 0x3a4ca
movl 0x38(%r15), %esi
leaq 0x50(%r15), %r13
movq %r13, %rdi
movq %rbx, 0x60(%rsp)
callq 0x8afb9
movl 0x38(%r15), %esi
leaq 0x58(%r15), %rdi
movq %rdi, 0x40(%rsp)
movq %r13, 0x58(%rsp)
callq 0x28eb6
movq 0x28(%rsp), %rdi
movl %ebp, 0x20(%rsp)
movq %r14, 0x8(%rsp)
leaq 0x60(%r15), %rbp
callq 0x3a89d
movq %rbp, %rdi
movq %rax, %rsi
callq 0x420cab
movslq %r12d, %r14
leaq 0x68(%r15), %rdi
movq %r14, %rsi
movq %rdi, 0x38(%rsp)
movq %rbp, 0x50(%rsp)
callq 0x420ceb
leaq 0x70(%r15), %rdi
movq %r14, %rsi
movq %rdi, 0x10(%rsp)
callq 0x420d1a
leaq 0x78(%r15), %rdi
movq %r14, %rsi
movq %rdi, 0x48(%rsp)
callq 0x8afb9
leaq 0x80(%r15), %rax
vxorps %xmm0, %xmm0, %xmm0
movq 0x28(%rsp), %rcx
movq %rax, 0x30(%rsp)
vmovups %xmm0, 0x8c(%r15)
vmovaps %xmm0, 0x80(%r15)
leaq 0x100(%r15), %rax
vxorps %xmm0, %xmm0, %xmm0
orl $-0x1, 0x9c(%r15)
vmovups %ymm0, 0xa0(%r15)
vmovups %ymm0, 0xb0(%r15)
movq %rax, 0x18(%rsp)
leaq 0x150(%r15), %rax
vxorps %xmm0, %xmm0, %xmm0
andl $0x0, 0x150(%r15)
andq $0x0, 0x158(%r15)
andq $0x0, 0x140(%r15)
vmovups %zmm0, 0x100(%r15)
movq %rax, 0x160(%r15)
movq %rax, 0x168(%r15)
movq 0x8(%rsp), %rax
andq $0x0, 0x170(%r15)
movq %rax, 0x178(%r15)
movl 0x20(%rsp), %eax
movl %r12d, 0x180(%r15)
movl %eax, 0x184(%r15)
movq 0x8(%rcx), %rax
subq (%rcx), %rax
pushq $0x28
popq %rcx
cqto
xorl %r15d, %r15d
xorl %r14d, %r14d
xorl %ebp, %ebp
idivq %rcx
movq $0x0, 0x8(%rsp)
movl %eax, %eax
movq %rax, 0x20(%rsp)
cmpq 0x20(%rsp), %r15
je 0x420654
movq 0x38(%rsp), %rax
imulq $0x28, %r15, %rsi
movslq %ebp, %rbp
xorl %r13d, %r13d
xorl %edi, %edi
leaq (,%rbp,4), %r9
movq (%rax), %rcx
movq 0x28(%rsp), %rax
movb $0x4, (%rcx,%r15)
movq (%rax), %rax
leaq (%rax,%rsi), %rdx
movq (%rax,%rsi), %r8
movq 0x8(%rax,%rsi), %r10
movq 0x40(%rsp), %rax
xorl %esi, %esi
addq (%rax), %r9
movb $0x4, %al
cmpq %r10, %r8
je 0x420563
movl (%r8), %r11d
testl %r11d, %r11d
je 0x42068d
movl %r11d, (%r9)
movl $0x0, %r11d
movl (%r8), %ebx
testl %ebx, %ebx
leal -0x2(%rbx), %r12d
cmovsl %ebx, %r11d
cmpl $-0x4, %r12d
ja 0x420545
xorl %eax, %eax
movb $0x0, (%rcx,%r15)
movl %ebx, %r12d
sarl $0x1f, %r12d
addl %r11d, %edi
addq $0x8, %r8
decq %r13
addq $0x4, %r9
andnl %ebx, %r12d, %ebx
addl %ebx, %esi
jmp 0x420511
movq %r13, %r9
negq %r9
testb %al, %al
jne 0x42057a
cmpq $0xa, %r9
jae 0x42057a
movb $0x1, %al
movb $0x1, (%rcx,%r15)
movl 0x18(%rdx), %r8d
movl 0x1c(%rdx), %r10d
cmpl %r10d, %r8d
jne 0x42059c
movq 0x10(%rsp), %rcx
movq (%rcx), %rdi
imulq $0xc, %r15, %rcx
movl %r8d, (%rdi,%rcx)
movl %r8d, %ecx
jmp 0x4205e5
cmpl %r8d, %edi
jge 0x4205a6
cmpl %r10d, %esi
jg 0x4205be
testb %al, %al
je 0x4205b8
movzbl %al, %r10d
cmpl $0x1, %r10d
jne 0x4205be
movb $0x3, %al
jmp 0x4205ba
movb $0x2, %al
movb %al, (%rcx,%r15)
cmpl %r8d, %edi
movl %r8d, %ecx
movq 0x10(%rsp), %r8
cmovgl %edi, %ecx
movq (%r8), %rdi
imulq $0xc, %r15, %r8
movl %ecx, (%rdi,%r8)
movl 0x1c(%rdx), %r8d
cmpl %esi, %r8d
cmovll %r8d, %esi
movl %esi, %r8d
imulq $0xc, %r15, %rbx
cmpq %r9, %r14
movzbl %al, %eax
cmovbeq %r9, %r14
orl $0x2, %eax
movl %r8d, 0x4(%rdi,%rbx)
cmpl $0x3, %eax
jne 0x42061d
movq 0x18(%rsp), %rdi
movl %r15d, %esi
vzeroupper
callq 0x4033b4
movq 0x10(%rsp), %rax
incq 0x8(%rsp)
movq (%rax), %rdi
subq %r13, %rbp
movl (%rdi,%rbx), %eax
incq %r15
cmpl 0x4(%rdi,%rbx), %eax
jle 0x4204c4
leaq 0x37df3(%rip), %rdi # 0x45842a
leaq 0x39c6b(%rip), %rsi # 0x45a2a9
leaq 0x4649c(%rip), %rdx # 0x466ae1
leaq 0x46521(%rip), %rcx # 0x466b6d
vzeroupper
callq 0x2813f
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x42066e
movq 0x18(%rsp), %rdi
movq %r14, %rsi
vzeroupper
callq 0x4035c8
movq 0x30(%rsp), %rdi
movq %r14, %rsi
vzeroupper
callq 0x40364c
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x37d96(%rip), %rdi # 0x45842a
leaq 0x4643b(%rip), %rsi # 0x466ad6
leaq 0x4643f(%rip), %rdx # 0x466ae1
leaq 0x464a3(%rip), %rcx # 0x466b4c
vzeroupper
callq 0x2813f
movq %rax, %r14
jmp 0x4206f2
movq %rax, %r14
jmp 0x4206fc
movq %rax, %r14
jmp 0x420706
movq %rax, %r14
jmp 0x420710
movq %rax, %r14
jmp 0x42071a
movq %rax, %r14
jmp 0x420724
jmp 0x4206d1
movq 0x18(%rsp), %rdi
movq %rax, %r14
callq 0x403676
movq 0x30(%rsp), %rdi
callq 0x40369e
movq 0x48(%rsp), %rdi
callq 0x8affa
movq 0x10(%rsp), %rdi
callq 0x420d58
movq 0x38(%rsp), %rdi
callq 0x420d72
movq 0x50(%rsp), %rdi
callq 0x420d8c
movq 0x40(%rsp), %rdi
callq 0x28fb6
movq 0x58(%rsp), %rdi
callq 0x8affa
movq 0x60(%rsp), %rdi
callq 0x3a954
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double) | int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
fldt 0xb0(%rsp)
fldt 0xa0(%rsp)
fldt 0x90(%rsp)
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0x420899
leaq 0x45ee8(%rip), %rdx # 0x46669c
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x68(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x420fc8
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x420ed2
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x4244d2
jmp 0x42090d
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x423bfc
jmp 0x420858
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x424067
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x421458
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x421698
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x4208e2
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x421218
jmp 0x420936
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x424a26
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x42179a
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x420ed2
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x421218
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x4219da
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double, long double) | int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
fldt 0xd0(%rsp)
fldt 0xc0(%rsp)
fldt 0xb0(%rsp)
fldt 0xa0(%rsp)
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0x4209f3
xorl %esi, %esi
leal 0x1(%rax), %edx
cmpl $0x7, %eax
cmovll %edx, %esi
movl %esi, %eax
movl %esi, 0x30(%r14)
decl %eax
cmpl $0x6, %eax
ja 0x420b0a
leaq 0x45cb3(%rip), %rdx # 0x4666b8
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x78(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
fxch %st(3)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x424f76
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x420ed2
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %r15, %rdx
fstpt 0x40(%rsp)
callq 0x426369
jmp 0x420b97
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x425a93
jmp 0x420abe
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x425efe
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x425504
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x421698
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(3)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x420bba
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %rcx, %rdx
fstpt 0x40(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x42523c
jmp 0x420bc8
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %r15, %rdx
fstpt 0x40(%rsp)
callq 0x4268bd
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4257cc
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x420ed2
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %rcx, %rdx
fstpt 0x40(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x42523c
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x4219da
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false> const, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false> const&, baryonyx::bit_array const&) | int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
cmpq %rax, 0x20(%rdi)
je 0x420df2
movq %rax, 0x20(%rdi)
leaq 0x18(%rdi), %rax
leaq 0x10(%r15), %rcx
xorl %r12d, %r12d
movq %rdi, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movl 0x180(%r15), %eax
movq %rcx, 0x18(%rsp)
movq %rax, 0x28(%rsp)
cmpq 0x28(%rsp), %r12
je 0x420eb7
movq 0x18(%rsp), %rsi
movq %rsp, %rdi
movl %r12d, %edx
movq %r12, 0x30(%rsp)
callq 0x3c868
movq (%rsp), %r13
movq 0x8(%rsp), %r12
xorl %ebx, %ebx
cmpq %r13, %r12
je 0x420e6b
movslq (%r12), %rax
movq 0x58(%r15), %rcx
movl 0x4(%r12), %esi
movq %r14, %rdi
movl (%rcx,%rax,4), %ebp
callq 0x3664a
imull %ebp, %eax
addq $0x8, %r12
addl %eax, %ebx
jmp 0x420e43
movq 0x30(%rsp), %r12
movq 0x70(%r15), %rcx
imulq $0xc, %r12, %rdx
movl (%rcx,%rdx), %eax
subl %ebx, %eax
jle 0x420e8c
shlq $0x20, %rax
orq %r12, %rax
movq %rax, (%rsp)
jmp 0x420e9d
subl 0x4(%rcx,%rdx), %ebx
jle 0x420eaa
shlq $0x20, %rbx
orq %r12, %rbx
movq %rbx, (%rsp)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x3c8c2
movq 0x20(%rsp), %rdi
incq %r12
jmp 0x420e18
movq 0x20(%rdi), %rax
subq 0x18(%rdi), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&) | int
compute_violated_constraints(const Solver& slv,
const Xtype& x,
std::vector<int>& out)
{
out.clear();
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
out.emplace_back(k);
return length(out);
} | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rax, 0x8(%rdx)
je 0x420ef0
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x180(%r15), %esi
je 0x420f26
movq %r15, %rdi
movq %r14, %rdx
callq 0x420f3d
testb %al, %al
jne 0x420f1e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x420ef7
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false> const&, int, baryonyx::bit_array const&) | bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movl %esi, %edx
leaq 0x10(%rdi), %rsi
leaq 0x8(%rsp), %r15
movq %rdi, %rbx
movl %edx, 0x4(%rsp)
movq %r15, %rdi
callq 0x3c868
movq (%r15), %r12
movq 0x8(%r15), %r13
xorl %r15d, %r15d
cmpq %r12, %r13
je 0x420f9a
movslq (%r13), %rax
movq 0x58(%rbx), %rcx
movl 0x4(%r13), %esi
movq %r14, %rdi
movl (%rcx,%rax,4), %ebp
callq 0x3664a
imull %ebp, %eax
addq $0x8, %r13
addl %eax, %r15d
jmp 0x420f72
movslq 0x4(%rsp), %rcx
movq 0x70(%rbx), %rax
imulq $0xc, %rcx, %rcx
cmpl %r15d, (%rax,%rcx)
jle 0x420fb1
xorl %eax, %eax
jmp 0x420fb9
cmpl 0x4(%rax,%rcx), %r15d
setle %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x58(%rsp)
leaq 0x10(%rdi), %rax
leaq 0x60(%rdi), %rcx
movq %rsi, %r15
leaq 0x100(%rdi), %rsi
movq %rdi, %r12
xorl %ebp, %ebp
fldt 0xe0(%rsp)
fstpt 0x7c(%rsp)
fldt 0xd0(%rsp)
fstpt 0x70(%rsp)
fldt 0xc0(%rsp)
fstpt 0x64(%rsp)
movq %rax, 0x48(%rsp)
movq %rcx, 0x20(%rsp)
leaq 0x80(%rdi), %rcx
movq %rsi, 0x30(%rsp)
movq %rdx, 0x50(%rsp)
movq (%rdx), %rax
movq %rcx, 0x28(%rsp)
movq 0x58(%rsp), %rcx
cmpq (%rcx), %rax
je 0x4211ff
movl -0x4(%rax), %r13d
movq 0x48(%rsp), %rsi
leaq 0x38(%rsp), %rdi
movl %r13d, %edx
callq 0x3de66
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
fldt 0x7c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x421a1c
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %r14
callq 0x421a42
movq 0x68(%r12), %rcx
movslq %r13d, %r15
movl %eax, %ebx
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x4211c0
leaq 0x45622(%rip), %rcx # 0x4666d4
movslq %ebx, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x421161
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42207e
jmp 0x4211bd
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x4211bd
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %ebx, %edx
callq 0x421b64
jmp 0x4211bd
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x4211bd
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %r13d, %esi
movl %ebx, %ecx
callq 0x421e60
movl %eax, %r8d
movq 0x40(%rsp), %rdx
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r14, %r15
movq %r14, %rsi
movl %r13d, %ecx
movl %ebx, %r9d
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x4220c6
movq 0x50(%rsp), %rcx
orb %al, %bpl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x421039
andb $0x1, %bpl
movl %ebp, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x58(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
fldt 0xe0(%rsp)
fstpt 0x7c(%rsp)
fldt 0xd0(%rsp)
fstpt 0x70(%rsp)
fldt 0xc0(%rsp)
fstpt 0x64(%rsp)
movq %rax, 0x50(%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x100(%rdi), %rax
movq %rax, 0x38(%rsp)
leaq 0x80(%rdi), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
cmpq 0x58(%rsp), %r14
je 0x421444
movl (%r14), %r13d
movq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl %eax, 0x2c(%rsp)
movl %r13d, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x7c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x421a1c
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %rbp
callq 0x421a42
movq 0x68(%r12), %rcx
movslq %r13d, %r15
movl %eax, %ebx
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x42140b
leaq 0x453eb(%rip), %rcx # 0x4666e8
movslq %ebx, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x4213ac
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42207e
jmp 0x421408
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x421408
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %ebx, %edx
callq 0x421b64
jmp 0x421408
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x421408
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %r13d, %esi
movl %ebx, %ecx
callq 0x421e60
movl %eax, %r8d
movq 0x48(%rsp), %rdx
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %rbp, %r15
movq %rbp, %rsi
movl %r13d, %ecx
movl %ebx, %r9d
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x4220c6
movl 0x2c(%rsp), %ecx
addq $0x4, %r14
orb %al, %cl
movl %ecx, %eax
jmp 0x421284
andb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x58(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
fldt 0xe0(%rsp)
fstpt 0x7c(%rsp)
fldt 0xd0(%rsp)
fstpt 0x70(%rsp)
fldt 0xc0(%rsp)
fstpt 0x64(%rsp)
movq %rax, 0x50(%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x100(%rdi), %rax
movq %rax, 0x38(%rsp)
leaq 0x80(%rdi), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
cmpq 0x58(%rsp), %r14
je 0x421684
movl (%r14), %r13d
movq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl %eax, 0x2c(%rsp)
movl %r13d, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x7c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x421a1c
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %rbp
callq 0x421a42
movq 0x68(%r12), %rcx
movslq %r13d, %r15
movl %eax, %ebx
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x42164b
leaq 0x451bf(%rip), %rcx # 0x4666fc
movslq %ebx, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x4215ec
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42207e
jmp 0x421648
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x421648
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %ebx, %edx
callq 0x421b64
jmp 0x421648
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x421648
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %r13d, %esi
movl %ebx, %ecx
callq 0x421e60
movl %eax, %r8d
movq 0x48(%rsp), %rdx
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %rbp, %r15
movq %rbp, %rsi
movl %r13d, %ecx
movl %ebx, %r9d
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x4220c6
movl 0x2c(%rsp), %ecx
addq $0x8, %r14
orb %al, %cl
movl %ecx, %eax
jmp 0x4214c4
andb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>&, baryonyx::bit_array const&) | int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
cmpq %rax, 0x20(%rdi)
je 0x4216ba
movq %rax, 0x20(%rdi)
leaq 0x18(%rdi), %rax
leaq 0x10(%r15), %rcx
xorl %r12d, %r12d
movq %rdi, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movl 0x180(%r15), %eax
movq %rcx, 0x18(%rsp)
movq %rax, 0x28(%rsp)
cmpq 0x28(%rsp), %r12
je 0x42177f
movq 0x18(%rsp), %rsi
movq %rsp, %rdi
movl %r12d, %edx
movq %r12, 0x30(%rsp)
callq 0x3de66
movq (%rsp), %r13
movq 0x8(%rsp), %r12
xorl %ebx, %ebx
cmpq %r13, %r12
je 0x421733
movslq (%r12), %rax
movq 0x58(%r15), %rcx
movl 0x4(%r12), %esi
movq %r14, %rdi
movl (%rcx,%rax,4), %ebp
callq 0x3664a
imull %ebp, %eax
addq $0x8, %r12
addl %eax, %ebx
jmp 0x42170b
movq 0x30(%rsp), %r12
movq 0x70(%r15), %rcx
imulq $0xc, %r12, %rdx
movl (%rcx,%rdx), %eax
subl %ebx, %eax
jle 0x421754
shlq $0x20, %rax
orq %r12, %rax
movq %rax, (%rsp)
jmp 0x421765
subl 0x4(%rcx,%rdx), %ebx
jle 0x421772
shlq $0x20, %rbx
orq %r12, %rbx
movq %rbx, (%rsp)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x3c8c2
movq 0x20(%rsp), %rdi
incq %r12
jmp 0x4216e0
movq 0x20(%rdi), %rax
subq 0x18(%rdi), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rcx, 0x58(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
fldt 0xe0(%rsp)
fstpt 0x7c(%rsp)
fldt 0xd0(%rsp)
fstpt 0x70(%rsp)
fldt 0xc0(%rsp)
fstpt 0x64(%rsp)
movq %rax, 0x50(%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x20(%rsp)
leaq 0x100(%rdi), %rax
movq %rax, 0x38(%rsp)
leaq 0x80(%rdi), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
cmpq 0x58(%rsp), %r14
je 0x4219c6
movl (%r14), %r13d
movq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl %eax, 0x2c(%rsp)
movl %r13d, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x7c(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x421a1c
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %rbp
callq 0x421a42
movq 0x68(%r12), %rcx
movslq %r13d, %r15
movl %eax, %ebx
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x42198d
leaq 0x44e91(%rip), %rcx # 0x466710
movslq %ebx, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x42192e
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42207e
jmp 0x42198a
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x42198a
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %ebx, %edx
callq 0x421b64
jmp 0x42198a
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x42198a
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %r13d, %esi
movl %ebx, %ecx
callq 0x421e60
movl %eax, %r8d
movq 0x48(%rsp), %rdx
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %rbp, %r15
movq %rbp, %rsi
movl %r13d, %ecx
movl %ebx, %r9d
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x4220c6
movl 0x2c(%rsp), %ecx
addq $0x4, %r14
orb %al, %cl
movl %ecx, %eax
jmp 0x421806
andb $0x1, %al
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false> const&, baryonyx::bit_array const&) | int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x180(%r14), %r15d
je 0x421a0f
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x420f3d
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0x4219ec
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::decrease_preference(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, long double) | void decrease_preference(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
Float theta) noexcept
{
for (; begin != end; ++begin)
P[begin->value] *= theta;
} | fldt 0x8(%rsp)
movq 0x50(%rdi), %rax
cmpq %rdx, %rsi
je 0x421a3e
movslq (%rsi), %rcx
addq $0x8, %rsi
shlq $0x4, %rcx
fldt (%rax,%rcx)
fmul %st(1), %st
fstpt (%rax,%rcx)
jmp 0x421a24
fstp %st(0)
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::compute_reduced_costs<baryonyx::bit_array>(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, baryonyx::bit_array const&) | int compute_reduced_costs(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
const Xtype& x) noexcept
{
// to_log(
// debug_os, " compute-reduced-cost {}\n", std::distance(begin,
// end));
int r_size = 0;
for (; begin != end; ++begin) {
Float sum_a_pi_p = 0;
for (auto [first, last] = ap.column(begin->column); first != last;
++first) {
auto a = std::abs(static_cast<Float>(A[first->value]));
sum_a_pi_p += a * (pi[first->row] + P[first->value]);
}
R[r_size].id = r_size;
R[r_size].f = A[begin->value];
R[r_size].value = c(begin->column, x) - sum_a_pi_p;
// to_log(debug_os,
// 4u,
// "Compute: {} = {} - {} - {}\n",
// r_size,
// c(begin->column, x),
// sum_pi,
// sum_p);
// to_log(debug_os, 4u, "{}x{}\n", R[r_size].f, R[r_size].value);
++r_size;
}
// to_log(debug_os, "\n");
return r_size;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x10(%rdi), %rbp
movq %rcx, 0x10(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r13
xorl %ebx, %ebx
cmpq %r14, %r15
je 0x421b20
movl 0x4(%r15), %edx
leaq 0x18(%rsp), %rdi
movq %rbp, %rsi
callq 0x3dede
movq 0x18(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq 0x50(%r13), %rsi
movq 0x58(%r13), %rax
movq 0x78(%r13), %rdi
fldz
cmpq %rcx, %rdx
je 0x421ad2
movslq (%rdx), %r8
movl (%rax,%r8,4), %r9d
shlq $0x4, %r8
movl %r9d, 0xc(%rsp)
fildl 0xc(%rsp)
fabs
movslq 0x4(%rdx), %r9
addq $0x8, %rdx
shlq $0x4, %r9
fldt (%rdi,%r9)
fldt (%rsi,%r8)
faddp %st, %st(1)
fmulp %st, %st(1)
faddp %st, %st(1)
movq %rdx, 0x20(%rsp)
jmp 0x421a96
movq 0x60(%r13), %rcx
movq %rbx, %r12
shlq $0x5, %r12
movl %ebx, 0x10(%rcx,%r12)
movslq (%r15), %rdx
movl (%rax,%rdx,4), %eax
movq 0x10(%rsp), %rdx
movl %eax, 0x14(%rcx,%r12)
movq 0x178(%r13), %rdi
movl 0x4(%r15), %esi
fstpt 0x2c(%rsp)
callq 0x9c23c
fldt 0x2c(%rsp)
fsubrp %st, %st(1)
movq 0x60(%r13), %rax
incq %rbx
addq $0x8, %r15
fstpt (%rax,%r12)
jmp 0x421a64
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::branch_and_bound_solver<baryonyx::itm::maximize_tag, long double>::solve<std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data []>>>(std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data []>>&, int, int, int) | int solve(R& reduced_cost, int r_size, int bk_min, int bk_max)
{
bx_assert(r_size >= 4);
bx_assert(bk_min <= bk_max);
b_min = bk_min;
b_max = bk_max;
items.resize(r_size);
if (!subvector.init(r_size))
throw solver_failure(solver_error_tag::no_solver_available);
solution = subvector.emplace();
bx_assert(solution == 0u);
nodes.clear();
for (int i = 0; i != r_size; ++i) {
items[i].r = reduced_cost[i].value;
items[i].variable = reduced_cost[i].id;
items[i].original_factor = reduced_cost[i].f;
items[i].factor = std::abs(reduced_cost[i].f);
items[i].result = 0;
}
std::fill_n(
subvector.element_data(solution), subvector.element_size(), 0);
std::sort(std::begin(items), std::end(items));
for (std::size_t i = 0, e = items.size(); i != e; ++i) {
if (items[i].original_factor < 0) {
b_min += items[i].factor;
b_max += items[i].factor;
}
}
// Compute the inversion of the sum z
items.back().sum_z = items.back().r;
for (int i = length(items) - 2; i >= 0; --i)
items[i].sum_z = items[i + 1].sum_z + items[i].r;
if (b_max == b_min)
solve_equality();
else
solve_inequality();
for (int i = 0, e = length(items); i != e; ++i) {
if (items[i].original_factor > 0)
items[i].result = subvector[solution + i] == 0 ? 0 : 1;
else
items[i].result = subvector[solution + i] == 0 ? 1 : 0;
}
std::sort(std::begin(items),
std::end(items),
[](const auto& lhs, const auto& rhs) {
if (lhs.result == rhs.result) {
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs.r < rhs.r;
else
return lhs.r > rhs.r;
} else
return lhs.result > rhs.result;
});
auto middle =
std::find_if(std::begin(items),
std::end(items),
[](const auto& item) { return item.result == 0; });
for (std::size_t i = 0, e = items.size(); i != e; ++i) {
reduced_cost[i].value = items[i].r;
reduced_cost[i].id = items[i].variable;
reduced_cost[i].f = items[i].original_factor;
}
if (middle == std::end(items))
return items[0].result == 0 ? -1 : r_size;
return static_cast<int>(std::distance(std::begin(items), middle) - 1);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x3, %edx
jle 0x421dbe
cmpl %r8d, %ecx
jg 0x421ddf
leaq 0x20(%rdi), %r13
movl %ecx, 0x74(%rdi)
movl %edx, %ebx
movq %rsi, %r14
movl %edx, %r12d
movq %rdi, %r15
movl %r8d, 0x78(%rdi)
movq %r12, %rsi
movq %r13, %rdi
callq 0x405a4e
movq %r15, %rdi
movl %ebx, %esi
callq 0x36e080
testb %al, %al
je 0x421e21
movq %r15, %rdi
callq 0x36e100
movl %eax, 0x70(%r15)
testl %eax, %eax
jne 0x421e00
movq 0x38(%r15), %rax
cmpq %rax, 0x40(%r15)
je 0x421bd6
movq %rax, 0x40(%r15)
movq (%r14), %rax
movq (%r13), %rcx
imulq $0x30, %r12, %rdx
xorl %esi, %esi
addq $0x14, %rax
cmpq %rsi, %rdx
je 0x421c1d
fldt -0x14(%rax)
fstpt (%rcx,%rsi)
movl -0x4(%rax), %edi
movl %edi, 0x28(%rcx,%rsi)
movl (%rax), %edi
movl %edi, %r8d
negl %r8d
movl %edi, 0x24(%rcx,%rsi)
cmovsl %edi, %r8d
addq $0x20, %rax
movl %r8d, 0x20(%rcx,%rsi)
andl $0x0, 0x2c(%rcx,%rsi)
addq $0x30, %rsi
jmp 0x421be7
movq %r15, %rdi
xorl %esi, %esi
callq 0x36e156
leaq 0x4(%rsp), %rdx
movl 0x18(%r15), %esi
movq %rax, %rdi
andl $0x0, (%rdx)
callq 0x36e561
movq 0x20(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0x405db8
movq 0x28(%r15), %rdi
movq 0x20(%r15), %rcx
movq %rdi, %rax
subq %rcx, %rax
pushq $0x30
popq %r12
cqto
leaq 0x24(%rcx), %r8
idivq %r12
movl 0x74(%r15), %edx
movl 0x78(%r15), %esi
movq %rax, %r9
subq $0x1, %r9
jb 0x421c92
cmpl $0x0, (%r8)
jns 0x421c8c
movl -0x4(%r8), %r10d
addl %r10d, %edx
addl %r10d, %esi
movl %edx, 0x74(%r15)
movl %esi, 0x78(%r15)
addq $0x30, %r8
jmp 0x421c6e
fldt -0x30(%rdi)
fstpt -0x20(%rdi)
addl $-0x2, %eax
leaq 0x40(%rcx), %rdi
testl %eax, %eax
js 0x421cbd
movl %eax, %r8d
imulq $0x30, %r8, %r8
decl %eax
fldt (%rdi,%r8)
fldt (%rcx,%r8)
faddp %st, %st(1)
fstpt 0x10(%rcx,%r8)
jmp 0x421c9f
movl %ebx, (%rsp)
movq %r14, %rbx
movq %r15, %rdi
cmpl %edx, %esi
jne 0x421cd1
callq 0x405a86
jmp 0x421cd6
callq 0x405b48
movq 0x20(%r15), %rcx
movq 0x28(%r15), %rax
xorl %ebp, %ebp
subq %rcx, %rax
cqto
idivq %r12
xorl %r12d, %r12d
movl %eax, %eax
imulq $0x30, %rax, %r13
cmpq %r12, %r13
je 0x421d2b
cmpl $0x0, 0x24(%rcx,%r12)
movl 0x70(%r15), %esi
movq %r15, %rdi
setg %r14b
addl %ebp, %esi
callq 0x36e328
cmpb $0x0, (%rax)
movq 0x20(%r15), %rcx
sete %al
incl %ebp
xorb %r14b, %al
movzbl %al, %eax
movl %eax, 0x2c(%rcx,%r12)
addq $0x30, %r12
jmp 0x421cf1
movq 0x20(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0x422b10
movq 0x20(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0x4232c8
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdi
movq %rax, %rcx
movq %rdi, %rax
subq %rsi, %rax
cqto
pushq $0x30
popq %r10
idivq %r10
movq (%rbx), %rdx
movl (%rsp), %r9d
movq %rsi, %r8
addq $0x10, %rdx
subq $0x1, %rax
jb 0x421d92
fldt (%r8)
fstpt -0x10(%rdx)
vmovsd 0x24(%r8), %xmm0
addq $0x30, %r8
vshufps $0xe1, %xmm0, %xmm0, %xmm0 # xmm0 = xmm0[1,0,2,3]
vmovlps %xmm0, (%rdx)
addq $0x20, %rdx
jmp 0x421d6d
cmpq %rdi, %rcx
je 0x421da6
subq %rsi, %rcx
movq %rcx, %rax
cqto
idivq %r10
decl %eax
jmp 0x421daf
cmpl $0x1, 0x2c(%rsi)
sbbl %eax, %eax
orl %r9d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x373a7(%rip), %rdi # 0x45916c
leaq 0x44e99(%rip), %rsi # 0x466c65
leaq 0x44e9e(%rip), %rdx # 0x466c71
leaq 0x44f00(%rip), %rcx # 0x466cda
callq 0x2813f
leaq 0x37386(%rip), %rdi # 0x45916c
leaq 0x44ef1(%rip), %rsi # 0x466cde
leaq 0x44e7d(%rip), %rdx # 0x466c71
leaq 0x44ef4(%rip), %rcx # 0x466cef
callq 0x2813f
leaq 0x37365(%rip), %rdi # 0x45916c
leaq 0x44ee5(%rip), %rsi # 0x466cf3
leaq 0x44e5c(%rip), %rdx # 0x466c71
leaq 0x44ee6(%rip), %rcx # 0x466d02
callq 0x2813f
pushq $0x18
popq %rdi
callq 0xb210
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x36e0d4
movq 0x21b182(%rip), %rdx # 0x63cfc0
leaq 0x2185cb(%rip), %rsi # 0x63a410
movq %rbx, %rdi
callq 0xb3c0
movq %rbx, %rdi
movq %rax, %r14
callq 0xb570
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/branch-and-bound-solver.hpp |
int baryonyx::itm::exhaustive_solver<baryonyx::itm::maximize_tag, long double>::solve<std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data []>>>(int, std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data []>>&, int) | int solve(int k, R& reduced_cost, int r_size)
{
const auto it_constraint = constraints.find(k);
bx_expects(it_constraint != constraints.end());
items.resize(r_size);
for (int i = 0; i != r_size; ++i) {
items[i].r = reduced_cost[i].value;
items[i].variable = reduced_cost[i].id;
items[i].factor = reduced_cost[i].f;
items[i].result = 0;
}
Float z_best = 0;
auto best = 0;
auto start_solution = it_constraint->start;
for (int j = 0; j != r_size; ++j)
if (flat_constraints[start_solution + j])
z_best += reduced_cost[j].value;
for (auto i = 1; i != it_constraint->solutions; ++i) {
start_solution = it_constraint->start + (i * r_size);
Float z = 0;
for (int j = 0; j != r_size; ++j)
if (flat_constraints[start_solution + j])
z += reduced_cost[j].value;
if (is_best_solution(z, z_best)) {
z_best = z;
best = i;
}
}
start_solution = it_constraint->start + (best * r_size);
for (int i = 0; i != r_size; ++i)
items[i].result = flat_constraints[start_solution + i] ? 1 : 0;
std::sort(std::begin(items),
std::end(items),
[](const auto& lhs, const auto& rhs) {
if (lhs.result == rhs.result) {
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs.r < rhs.r;
else
return lhs.r > rhs.r;
} else
return lhs.result > rhs.result;
});
auto middle =
std::find_if(std::begin(items),
std::end(items),
[](const auto& item) { return item.result == 0; });
for (std::size_t i = 0, e = items.size(); i != e; ++i) {
reduced_cost[i].value = items[i].r;
reduced_cost[i].id = items[i].variable;
reduced_cost[i].f = items[i].factor;
}
if (middle == std::end(items))
return items[0].result == 0 ? -1 : r_size;
return static_cast<int>(std::distance(std::begin(items), middle) - 1);
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
leaq 0xc(%rsp), %rax
movq %rdi, %r15
addq $0x48, %rdi
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, (%rax)
andq $0x0, 0xc(%rax)
movq %rax, %rsi
callq 0x4075de
leaq 0x50(%r15), %rcx
movq %rax, %r13
cmpq %rcx, %r13
je 0x422014
movslq %ebx, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x4075aa
movq (%r14), %rcx
movq (%r15), %rdx
movl %r12d, %eax
movq %rax, %rsi
shlq $0x5, %rsi
xorl %edi, %edi
cmpq %rdi, %rsi
je 0x421ee4
fldt (%rcx,%rdi)
fstpt (%rdx,%rdi)
vmovsd 0x10(%rcx,%rdi), %xmm0
vshufps $0xe1, %xmm0, %xmm0, %xmm0 # xmm0 = xmm0[1,0,2,3]
vmovlps %xmm0, 0x10(%rdx,%rdi)
andl $0x0, 0x18(%rdx,%rdi)
addq $0x20, %rdi
jmp 0x421ebd
movslq 0x24(%r13), %rdx
movq 0x18(%r15), %rcx
movq (%r14), %rsi
shlq $0x2, %rax
fldz
xorl %r8d, %r8d
leaq (%rcx,%rdx,4), %rdi
cmpq %r8, %rax
je 0x421f14
cmpl $0x0, (%rdi,%r8)
je 0x421f0e
fldt (%rsi,%r8,8)
faddp %st, %st(1)
addq $0x4, %r8
jmp 0x421efc
leaq (,%rdx,4), %rdi
movl 0x28(%r13), %r9d
leaq (%rdi,%r12,4), %r8
shlq $0x2, %r12
xorl %edi, %edi
addq %rcx, %r8
pushq $0x1
popq %r10
fldz
cmpq %r9, %r10
je 0x421f69
xorl %r11d, %r11d
fld %st(0)
cmpq %r11, %rax
je 0x421f55
cmpl $0x0, (%r8,%r11)
je 0x421f4f
fldt (%rsi,%r11,8)
faddp %st, %st(1)
addq $0x4, %r11
jmp 0x421f3d
fucomi %st(2), %st
fxch %st(2)
fcmovnbe %st(2), %st
fstp %st(2)
cmoval %r10d, %edi
incq %r10
addq %r12, %r8
jmp 0x421f33
imull %ebx, %edi
fstp %st(1)
fstp %st(0)
addl %edx, %edi
movq (%r15), %rdx
movslq %edi, %rsi
leaq (%rcx,%rsi,4), %rcx
xorl %esi, %esi
cmpq %rsi, %rax
je 0x421f97
xorl %edi, %edi
cmpl $0x0, (%rcx,%rsi)
setne %dil
movl %edi, 0x18(%rdx,%rsi,8)
addq $0x4, %rsi
jmp 0x421f7e
movq (%r15), %rdi
movq 0x8(%r15), %rsi
callq 0x42336b
movq (%r15), %rdi
movq 0x8(%r15), %rsi
callq 0x423ad3
movq 0x8(%r15), %rdx
movq (%r15), %rcx
movq (%r14), %rdi
movq %rdx, %rsi
subq %rcx, %rsi
sarq $0x5, %rsi
pushq $0x10
popq %r8
subq $0x1, %rsi
jb 0x421fee
fldt -0x10(%rcx,%r8)
fstpt -0x10(%rdi,%r8)
vmovsd (%rcx,%r8), %xmm0
vshufps $0xe1, %xmm0, %xmm0, %xmm0 # xmm0 = xmm0[1,0,2,3]
vmovlps %xmm0, (%rdi,%r8)
addq $0x20, %r8
jmp 0x421fc7
cmpq %rdx, %rax
je 0x421ffe
subq %rcx, %rax
shrq $0x5, %rax
decl %eax
jmp 0x422006
cmpl $0x1, 0x18(%rcx)
sbbl %eax, %eax
orl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x361c3(%rip), %rdi # 0x4581de
leaq 0x44d64(%rip), %rsi # 0x466d86
leaq 0x44b4f(%rip), %rdx # 0x466b78
leaq 0x363f6(%rip), %rcx # 0x458426
callq 0x2813f
nop
| /quesnel[P]baryonyx/lib/src/exhaustive-solver.hpp |
baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::select_variables(int, int, int) | int select_variables(const int r_size, int bkmin, int bkmax)
{
int sum = 0;
int best = -2;
for (int i = -1; i < r_size; ++i) {
if (bkmin <= sum && sum <= bkmax)
best = i;
if (best != -2 && i - 1 < r_size &&
stop_iterating<Mode>(R[i + 1].value))
break;
sum += R[i + 1].f;
}
return best;
} | movq 0x60(%rdi), %rdi
movslq %esi, %rsi
pushq $-0x2
popq %rax
xorl %r8d, %r8d
pushq $-0x1
popq %r9
fldz
cmpq %rsi, %r9
jge 0x42207b
cmpl %ecx, %r8d
movl %r9d, %r10d
cmovgl %eax, %r10d
cmpl %edx, %r8d
cmovgel %r10d, %eax
cmpl $-0x2, %eax
je 0x42206e
fldt (%rdi)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x42207b
addl 0x14(%rdi), %r8d
incq %r9
addq $0x20, %rdi
jmp 0x422049
fstp %st(0)
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::select_variables_101(int, int, int) | int select_variables_101(const int r_size, int bkmin, int bkmax)
{
int sum = 0;
int best = -2;
for (int i = -1; i < r_size; ++i) {
if (bkmin <= sum && sum <= bkmax)
best = i;
if (best != -2 && i - 1 < r_size &&
stop_iterating<Mode>(R[i + 1].value))
break;
sum += R[i + 1].f;
}
return best;
} | movq 0x60(%rdi), %rdi
movslq %esi, %rsi
pushq $-0x2
popq %rax
xorl %r8d, %r8d
pushq $-0x1
popq %r9
fldz
cmpq %rsi, %r9
jge 0x4220c3
cmpl %ecx, %r8d
movl %r9d, %r10d
cmovgl %eax, %r10d
cmpl %edx, %r8d
cmovgel %r10d, %eax
cmpl $-0x2, %eax
je 0x4220b6
fldt (%rdi)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x4220c3
addl 0x14(%rdi), %r8d
incq %r9
addq $0x20, %rdi
jmp 0x422091
fstp %st(0)
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::local_affect<baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*>(baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, long double, long double) | bool local_affect(Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = pi[k];
auto d = (kappa / (one - kappa)) + delta;
if (selected < 0) {
pi[k] += R[0].value / two;
logger::log(" selected: {}/{} ({})/2 = pi {}\n",
selected,
r_size,
R[0].value,
pi[k]);
for (int i = 0; i != r_size; ++i) {
auto var = it + R[i].id;
x.unset(var->column);
P[var->value] -= d;
auto repair = local_compute_reduced_cost(var->column, x);
if (repair <= 0)
P[var->value] = P[var->value] + repair - d;
}
} else if (selected + 1 >= r_size) {
pi[k] += R[selected].value * middle;
logger::log(" selected: {}/{} ({})/2 = pi {}\n",
selected,
r_size,
R[selected].value,
pi[k]);
for (int i = 0; i != r_size; ++i) {
auto var = it + R[i].id;
x.set(var->column);
P[var->value] += d;
auto repair = local_compute_reduced_cost(var->column, x);
if (repair >= 0)
P[var->value] = P[var->value] - repair + d;
}
} else {
pi[k] += ((R[selected].value + R[selected + 1].value) / two);
logger::log(" selected: {}/{} ({}x{})/2 = pi {}\n",
selected,
r_size,
R[selected].value,
R[selected + 1].value,
pi[k]);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + R[i].id;
x.set(var->column);
P[var->value] += d;
auto repair = local_compute_reduced_cost(var->column, x);
if (repair >= 0)
P[var->value] = P[var->value] - repair + d;
}
for (; i != r_size; ++i) {
auto var = it + R[i].id;
x.unset(var->column);
P[var->value] -= d;
auto repair = local_compute_reduced_cost(var->column, x);
if (repair <= 0)
P[var->value] = P[var->value] + repair - d;
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(*this, k, x));
return is_signbit_change(old_pi, pi[k]);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
fldt 0x90(%rsp)
fldt 0x80(%rsp)
movq 0x78(%rdi), %rax
movl %ecx, 0x1c(%rsp)
movslq %ecx, %rcx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
shlq $0x4, %rcx
fldt (%rax,%rcx)
addq %rcx, %rax
movq %rcx, 0x28(%rsp)
fld1
fsub %st(2), %st
fdivrp %st, %st(2)
fxch %st(1)
faddp %st, %st(2)
fxch %st(1)
fstpt 0xc(%rsp)
fld %st(0)
fstpt 0x3c(%rsp)
testl %r8d, %r8d
js 0x4221d6
movq 0x60(%rbx), %rcx
movl %r8d, %edx
shlq $0x5, %rdx
incl %r8d
fldt (%rcx,%rdx)
cmpl %r9d, %r8d
jge 0x422260
movl %r8d, %ebp
movq %rbp, 0x20(%rsp)
movl %r9d, 0x18(%rsp)
shlq $0x5, %rbp
xorl %r13d, %r13d
fldt (%rcx,%rbp)
faddp %st, %st(1)
fmuls 0x37973(%rip) # 0x459ad0
faddp %st, %st(1)
fstpt (%rax)
cmpq %r13, %rbp
je 0x4222e8
movq 0x60(%rbx), %rax
movq %r14, %rdi
movslq 0x10(%rax,%r13), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
movq %rbx, %rdi
movq %r14, %rdx
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0xc(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
movl 0x4(%r15,%r12,8), %esi
callq 0x423b60
fldz
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jb 0x4221ce
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
shlq $0x4, %rax
fldt (%rcx,%rax)
fsubp %st, %st(1)
fldt 0xc(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
fldz
fstp %st(0)
addq $0x20, %r13
jmp 0x422161
movq 0x60(%rbx), %rcx
movl %r9d, %r12d
shlq $0x5, %r12
xorl %ebp, %ebp
fldt (%rcx)
fmuls 0x378e5(%rip) # 0x459ad0
faddp %st, %st(1)
fstpt (%rax)
cmpq %rbp, %r12
je 0x422363
movq 0x60(%rbx), %rax
movq %r14, %rdi
movslq 0x10(%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
movq %rbx, %rdi
movq %r14, %rdx
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0xc(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
movl 0x4(%r15,%r13,8), %esi
callq 0x423b60
fldz
fucompi %st(1), %st
jb 0x422258
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
shlq $0x4, %rax
fldt (%rcx,%rax)
faddp %st, %st(1)
fldt 0xc(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
fldz
fstp %st(0)
addq $0x20, %rbp
jmp 0x4221ef
fmuls 0x39a62(%rip) # 0x45bcc8
movl %r9d, %r12d
shlq $0x5, %r12
faddp %st, %st(1)
xorl %ebp, %ebp
fstpt (%rax)
cmpq %rbp, %r12
je 0x422363
movq 0x60(%rbx), %rax
movq %r14, %rdi
movslq 0x10(%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x369c8
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
movq %rbx, %rdi
movq %r14, %rdx
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0xc(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
movl 0x4(%r15,%r13,8), %esi
callq 0x423b60
fldz
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jb 0x4222e0
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
shlq $0x4, %rax
fldt (%rcx,%rax)
fsubp %st, %st(1)
fldt 0xc(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
fldz
fstp %st(0)
addq $0x20, %rbp
jmp 0x422273
movl 0x18(%rsp), %r12d
orq $0x10, %rbp
subq 0x20(%rsp), %r12
subq $0x1, %r12
jb 0x422363
movq 0x60(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%rbp), %r13
movl 0x4(%r15,%r13,8), %esi
callq 0x36a06
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
movq %rbx, %rdi
movq %r14, %rdx
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0xc(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
movl 0x4(%r15,%r13,8), %esi
callq 0x423b60
fldz
fucompi %st(1), %st
jb 0x42235b
movslq (%r15,%r13,8), %rax
movq 0x50(%rbx), %rcx
shlq $0x4, %rax
fldt (%rcx,%rax)
faddp %st, %st(1)
fldt 0xc(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
fldz
fstp %st(0)
addq $0x20, %rbp
jmp 0x4222f6
movl 0x1c(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x420f3d
testb %al, %al
je 0x4223a5
movq 0x78(%rbx), %rax
movq 0x28(%rsp), %rcx
movzwl 0x8(%rax,%rcx), %ecx
fldt 0x3c(%rsp)
fstpt 0x30(%rsp)
movzwl 0x38(%rsp), %eax
xorl %ecx, %eax
shrl $0xf, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x35e32(%rip), %rdi # 0x4581de
leaq 0x380d1(%rip), %rsi # 0x45a484
leaq 0x44727(%rip), %rdx # 0x466ae1
leaq 0x44a33(%rip), %rcx # 0x466df4
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
void baryonyx::itm::random_shuffle_unique<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data*>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data*, baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::rc_data*, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&) | inline void
random_shuffle_unique(iteratorT begin,
iteratorT end,
random_engine& rng) noexcept
{
auto ret = begin++;
for (; begin != end; ++begin) {
if (ret->value != begin->value) {
std::shuffle(ret, begin, rng);
ret = begin;
}
}
std::shuffle(ret, begin, rng);
} | pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x20(%rdi), %r15
cmpq %r14, %r15
je 0x422401
fldt (%rdi)
fldt (%r15)
addq $0x20, %r15
fxch %st(1)
fucompi %st(1), %st
fstp %st(0)
jne 0x4223ed
jnp 0x4223d5
addq $-0x20, %r15
movq %r15, %rsi
movq %rbx, %rdx
callq 0x422982
movq %r15, %rdi
jmp 0x4223d1
movq %r15, %rsi
movq %rbx, %rdx
callq 0x422982
popq %rbx
popq %r14
popq %r15
retq
jmp 0x422414
movq %rax, %rdi
callq 0xeb9f
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
long double baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::local_compute_reduced_cost<baryonyx::bit_array>(int, baryonyx::bit_array const&) | Float local_compute_reduced_cost(int variable, const Xtype& x) noexcept
{
Float sum_a_pi_p = 0;
for (auto [ht, hte] = ap.column(variable); ht != hte; ++ht) {
auto a = std::abs(static_cast<Float>(A[ht->value]));
sum_a_pi_p += a * (pi[ht->row] + P[ht->value]);
}
return c(variable, x) - sum_a_pi_p;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
leaq 0x10(%rdi), %rsi
leaq 0x18(%rsp), %r15
movq %rdx, %rbx
movq %rdi, %r14
movl %ebp, %edx
movq %r15, %rdi
callq 0x3dede
movq (%r15), %rax
movq 0x8(%r15), %rcx
movq 0x50(%r14), %rdx
movq 0x58(%r14), %rsi
movq 0x78(%r14), %rdi
fldz
cmpq %rax, %rcx
je 0x423bd6
movslq (%rcx), %r8
movl (%rsi,%r8,4), %r9d
shlq $0x4, %r8
movl %r9d, 0x8(%rsp)
fildl 0x8(%rsp)
fabs
movslq 0x4(%rcx), %r9
addq $0x8, %rcx
shlq $0x4, %r9
fldt (%rdi,%r9)
fldt (%rdx,%r8)
faddp %st, %st(1)
fmulp %st, %st(1)
faddp %st, %st(1)
movq %rcx, 0x20(%rsp)
jmp 0x423b9a
movq 0x178(%r14), %rdi
movl %ebp, %esi
movq %rbx, %rdx
fstpt 0xc(%rsp)
callq 0x9c23c
fldt 0xc(%rsp)
fsubrp %st, %st(1)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::push_and_compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, long double, long double, long double, long double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float obj_amp)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value +=
obj_amp * c((std::get<0>(it) + R[i].id)->column, x);
Float pi_change;
int selected;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
default:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, 0x70(%rsp)
leaq 0x10(%rdi), %rax
leaq 0x60(%rdi), %rcx
movq %rsi, %r15
leaq 0x100(%rdi), %rsi
movq %rdi, %r12
xorl %r14d, %r14d
fldt 0x110(%rsp)
fstpt 0x9c(%rsp)
fldt 0x100(%rsp)
fstpt 0x90(%rsp)
fldt 0xf0(%rsp)
fstpt 0x84(%rsp)
fldt 0xe0(%rsp)
fstpt 0x78(%rsp)
movq %rax, 0x60(%rsp)
movq %rcx, 0x38(%rsp)
leaq 0x80(%rdi), %rcx
movq %rsi, 0x58(%rsp)
movq %rdx, 0x68(%rsp)
movq (%rdx), %rax
movq %rcx, 0x50(%rsp)
movq 0x70(%rsp), %rcx
cmpq (%rcx), %rax
je 0x425222
movl -0x4(%rax), %eax
movq 0x60(%rsp), %rsi
movq %r14, 0x28(%rsp)
leaq 0x40(%rsp), %rdi
movslq %eax, %r14
movl %eax, 0x34(%rsp)
movl %r14d, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x90(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x421a1c
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x421a42
movl %eax, %ebp
shlq $0x5, %rbp
movl %eax, %ebx
xorl %r13d, %r13d
cmpq %r13, %rbp
je 0x4250ad
movq 0x60(%r12), %rax
movq 0x48(%rsp), %rcx
movq 0x178(%r12), %rdi
movq %r15, %rdx
movslq 0x10(%rax,%r13), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x9c23c
movq 0x60(%r12), %rax
fldt (%rax,%r13)
fldt 0x9c(%rsp)
fmulp %st, %st(2)
faddp %st, %st(1)
fstpt (%rax,%r13)
addq $0x20, %r13
jmp 0x425067
movq 0x68(%r12), %rax
movslq %ebx, %rsi
movzbl (%rax,%r14), %eax
cmpq $0x3, %rax
ja 0x4251e7
leaq 0x41659(%rip), %rcx # 0x466724
movl 0x34(%rsp), %ebp
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r14, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x425146
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r14, %r14
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%r14), %edx
movl 0x4(%rax,%r14), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x4251a1
movq 0x70(%r12), %rax
movl (%rax,%r14), %ecx
movl 0x4(%rax,%r14), %r8d
movq 0x50(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl %ebx, %edx
callq 0x421b64
jmp 0x4251a1
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r14, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x4251a1
movq 0x58(%rsp), %rdi
movq 0x38(%rsp), %rdx
movl %ebp, %esi
movl %ebx, %ecx
callq 0x421e60
movq 0x28(%rsp), %r14
movq 0x48(%rsp), %rdx
fldt 0x84(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
movl %ebx, %r9d
fldt 0x78(%rsp)
fstpt (%rsp)
callq 0x4220c6
movq 0x68(%rsp), %rcx
orb %al, %r14b
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x424ffc
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %r14, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42207e
movq 0x28(%rsp), %r14
movl 0x34(%rsp), %ebp
jmp 0x4251a6
andb $0x1, %r14b
movl %r14d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, long double, long double, long double, long double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float obj_amp)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value +=
obj_amp * c((std::get<0>(it) + R[i].id)->column, x);
Float pi_change;
int selected;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
default:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, 0x70(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
fldt 0x110(%rsp)
fstpt 0x9c(%rsp)
fldt 0x100(%rsp)
fstpt 0x90(%rsp)
fldt 0xf0(%rsp)
fstpt 0x84(%rsp)
fldt 0xe0(%rsp)
fstpt 0x78(%rsp)
movq %rax, 0x68(%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x40(%rsp)
leaq 0x100(%rdi), %rax
movq %rax, 0x60(%rsp)
leaq 0x80(%rdi), %rax
movq %rax, 0x58(%rsp)
cmpq 0x70(%rsp), %r14
je 0x4254ea
movl (%r14), %eax
movq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdi
movq %r13, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movslq %eax, %rbp
movl %eax, 0x2c(%rsp)
movl %ebp, %edx
callq 0x3de66
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rsi
fldt 0x90(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x421a1c
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x421a42
movl %eax, %r13d
shlq $0x5, %r13
movl %eax, %ebx
xorl %r14d, %r14d
cmpq %r14, %r13
je 0x425370
movq 0x60(%r12), %rax
movq 0x50(%rsp), %rcx
movq 0x178(%r12), %rdi
movq %r15, %rdx
movslq 0x10(%rax,%r14), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x9c23c
movq 0x60(%r12), %rax
fldt (%rax,%r14)
fldt 0x9c(%rsp)
fmulp %st, %st(2)
faddp %st, %st(1)
fstpt (%rax,%r14)
addq $0x20, %r14
jmp 0x42532a
movq 0x68(%r12), %rax
movslq %ebx, %rsi
movzbl (%rax,%rbp), %eax
cmpq $0x3, %rax
ja 0x425476
leaq 0x413a7(%rip), %rcx # 0x466734
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x425408
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %r14
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%r14), %edx
movl 0x4(%rax,%r14), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x4254a6
movq 0x70(%r12), %rax
movl (%rax,%r14), %ecx
movl 0x4(%rax,%r14), %r8d
movq 0x58(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl %ebx, %edx
callq 0x421b64
jmp 0x4254a6
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x4254a6
movl 0x2c(%rsp), %ebp
movq 0x60(%rsp), %rdi
movq 0x40(%rsp), %rdx
movl %ebx, %ecx
movl %ebp, %esi
callq 0x421e60
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r13
jmp 0x4254b4
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42207e
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r13
movl 0x2c(%rsp), %ebp
movq 0x50(%rsp), %rdx
fldt 0x84(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
movl %ebx, %r9d
fldt 0x78(%rsp)
fstpt (%rsp)
callq 0x4220c6
orb %al, %r13b
addq $0x4, %r14
jmp 0x4252bd
andb $0x1, %r13b
movl %r13d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, long double, long double, long double, long double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float obj_amp)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value +=
obj_amp * c((std::get<0>(it) + R[i].id)->column, x);
Float pi_change;
int selected;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
default:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, 0x70(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
fldt 0x110(%rsp)
fstpt 0x9c(%rsp)
fldt 0x100(%rsp)
fstpt 0x90(%rsp)
fldt 0xf0(%rsp)
fstpt 0x84(%rsp)
fldt 0xe0(%rsp)
fstpt 0x78(%rsp)
movq %rax, 0x68(%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x40(%rsp)
leaq 0x100(%rdi), %rax
movq %rax, 0x60(%rsp)
leaq 0x80(%rdi), %rax
movq %rax, 0x58(%rsp)
cmpq 0x70(%rsp), %r14
je 0x4257b2
movl (%r14), %eax
movq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdi
movq %r13, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movslq %eax, %rbp
movl %eax, 0x2c(%rsp)
movl %ebp, %edx
callq 0x3de66
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rsi
fldt 0x90(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x421a1c
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x421a42
movl %eax, %r13d
shlq $0x5, %r13
movl %eax, %ebx
xorl %r14d, %r14d
cmpq %r14, %r13
je 0x425638
movq 0x60(%r12), %rax
movq 0x50(%rsp), %rcx
movq 0x178(%r12), %rdi
movq %r15, %rdx
movslq 0x10(%rax,%r14), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x9c23c
movq 0x60(%r12), %rax
fldt (%rax,%r14)
fldt 0x9c(%rsp)
fmulp %st, %st(2)
faddp %st, %st(1)
fstpt (%rax,%r14)
addq $0x20, %r14
jmp 0x4255f2
movq 0x68(%r12), %rax
movslq %ebx, %rsi
movzbl (%rax,%rbp), %eax
cmpq $0x3, %rax
ja 0x42573e
leaq 0x410ef(%rip), %rcx # 0x466744
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x4256d0
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %r14
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%r14), %edx
movl 0x4(%rax,%r14), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x42576e
movq 0x70(%r12), %rax
movl (%rax,%r14), %ecx
movl 0x4(%rax,%r14), %r8d
movq 0x58(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl %ebx, %edx
callq 0x421b64
jmp 0x42576e
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x42576e
movl 0x2c(%rsp), %ebp
movq 0x60(%rsp), %rdi
movq 0x40(%rsp), %rdx
movl %ebx, %ecx
movl %ebp, %esi
callq 0x421e60
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r13
jmp 0x42577c
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42207e
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r13
movl 0x2c(%rsp), %ebp
movq 0x50(%rsp), %rdx
fldt 0x84(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
movl %ebx, %r9d
fldt 0x78(%rsp)
fstpt (%rsp)
callq 0x4220c6
orb %al, %r13b
addq $0x8, %r14
jmp 0x425585
andb $0x1, %r13b
movl %r13d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>::push_and_compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, long double, long double, long double, long double) | bool push_and_compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta,
Float obj_amp)
{
auto at_least_one_pi_changed{ false };
logger::log("push-update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
// Before sort and select variables, we apply the push method: for
// each reduces cost, we had the cost multiply with an objective
// amplifier.
for (int i = 0; i != r_size; ++i)
R[i].value +=
obj_amp * c((std::get<0>(it) + R[i].id)->column, x);
Float pi_change;
int selected;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
default:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rcx, 0x70(%rsp)
leaq 0x10(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
fldt 0x110(%rsp)
fstpt 0x9c(%rsp)
fldt 0x100(%rsp)
fstpt 0x90(%rsp)
fldt 0xf0(%rsp)
fstpt 0x84(%rsp)
fldt 0xe0(%rsp)
fstpt 0x78(%rsp)
movq %rax, 0x68(%rsp)
leaq 0x60(%rdi), %rax
movq %rax, 0x40(%rsp)
leaq 0x100(%rdi), %rax
movq %rax, 0x60(%rsp)
leaq 0x80(%rdi), %rax
movq %rax, 0x58(%rsp)
cmpq 0x70(%rsp), %r14
je 0x425a7a
movl (%r14), %eax
movq 0x68(%rsp), %rsi
leaq 0x48(%rsp), %rdi
movq %r13, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movslq %eax, %rbp
movl %eax, 0x2c(%rsp)
movl %ebp, %edx
callq 0x3de66
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rsi
fldt 0x90(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x421a1c
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
callq 0x421a42
movl %eax, %r13d
shlq $0x5, %r13
movl %eax, %ebx
xorl %r14d, %r14d
cmpq %r14, %r13
je 0x425900
movq 0x60(%r12), %rax
movq 0x50(%rsp), %rcx
movq 0x178(%r12), %rdi
movq %r15, %rdx
movslq 0x10(%rax,%r14), %rax
movl 0x4(%rcx,%rax,8), %esi
callq 0x9c23c
movq 0x60(%r12), %rax
fldt (%rax,%r14)
fldt 0x9c(%rsp)
fmulp %st, %st(2)
faddp %st, %st(1)
fstpt (%rax,%r14)
addq $0x20, %r14
jmp 0x4258ba
movq 0x68(%r12), %rax
movslq %ebx, %rsi
movzbl (%rax,%rbp), %eax
cmpq $0x3, %rax
ja 0x425a06
leaq 0x40e37(%rip), %rcx # 0x466754
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x425998
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %r14
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%r14), %edx
movl 0x4(%rax,%r14), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x425a36
movq 0x70(%r12), %rax
movl (%rax,%r14), %ecx
movl 0x4(%rax,%r14), %r8d
movq 0x58(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl %ebx, %edx
callq 0x421b64
jmp 0x425a36
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x422036
cmpl $-0x2, %eax
jne 0x425a36
movl 0x2c(%rsp), %ebp
movq 0x60(%rsp), %rdi
movq 0x40(%rsp), %rdx
movl %ebx, %ecx
movl %ebp, %esi
callq 0x421e60
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r13
jmp 0x425a44
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x421b31
movq 0x70(%r12), %rax
imulq $0xc, %rbp, %rcx
movq %r12, %rdi
movl %ebx, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42207e
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r13
movl 0x2c(%rsp), %ebp
movq 0x50(%rsp), %rdx
fldt 0x84(%rsp)
fstpt 0x10(%rsp)
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %ecx
movl %eax, %r8d
movl %ebx, %r9d
fldt 0x78(%rsp)
fstpt (%rsp)
callq 0x4220c6
orb %al, %r13b
addq $0x4, %r14
jmp 0x42584d
andb $0x1, %r13b
movl %r13d, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::pnm_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x548, %rsp # imm = 0x548
vmovsd %xmm0, 0x88(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x60(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x70(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x108(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x98bf0
fldl 0x20(%r12)
fstpt 0xc8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xd4(%rsp)
fldl 0x30(%r12)
fstpt 0xbc(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x54(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x426f1c
movq 0x10(%r14), %rdi
leaq 0x108(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x98cca
fstpt 0xa0(%rsp)
jmp 0x426f35
fstp %st(0)
vmovsd %xmm0, 0xe8(%rsp)
fldl 0xe8(%rsp)
fstpt 0xa0(%rsp)
fldl 0x38(%r12)
fstpt 0xfc(%rsp)
fldl 0x40(%r12)
fstpt 0xf0(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x90(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x160(%rsp), %rdi
leaq 0x108(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x420330
movl 0xcc(%r12), %esi
leaq 0x128(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x9c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x2f0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x427017
cmpl $0x1, %eax
je 0x426ff1
cmpl $0x2, %eax
jne 0x427028
movq 0x18(%r14), %rdx
leaq 0x2f0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
jmp 0x427002
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
vmovsd 0x2d02e(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x96db2
jmp 0x427028
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x96d3f
leaq 0x70(%rsp), %r15
movq %r13, 0x80(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x427061
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x48(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x42705d
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x42703a
leaq 0x2f8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x2e0(%rsp), %ecx
movl 0x2e4(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x48(%rsp)
leaq 0x334de(%rip), %rdx # 0x45a577
leaq 0x2f0(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x42b5a
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x420736
vmovsd 0x48(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x70(%rsp), %r13
xorl %r15d, %r15d
vmovsd %xmm0, 0xe0(%rsp)
fldl 0xe0(%rsp)
fldt 0x54(%rsp)
cmpq 0xb0(%r12), %r15
je 0x42720a
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movq %r13, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x420778
movq 0x1b0(%rsp), %rdx
movq 0x1d8(%rsp), %rcx
movl %eax, %ebx
leaq 0x2f0(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x95274
testl %ebx, %ebx
je 0x4272be
cmpl %ebp, %ebx
jge 0x427182
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x4283de
movl %ebx, %ebp
cmpq 0x90(%rsp), %r15
jle 0x4271d3
movl %ebx, 0xb4(%rsp)
fildl 0xb4(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xb8(%rsp)
fidivl 0xb8(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x4271d7
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x42720a
fstp %st(0)
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x428416
fldt 0x48(%rsp)
fldt 0x54(%rsp)
testb %al, %al
jne 0x42720a
incq %r15
jmp 0x4270fb
fstp %st(0)
fstp %st(0)
movq 0x60(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x427238
movq 0x60(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x427269
movq 0x60(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x9c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x2f0(%rsp), %rdi
callq 0x42cbc
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x420c4c
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rax
addq $0x548, %rsp # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0x9706e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x428394
movl $0x0, 0x6c(%rsp)
leaq 0x160(%rsp), %r15
leaq 0x70(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x54(%rsp)
fldt 0x48(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x427221
movq 0x18(%r14), %rcx
fldt 0xfc(%rsp)
fld %st(1)
fstpt 0x48(%rsp)
fmulp %st, %st(1)
fldt 0xf0(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x4209a8
testl %eax, %eax
jne 0x427394
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x428394
movq %r14, %rdi
callq 0x428416
fldt 0x54(%rsp)
fldt 0x48(%rsp)
testb %al, %al
jne 0x427221
movl %ebx, 0x90(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x4274dd
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x420778
testl %eax, %eax
je 0x42748d
vcvtsi2sd %r13d, %xmm1, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x42745b
movl %eax, 0xac(%rsp)
fildl 0xac(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xb0(%rsp)
fidivl 0xb0(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x42745f
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x4274cd
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x428416
testb %al, %al
jne 0x4274d5
fldt 0x54(%rsp)
fldt 0x48(%rsp)
incl %ebx
jmp 0x4273b8
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull 0x6c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x428394
fldt 0x54(%rsp)
fldt 0x48(%rsp)
jmp 0x4274dd
fldt 0x54(%rsp)
fxch %st(1)
jmp 0x4274dd
fldt 0x54(%rsp)
fldt 0x48(%rsp)
movl 0x90(%rsp), %ebx
decl 0x6c(%rsp)
incl %ebx
jmp 0x427309
jmp 0x42752a
jmp 0x427503
fstp %st(1)
fstp %st(0)
jmp 0x42752a
movq %rax, %rbx
jmp 0x42753a
movq %rax, %rbx
jmp 0x427547
movq %rax, %rbx
jmp 0x427554
movq %rax, %rbx
jmp 0x427561
movq %rax, %rbx
jmp 0x42756b
jmp 0x42752a
jmp 0x42752a
jmp 0x42752a
leaq 0x2f8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x42753a
leaq 0x2f0(%rsp), %rdi
movq %rax, %rbx
callq 0x42cbc
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x420c4c
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::file_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::quadratic_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x548, %rsp # imm = 0x548
vmovsd %xmm0, 0x88(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x60(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x70(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0x108(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x98bf0
fldl 0x20(%r12)
fstpt 0xc8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xd4(%rsp)
fldl 0x30(%r12)
fstpt 0xbc(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x54(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x427664
movq 0x10(%r14), %rdi
leaq 0x108(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x98cca
fstpt 0xa0(%rsp)
jmp 0x42767d
fstp %st(0)
vmovsd %xmm0, 0xe8(%rsp)
fldl 0xe8(%rsp)
fstpt 0xa0(%rsp)
fldl 0x38(%r12)
fstpt 0xfc(%rsp)
fldl 0x40(%r12)
fstpt 0xf0(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x90(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x160(%rsp), %rdi
leaq 0x108(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x420330
movl 0xcc(%r12), %esi
leaq 0x128(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x9c(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x48(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0x2f0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x42775f
cmpl $0x1, %eax
je 0x427739
cmpl $0x2, %eax
jne 0x427770
movq 0x18(%r14), %rdx
leaq 0x2f0(%rsp), %rdi
leaq 0x70(%rsp), %rsi
jmp 0x42774a
movq 0x18(%r14), %rdx
leaq 0x70(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
vmovsd 0x2c8e6(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0x96db2
jmp 0x427770
leaq 0x70(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x96d3f
leaq 0x70(%rsp), %r15
movq %r13, 0x80(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x4277a9
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x48(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x4277a5
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x427782
leaq 0x2f8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
movl 0x2e0(%rsp), %ecx
movl 0x2e4(%rsp), %r8d
movq 0xb0(%r12), %r9
vmovsd %xmm0, 0x48(%rsp)
leaq 0x32d96(%rip), %rdx # 0x45a577
leaq 0x2f0(%rsp), %rdi
pushq $0x3
popq %rsi
callq 0x4346e
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x420736
vmovsd 0x48(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x70(%rsp), %r13
xorl %r15d, %r15d
vmovsd %xmm0, 0xe0(%rsp)
fldl 0xe0(%rsp)
fldt 0x54(%rsp)
cmpq 0xb0(%r12), %r15
je 0x427952
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movq %r13, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x420778
movq 0x1b0(%rsp), %rdx
movq 0x1d8(%rsp), %rcx
movl %eax, %ebx
leaq 0x2f0(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x95692
testl %ebx, %ebx
je 0x427a06
cmpl %ebp, %ebx
jge 0x4278ca
movq %r14, %rdi
movq %r13, %rsi
movl %ebx, %edx
movq %r15, %rcx
callq 0x4284c0
movl %ebx, %ebp
cmpq 0x90(%rsp), %r15
jle 0x42791b
movl %ebx, 0xb4(%rsp)
fildl 0xb4(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xb8(%rsp)
fidivl 0xb8(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x42791f
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x427952
fstp %st(0)
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x4284f8
fldt 0x48(%rsp)
fldt 0x54(%rsp)
testb %al, %al
jne 0x427952
incq %r15
jmp 0x427843
fstp %st(0)
fstp %st(0)
movq 0x60(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x427980
movq 0x60(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x4279b1
movq 0x60(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x9c(%rsp), %edx
movq %r14, %rdi
callq 0x35781
leaq 0x2f0(%rsp), %rdi
callq 0x435d0
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x420c4c
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rax
addq $0x548, %rsp # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x70(%rsp), %rbx
movq %rbx, %rsi
callq 0x9706e
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x428476
movl $0x0, 0x6c(%rsp)
leaq 0x160(%rsp), %r15
leaq 0x70(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x54(%rsp)
fldt 0x48(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x427969
movq 0x18(%r14), %rcx
fldt 0xfc(%rsp)
fld %st(1)
fstpt 0x48(%rsp)
fmulp %st, %st(1)
fldt 0xf0(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x4209a8
testl %eax, %eax
jne 0x427adc
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x428476
movq %r14, %rdi
callq 0x4284f8
fldt 0x54(%rsp)
fldt 0x48(%rsp)
testb %al, %al
jne 0x427969
movl %ebx, 0x90(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x427c25
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0xa0(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x48(%rsp)
fstpt (%rsp)
callq 0x420778
testl %eax, %eax
je 0x427bd5
vcvtsi2sd %r13d, %xmm1, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x427ba3
movl %eax, 0xac(%rsp)
fildl 0xac(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xb0(%rsp)
fidivl 0xb0(%rsp)
fldt 0xbc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xc8(%rsp)
fmulp %st, %st(1)
fldt 0x48(%rsp)
faddp %st, %st(1)
jmp 0x427ba7
fldt 0x48(%rsp)
fldt 0xd4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x427c15
movq %r14, %rdi
fstpt 0x48(%rsp)
callq 0x4284f8
testb %al, %al
jne 0x427c1d
fldt 0x54(%rsp)
fldt 0x48(%rsp)
incl %ebx
jmp 0x427b00
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbp, %rsi
callq 0x9706e
movl 0xc0(%r12), %eax
imull 0x6c(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x428476
fldt 0x54(%rsp)
fldt 0x48(%rsp)
jmp 0x427c25
fldt 0x54(%rsp)
fxch %st(1)
jmp 0x427c25
fldt 0x54(%rsp)
fldt 0x48(%rsp)
movl 0x90(%rsp), %ebx
decl 0x6c(%rsp)
incl %ebx
jmp 0x427a51
jmp 0x427c72
jmp 0x427c4b
fstp %st(1)
fstp %st(0)
jmp 0x427c72
movq %rax, %rbx
jmp 0x427c82
movq %rax, %rbx
jmp 0x427c8f
movq %rax, %rbx
jmp 0x427c9c
movq %rax, %rbx
jmp 0x427ca9
movq %rax, %rbx
jmp 0x427cb3
jmp 0x427c72
jmp 0x427c72
jmp 0x427c72
leaq 0x2f8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x427c82
leaq 0x2f0(%rsp), %rdi
movq %rax, %rbx
callq 0x435d0
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x420c4c
leaq 0x108(%rsp), %rdi
callq 0x968b6
leaq 0x78(%rsp), %rdi
callq 0x357fe
movq 0x60(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::pnm_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x4283dc
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x428456
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::pnm_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x31641(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long) | inline bool
is_better_solution(Float lhs, Float rhs) noexcept
{
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs < rhs;
else
return lhs > rhs;
} | vucomisd 0x30(%rdi), %xmm0
jbe 0x4284be
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x428538
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::file_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x3155f(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, false>, long double, baryonyx::itm::maximize_tag, baryonyx::itm::quadratic_cost_type<long double>, baryonyx::none_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x3147d(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
solve_problem(const context& ctx, const problem& pb)
{
if (ctx.start)
ctx.start(ctx.parameters);
result ret;
auto variables = length(pb.vars.values);
auto constraints{ make_merged_constraints(ctx, pb) };
if (!constraints.empty() && !pb.vars.values.empty()) {
random_engine rng(init_random_generator_seed(ctx));
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
switch (ctx.parameters.observer) {
case solver_parameters::observer_type::pnm: {
using obs = pnm_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
case solver_parameters::observer_type::file: {
using obs = file_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
default: {
using obs = none_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
break;
}
}
} else {
ret.status = result_status::success;
ret.solutions.resize(1);
ret.solutions.back().value = pb.objective.value;
}
ret.strings = pb.strings;
ret.variable_name = std::move(pb.vars.names);
ret.affected_vars = std::move(pb.affected_vars);
ret.variables = variables;
ret.constraints = length(constraints);
if (ctx.finish)
ctx.finish(ret);
return ret;
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x130, %rsp # imm = 0x130
cmpq $0x0, 0x128(%rsi)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
je 0x428cc8
leaq 0x118(%r14), %rdi
movq %r14, %rsi
callq 0x3527e
vxorps %xmm0, %xmm0, %xmm0
vmovups %zmm0, 0x58(%rbx)
vmovups %zmm0, 0x40(%rbx)
vmovups %zmm0, (%rbx)
movq $0x7fffffff, 0x98(%rbx) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rbx)
movq 0xb0(%r15), %rax
subq 0xa8(%r15), %rax
pushq $0xc
popq %rcx
cqto
idivq %rcx
movq %rax, %r12
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
vzeroupper
callq 0x450078
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x428df1
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x428df1
movq %r14, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
leaq 0x10(%r15), %rsi
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, (%rsp)
leaq 0x20(%rsp), %rdi
movl %r12d, %edx
callq 0x8adb0
vmovsd 0x40(%r15), %xmm0
movl 0xe4(%r14), %eax
vxorps %xmm1, %xmm1, %xmm1
leaq 0x30(%rsp), %rsi
cmpl $0x1, %eax
je 0x428e18
cmpl $0x2, %eax
jne 0x428e67
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x433318
jmp 0x428eb4
andl $0x0, 0xa0(%rbx)
leaq 0x68(%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x35292
vmovsd 0x40(%r15), %xmm0
movq 0x70(%rbx), %rax
vmovsd %xmm0, -0x8(%rax)
jmp 0x428ee3
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x432bd0
jmp 0x428eb4
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x433a60
leaq 0x88(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d9e
movq %r13, %rdi
callq 0xea60
leaq 0x58(%rsp), %rdi
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x8affa
leaq 0x90(%r15), %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31d28
leaq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x352ec
addq $0xc0, %r15
leaq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x352c2
movq 0x10(%rsp), %rax
movl %r12d, 0x90(%rbx)
subq 0x8(%rsp), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
movl %eax, 0x94(%rbx)
cmpq $0x0, 0x168(%r14)
je 0x428f4f
addq $0x158, %r14 # imm = 0x158
movq %r14, %rdi
movq %rbx, %rsi
callq 0x357ea
leaq 0x8(%rsp), %rdi
callq 0x35858
movq %rbx, %rax
addq $0x130, %rsp # imm = 0x130
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x428f71
jmp 0x428f71
leaq 0x58(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x8affa
jmp 0x428f94
jmp 0x428f91
movq %rax, %r14
jmp 0x428f9e
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x35858
movq %rbx, %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::result baryonyx::itm::optimize_problem<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
optimize_problem(const context& ctx, const problem& pb)
{
result r;
if (ctx.start)
ctx.start(ctx.parameters);
auto constraints{ make_merged_constraints(ctx, pb) };
if (constraints.empty() || pb.vars.values.empty()) {
r.status = result_status::success;
r.solutions.resize(1);
r.solutions.back().value = pb.objective.value;
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
return r;
}
random_engine rng(init_random_generator_seed(ctx));
auto variables = length(pb.vars.values);
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
const auto thread = get_thread_number(ctx);
std::vector<optimize_functor<Solver, Float, Mode, Cost>> functors;
std::vector<std::thread> pool(thread);
best_solution_recorder<Cost, Float, Mode> best_recorder(
rng,
thread,
cost,
cost_constant,
variables,
constraints,
ctx.parameters.init_population_size);
auto seeds = generate_seed(rng, thread);
std::atomic_bool stop_task;
stop_task.store(false);
for (unsigned i = 0u; i != thread; ++i)
functors.emplace_back(ctx, i, seeds[i]);
for (unsigned i = 0u; i != thread; ++i)
pool[i] = std::thread(std::ref(functors[i]),
std::ref(stop_task),
std::ref(best_recorder),
std::cref(constraints),
variables,
std::cref(cost),
cost_constant);
const auto start = std::chrono::steady_clock::now();
auto end = start;
do {
std::this_thread::sleep_for(std::chrono::seconds{ 1L });
if (ctx.update) {
auto call_number = 0L;
for (auto i = 0u; i != thread; ++i)
call_number += functors[i].m_call_number;
int constraints_remaining;
long int loop;
double value;
double duration;
best_recorder.get_best(
constraints_remaining, value, duration, loop);
ctx.update(
constraints_remaining, value, loop, duration, call_number);
}
end = std::chrono::steady_clock::now();
} while (!is_time_limit(ctx.parameters.time_limit, start, end));
stop_task.store(true);
for (auto& t : pool)
t.join();
r.strings = pb.strings;
r.affected_vars = pb.affected_vars;
r.variable_name = pb.vars.names;
r.variables = variables;
r.constraints = length(constraints);
const auto& first = best_recorder.get_best(0);
if (!first.is_solution())
r.status = result_status::time_limit_reached;
else
r.status = result_status::success;
r.duration = first.duration;
r.loop = first.loop;
r.remaining_constraints = first.remaining_constraints;
switch (ctx.parameters.storage) {
case solver_parameters::storage_type::one: {
r.solutions.resize(1);
convert(first, r.solutions[0], variables);
} break;
case solver_parameters::storage_type::bound: {
r.solutions.resize(2);
convert(first, r.solutions[0], variables);
convert(best_recorder.get_worst(), r.solutions[1], variables);
} break;
case solver_parameters::storage_type::five: {
r.solutions.resize(5);
for (int i = 0; i != 5; ++i)
convert(best_recorder.get_best(i), r.solutions[i], variables);
} break;
}
best_recorder.show_population(ctx);
if (ctx.finish)
ctx.finish(r);
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp # imm = 0x188
vxorpd %xmm0, %xmm0, %xmm0
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
cmpq $0x0, 0x128(%rsi)
je 0x429014
leaq 0x118(%r15), %rdi
movq %r15, %rsi
vzeroupper
callq 0x3527e
leaq 0x48(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
vzeroupper
callq 0x450078
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
je 0x429170
movq 0xa8(%r13), %rax
cmpq 0xb0(%r13), %rax
je 0x429170
movq %r15, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, 0x40(%rsp)
movq 0xb0(%r13), %rax
subq 0xa8(%r13), %rax
pushq $0xc
popq %rcx
cqto
leaq 0x10(%r13), %rsi
idivq %rcx
movl %eax, 0x4(%rsp)
leaq 0x60(%rsp), %rdi
movl %eax, %edx
movq %r12, 0x10(%rsp)
callq 0x8adb0
vmovsd 0x40(%r13), %xmm0
vmovsd %xmm0, 0x38(%rsp)
movq %r15, %rdi
callq 0x35447
andq $0x0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movl %eax, %ebp
vmovapd %xmm0, 0x70(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xc8(%rsp), %rdx
movq %rbp, %rsi
callq 0x35462
vmovsd 0x38(%rsp), %xmm0
movl 0xc4(%r15), %eax
movl 0x4(%rsp), %r8d
subq $0x8, %rsp
movl %ebp, %edx
leaq 0xd0(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rcx
leaq 0x50(%rsp), %r9
pushq %rax
callq 0xa17b4
popq %rax
popq %rcx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %ebp, %edx
callq 0x3551c
xorl %eax, %eax
movb %al, 0x3(%rsp)
xorl %ecx, %ecx
leaq 0x70(%rsp), %rbx
leaq 0x8(%rsp), %r14
xchgb %cl, 0x3(%rsp)
leaq 0x90(%r13), %rcx
movq %rcx, 0x98(%rsp)
movl %eax, 0x8(%rsp)
cmpl %ebp, %eax
je 0x4291cb
movl %eax, %ecx
shlq $0x3, %rcx
addq 0x30(%rsp), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4343e0
movl 0x8(%rsp), %eax
incl %eax
jmp 0x429147
andl $0x0, 0xa0(%r12)
leaq 0x68(%r12), %rdi
pushq $0x1
popq %rsi
callq 0x35292
vmovsd 0x40(%r13), %xmm0
movq 0x70(%r12), %rax
vmovsd %xmm0, -0x8(%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x31d28
leaq 0xc0(%r13), %rsi
leaq 0x20(%r12), %rdi
callq 0x352c2
addq $0x90, %r13
leaq 0x50(%r12), %rdi
movq %r13, %rsi
callq 0x352ec
jmp 0x429560
movq %r13, 0x90(%rsp)
movq %r15, %r13
leaq 0x8(%rsp), %r15
leaq 0xa8(%rsp), %r14
leaq 0x4(%rsp), %rbx
xorl %r12d, %r12d
cmpq %rbp, %r12
je 0x42928c
imulq $0xc0, %r12, %rax
addq 0x70(%rsp), %rax
leaq 0x3(%rsp), %r10
leaq 0xc8(%rsp), %r11
movq %r10, 0x20(%rsp)
leaq 0x48(%rsp), %r10
movq %r11, 0x18(%rsp)
movq %r10, 0xa8(%rsp)
movq %rax, 0x28(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x20(%rsp), %rdx
leaq 0x38(%rsp), %rax
movq %r15, %rdi
leaq 0x28(%rsp), %rsi
leaq 0x18(%rsp), %rcx
movq %r14, %r8
movq %rbx, %r9
pushq %rax
leaq 0xa8(%rsp), %rax
pushq %rax
callq 0x43442c
popq %rax
popq %rcx
leaq (,%r12,8), %rdi
addq 0xb0(%rsp), %rdi
movq %r15, %rsi
callq 0x356d6
movq %r15, %rdi
callq 0x356f0
incq %r12
jmp 0x4291eb
callq 0xb5a0
imulq $0xc0, %rbp, %r15
leaq 0x138(%r13), %r12
leaq 0x8(%rsp), %rbp
movq %rax, %rbx
movq $0x1, 0x8(%rsp)
movq %rbp, %rdi
callq 0x356fd
cmpq $0x0, 0x148(%r13)
je 0x429321
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
xorl %r14d, %r14d
cmpq %rcx, %r15
je 0x4292e2
addq 0xb0(%rax,%rcx), %r14
addq $0xc0, %rcx
jmp 0x4292cc
leaq 0xd0(%rsp), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x20(%rsp), %rcx
movq %rbp, %r8
callq 0xa90e8
vmovsd 0x28(%rsp), %xmm0
vmovsd 0x20(%rsp), %xmm1
movq 0x8(%rsp), %rdx
movl 0x18(%rsp), %esi
movq %r12, %rdi
movq %r14, %rcx
callq 0x35736
callq 0xb5a0
vmovsd (%r13), %xmm0
subq %rbx, %rax
vxorpd %xmm1, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
vcvtsi2sd %rax, %xmm2, %xmm1
vdivsd 0x3073c(%rip), %xmm1, %xmm1 # 0x459a80
jae 0x4292a7
vucomisd %xmm0, %xmm1
jbe 0x4292a7
movb $0x1, %al
xchgb %al, 0x3(%rsp)
movq 0xb0(%rsp), %rbx
movq 0xb8(%rsp), %r14
movq 0x10(%rsp), %r12
cmpq %r14, %rbx
je 0x429382
movq %rbx, %rdi
callq 0xb1a0
addq $0x8, %rbx
jmp 0x42936f
movq 0x90(%rsp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x31d28
addq $0xc0, %rbx
leaq 0x20(%r12), %rdi
movq %rbx, %rsi
callq 0x352c2
leaq 0x50(%r12), %rdi
movq 0x98(%rsp), %rsi
callq 0x352ec
movl 0x4(%rsp), %eax
movl %eax, 0x90(%r12)
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
pushq $0x28
popq %rcx
cqto
xorl %esi, %esi
idivq %rcx
movq 0x108(%rsp), %rdi
movq 0x120(%rsp), %rcx
movl %eax, 0x94(%r12)
movslq (%rdi), %rax
imulq $0x38, %rax, %rax
movl 0x30(%rcx,%rax), %edx
leaq (%rcx,%rax), %rbx
testl %edx, %edx
setne %sil
leal (%rsi,%rsi,2), %esi
movl %esi, 0xa0(%r12)
vmovsd 0x18(%rcx,%rax), %xmm0
vmovsd %xmm0, 0x80(%r12)
movq 0x28(%rcx,%rax), %rax
movq %rax, 0x88(%r12)
movl %edx, 0x98(%r12)
movl 0xe8(%r13), %eax
testl %eax, %eax
je 0x4294dd
cmpl $0x1, %eax
je 0x4294a5
cmpl $0x2, %eax
jne 0x4294fc
leaq 0x68(%r12), %rbx
pushq $0x5
popq %rsi
movq %rbx, %rdi
callq 0x35292
xorl %r14d, %r14d
xorl %r15d, %r15d
cmpq $0x5, %r15
je 0x4294fc
movq 0x108(%rsp), %rax
movq (%rbx), %rsi
movl 0x4(%rsp), %edx
movslq (%rax,%r15,4), %rax
addq %r14, %rsi
imulq $0x38, %rax, %rdi
addq 0x120(%rsp), %rdi
callq 0x4f485
incq %r15
addq $0x20, %r14
jmp 0x42946b
leaq 0x68(%r12), %r14
pushq $0x2
popq %rsi
movq %r14, %rdi
callq 0x35292
movl 0x4(%rsp), %edx
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x4f485
leaq 0xd0(%rsp), %rdi
callq 0xa9166
movq (%r14), %rsi
movq %rax, %rbx
addq $0x20, %rsi
jmp 0x4294f0
leaq 0x68(%r12), %r14
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0x35292
movq (%r14), %rsi
movl 0x4(%rsp), %edx
movq %rbx, %rdi
callq 0x4f485
leaq 0xc8(%rsp), %rdi
movq %r13, %rsi
callq 0xa1918
cmpq $0x0, 0x168(%r13)
je 0x429528
addq $0x158, %r13 # imm = 0x158
movq %r13, %rdi
movq %r12, %rsi
callq 0x357ea
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0xa192c
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x43b77c
leaq 0x68(%rsp), %rdi
callq 0x8affa
leaq 0x48(%rsp), %rdi
callq 0x35858
movq %r12, %rax
addq $0x188, %rsp # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4295c1
movq %rax, %rbx
jmp 0x4295ce
movq %rax, %rbx
jmp 0x4295db
jmp 0x4295a5
jmp 0x429596
jmp 0x4295b4
jmp 0x4295b4
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x4295f9
movq %r12, 0x10(%rsp)
movq %rax, %rbx
jmp 0x4295ef
jmp 0x4295b4
jmp 0x4295b4
jmp 0x4295b4
jmp 0x4295b4
jmp 0x4295b4
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x357fe
leaq 0xc8(%rsp), %rdi
callq 0xa192c
leaq 0xb0(%rsp), %rdi
callq 0x35836
leaq 0x70(%rsp), %rdi
callq 0x43b77c
leaq 0x68(%rsp), %rdi
callq 0x8affa
leaq 0x48(%rsp), %rdi
callq 0x35858
movq 0x10(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::result baryonyx::itm::solve_problem<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>(baryonyx::context const&, baryonyx::problem const&) | inline result
solve_problem(const context& ctx, const problem& pb)
{
if (ctx.start)
ctx.start(ctx.parameters);
result ret;
auto variables = length(pb.vars.values);
auto constraints{ make_merged_constraints(ctx, pb) };
if (!constraints.empty() && !pb.vars.values.empty()) {
random_engine rng(init_random_generator_seed(ctx));
auto cost = Cost(pb.objective, variables);
auto cost_constant = pb.objective.value;
switch (ctx.parameters.observer) {
case solver_parameters::observer_type::pnm: {
using obs = pnm_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
case solver_parameters::observer_type::file: {
using obs = file_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
} break;
default: {
using obs = none_observer;
solver_functor<Solver, Float, Mode, Cost, obs> slv(ctx, rng);
ret = slv(constraints, variables, cost, cost_constant);
break;
}
}
} else {
ret.status = result_status::success;
ret.solutions.resize(1);
ret.solutions.back().value = pb.objective.value;
}
ret.strings = pb.strings;
ret.variable_name = std::move(pb.vars.names);
ret.affected_vars = std::move(pb.affected_vars);
ret.variables = variables;
ret.constraints = length(constraints);
if (ctx.finish)
ctx.finish(ret);
return ret;
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x130, %rsp # imm = 0x130
cmpq $0x0, 0x128(%rsi)
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
je 0x42963d
leaq 0x118(%r14), %rdi
movq %r14, %rsi
callq 0x3527e
vxorps %xmm0, %xmm0, %xmm0
vmovups %zmm0, 0x58(%rbx)
vmovups %zmm0, 0x40(%rbx)
vmovups %zmm0, (%rbx)
movq $0x7fffffff, 0x98(%rbx) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rbx)
movq 0xb0(%r15), %rax
subq 0xa8(%r15), %rax
pushq $0xc
popq %rcx
cqto
idivq %rcx
movq %rax, %r12
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
vzeroupper
callq 0x450078
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x429766
movq 0xa8(%r15), %rax
cmpq 0xb0(%r15), %rax
je 0x429766
movq %r14, %rdi
callq 0x353ba
movl $0x7fffffff, %ecx # imm = 0x7FFFFFFF
xorl %edx, %edx
leaq 0x10(%r15), %rsi
divq %rcx
cmpq $0x1, %rdx
adcq $0x0, %rdx
movq %rdx, (%rsp)
leaq 0x20(%rsp), %rdi
movl %r12d, %edx
callq 0x8adb0
vmovsd 0x40(%r15), %xmm0
movl 0xe4(%r14), %eax
vxorps %xmm1, %xmm1, %xmm1
leaq 0x30(%rsp), %rsi
cmpl $0x1, %eax
je 0x42978d
cmpl $0x2, %eax
jne 0x4297dc
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x43beec
jmp 0x429829
andl $0x0, 0xa0(%rbx)
leaq 0x68(%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x35292
vmovsd 0x40(%r15), %xmm0
movq 0x70(%rbx), %rax
vmovsd %xmm0, -0x8(%rax)
jmp 0x429858
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x43b7a4
jmp 0x429829
movabsq $0x7ff0000000000000, %r9 # imm = 0x7FF0000000000000
vmovaps %xmm1, (%rsi)
movq %r14, 0x10(%rsi)
movq %rsp, %rax
movq %rax, 0x18(%rsi)
vmovaps %xmm1, 0x20(%rsi)
movq %r9, 0x30(%rsi)
andq $0x0, 0x48(%rsi)
vmovups %xmm1, 0x38(%rsi)
movl $0x7fffffff, 0x50(%rsi) # imm = 0x7FFFFFFF
leaq 0x88(%rsp), %rdi
leaq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %r8
movl %r12d, %ecx
callq 0x43c634
leaq 0x88(%rsp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x41d9e
movq %r13, %rdi
callq 0xea60
leaq 0x58(%rsp), %rdi
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x8affa
leaq 0x90(%r15), %r13
movq %rbx, %rdi
movq %r15, %rsi
callq 0x31d28
leaq 0x50(%rbx), %rdi
movq %r13, %rsi
callq 0x352ec
addq $0xc0, %r15
leaq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x352c2
movq 0x10(%rsp), %rax
movl %r12d, 0x90(%rbx)
subq 0x8(%rsp), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
movl %eax, 0x94(%rbx)
cmpq $0x0, 0x168(%r14)
je 0x4298c4
addq $0x158, %r14 # imm = 0x158
movq %r14, %rdi
movq %rbx, %rsi
callq 0x357ea
leaq 0x8(%rsp), %rdi
callq 0x35858
movq %rbx, %rax
addq $0x130, %rsp # imm = 0x130
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x4298e6
jmp 0x4298e6
leaq 0x58(%rsp), %rdi
movq %rax, %r14
callq 0x357fe
leaq 0x28(%rsp), %rdi
callq 0x8affa
jmp 0x429909
jmp 0x429906
movq %rax, %r14
jmp 0x429913
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x35858
movq %rbx, %rdi
callq 0xea60
movq %r14, %rdi
callq 0xb3d0
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::optimize_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>>::operator()(std::atomic<bool> const&, baryonyx::itm::best_solution_recorder<baryonyx::itm::default_cost_type<long double>, long double, baryonyx::itm::minimize_tag>&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double) | void operator()(const std::atomic_bool& stop_task,
best_solution_recorder<Cost, Float, Mode>& best_recorder,
const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
bit_array x(variables);
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_local_ctx.rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const auto w_limit = static_cast<long int>(p.w);
Solver slv(m_local_ctx.rng,
length(constraints),
variables,
norm_costs,
constraints);
compute_order compute(p.order, variables);
bool is_a_solution = false;
while (!stop_task.load()) {
++m_call_number;
const auto kappa_start = static_cast<Float>(best_recorder.reinit(
m_local_ctx, is_a_solution, p.kappa_min, p.kappa_max, x));
auto kappa = kappa_start;
compute.init(slv, x);
auto best_remaining = INT_MAX;
is_a_solution = false;
for (long int i = 0; !stop_task.load() && i != p.limit; ++i) {
auto remaining =
compute.run(slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
i);
best_remaining = 0;
is_a_solution = true;
break;
} else {
best_remaining = std::min(remaining, best_remaining);
}
if (i > w_limit)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
if (best_remaining > 0) {
best_recorder.try_advance(
m_local_ctx, x, best_remaining, p.limit);
continue;
}
for (int push = 0; !stop_task.load() && push < p.pushes_limit;
++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_local_ctx.rng,
pushing_k_factor,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
is_a_solution = true;
}
kappa = kappa_start;
for (int iter = 0;
!stop_task.load() && iter < p.pushing_iteration_limit;
++iter) {
remaining = compute.run(
slv, x, m_local_ctx.rng, kappa, delta, theta);
if (remaining == 0) {
best_recorder.try_update(
m_local_ctx,
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
is_a_solution = true;
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
}
}
}
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f8, %rsp # imm = 0x2F8
movq %rdi, %rbp
leaq 0x58(%rsp), %rdi
movq %rsi, %r15
movl %r8d, %esi
vmovsd %xmm0, 0x88(%rsp)
movq %r9, %r12
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x68(%rsp)
callq 0x368ae
movq (%rbp), %r13
movq %rbp, 0xb0(%rsp)
addq $0x8, %rbp
leaq 0xb8(%rsp), %rdi
movq %r13, %rsi
movq %r12, 0x80(%rsp)
movq %r12, %rdx
movq %rbp, %rcx
movl %ebx, %r8d
callq 0x8d226
fldl 0x20(%r13)
fstpt 0xe0(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r13)
fstpt 0xec(%rsp)
fldl 0x30(%r13)
fstpt 0xd4(%rsp)
fldl 0x8(%r13)
vmovsd 0x10(%r13), %xmm0
fld %st(0)
fstpt 0x44(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x429e05
movq 0xb0(%rsp), %rax
movq (%rax), %rdi
leaq 0xb8(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x94(%rsp)
jmp 0x429e1e
fstp %st(0)
vmovsd %xmm0, 0x108(%rsp)
fldl 0x108(%rsp)
fstpt 0x94(%rsp)
fldl 0x38(%r13)
fstpt 0x11c(%rsp)
fldl 0x40(%r13)
fstpt 0x110(%rsp)
vcvttsd2si 0xa0(%r13), %rax
movq %rax, 0xf8(%rsp)
movq 0x8(%r14), %rax
subq (%r14), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x160(%rsp), %rdi
leaq 0xb8(%rsp), %r8
movq %rbp, %rsi
movl %eax, %edx
movl %ebx, %ecx
movq %r14, %r9
callq 0x42a2ea
movl 0xcc(%r13), %esi
leaq 0x128(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq $0x0, 0x50(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x42a252
movq 0xb0(%rsp), %rax
incq 0xb0(%rax)
vmovsd 0x18(%r13), %xmm0
vmovsd 0x28(%r13), %xmm1
movzbl 0x50(%rsp), %edx
movq 0x68(%rsp), %rdi
leaq 0x58(%rsp), %rbx
movq %rbp, %rsi
movq %rbx, %rcx
andl $0x1, %edx
callq 0xa3d02
vmovsd %xmm0, 0x100(%rsp)
fldl 0x100(%rsp)
fstpt 0xc8(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movq %rbx, %rdx
callq 0x42a77a
fldt 0xc8(%rsp)
fldt 0x44(%rsp)
movl $0x7fffffff, %ebx # imm = 0x7FFFFFFF
xorl %r14d, %r14d
movb (%r15), %al
testb $0x1, %al
jne 0x429fe7
cmpq 0xb0(%r13), %r14
je 0x429fe7
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x58(%rsp), %rdx
movq %rbp, %rcx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x74(%rsp)
fstpt (%rsp)
callq 0x42a7bc
testl %eax, %eax
je 0x42a001
cmpl %eax, %ebx
cmovgel %eax, %ebx
cmpq 0xf8(%rsp), %r14
jle 0x429fc6
movl %eax, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xd4(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe0(%rsp)
fmulp %st, %st(1)
fldt 0x74(%rsp)
faddp %st, %st(1)
fldt 0x44(%rsp)
jmp 0x429fd0
fldt 0x44(%rsp)
fldt 0x74(%rsp)
fxch %st(1)
fldt 0xec(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x429fe7
incq %r14
jmp 0x429f17
fstp %st(1)
testl %ebx, %ebx
jg 0x42a230
movq $0x0, 0x50(%rsp)
leaq 0x58(%rsp), %rbx
jmp 0x42a03d
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x58(%rsp), %rbx
movq %rbx, %rsi
callq 0x8b74a
movq 0x68(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
movq %r14, %rcx
callq 0xa4074
movb $0x1, %al
movq %rax, 0x50(%rsp)
fldt 0x44(%rsp)
xorl %r14d, %r14d
movl $0x0, 0x70(%rsp)
movb (%r15), %al
testb $0x1, %al
jne 0x42a229
cmpl 0xbc(%r13), %r14d
jge 0x42a229
fldt 0x110(%rsp)
fstpt 0x30(%rsp)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movq %rbx, %rdx
movq %rbp, %rcx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fldt 0x11c(%rsp)
fstpt (%rsp)
callq 0x42a9ec
testl %eax, %eax
jne 0x42a0e3
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
movq %rbx, %rsi
callq 0x8b74a
movl 0xc0(%r13), %eax
movq 0x68(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
imull %r14d, %eax
notl %eax
movslq %eax, %rcx
callq 0xa4074
movb $0x1, %al
movq %rax, 0x50(%rsp)
pushq $0x1
popq %rax
fldt 0xc8(%rsp)
fldt 0x44(%rsp)
movl %eax, %ebx
movb (%r15), %al
testb $0x1, %al
jne 0x42a1c7
leal -0x1(%rbx), %r12d
cmpl 0xc0(%r13), %r12d
jge 0x42a1c7
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x58(%rsp), %rdx
movq %rbp, %rcx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x74(%rsp)
fstpt (%rsp)
callq 0x42a7bc
testl %eax, %eax
je 0x42a1d0
vcvtsi2sd %r12d, %xmm2, %xmm0
vucomisd 0xa0(%r13), %xmm0
jbe 0x42a1a7
movl %eax, 0xa0(%rsp)
fildl 0xa0(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xa4(%rsp)
fidivl 0xa4(%rsp)
fldt 0xd4(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe0(%rsp)
fmulp %st, %st(1)
fldt 0x74(%rsp)
faddp %st, %st(1)
fldt 0x44(%rsp)
jmp 0x42a1b1
fldt 0x44(%rsp)
fldt 0x74(%rsp)
fxch %st(1)
fldt 0xec(%rsp)
fxch %st(2)
fucomi %st(2), %st
fstp %st(2)
ja 0x42a1c7
incl %ebx
jmp 0x42a0f3
fstp %st(1)
leaq 0x58(%rsp), %rbx
jmp 0x42a21d
vmovsd 0x88(%rsp), %xmm0
movq 0x80(%rsp), %rdi
leaq 0x58(%rsp), %r12
movq %r12, %rsi
callq 0x8b74a
movl 0xc0(%r13), %eax
movq 0x68(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
imull 0x70(%rsp), %eax
subl %ebx, %eax
movq %r12, %rbx
movslq %eax, %rcx
callq 0xa4074
movb $0x1, %al
movq %rax, 0x50(%rsp)
fldt 0x44(%rsp)
decl 0x70(%rsp)
incl %r14d
jmp 0x42a048
fstp %st(0)
jmp 0x429e92
fstp %st(0)
movq 0xb0(%r13), %r8
movq 0x68(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %rbp, %rsi
movl %ebx, %ecx
callq 0xa40fc
jmp 0x429e89
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x42ac90
leaq 0xc0(%rsp), %rdi
callq 0x8affa
leaq 0x60(%rsp), %rdi
callq 0x357fe
addq $0x2f8, %rsp # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x42a29c
movq %rax, %rbx
jmp 0x42a2be
movq %rax, %rbx
jmp 0x42a2cb
movq %rax, %rbx
jmp 0x42a2d8
jmp 0x42a2ae
jmp 0x42a2ae
jmp 0x42a2ae
jmp 0x42a2ae
leaq 0x128(%rsp), %rdi
movq %rax, %rbx
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x42ac90
leaq 0xc0(%rsp), %rdi
callq 0x8affa
leaq 0x60(%rsp), %rdi
callq 0x357fe
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-optimizer-common.hpp |
baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::solver_inequalities_Zcoeff(std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, int, int, baryonyx::itm::default_cost_type<long double> const&, std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&) | solver_inequalities_Zcoeff(random_engine& rng_,
int m_,
int n_,
const cost_type& c_,
const std::vector<merged_constraint>& csts)
: logger("solver_inequalities_Zcoeff")
, rng(rng_)
, ap(csts, m_, n_)
, P(std::make_unique<Float[]>(ap.size()))
, A(std::make_unique<int[]>(ap.size()))
, R(std::make_unique<rc_data[]>(compute_reduced_costs_vector_size(csts)))
, Z(std::make_unique<subsolver_type[]>(m_))
, b(std::make_unique<bound_factor[]>(m_))
, pi(std::make_unique<Float[]>(m_))
, c(c_)
, m(m_)
, n(n_)
{
// Count the maximum function elements in the constraint where a least
// one coefficient is in Z. To be use with the branch-and-bound and
// exhaustive solvers.
std::size_t z_variables_max = 0;
// Count the maximum constraint number where at leat one coefficient is
// in Z. To be used with the exhaustive solver.
std::size_t z_constraint_exhaustive = 0;
int id = 0;
for (int i = 0, e = length(csts); i != e; ++i) {
int lower = 0, upper = 0;
std::size_t local_z_variables_max = 0;
Z[i] =
subsolver_type::linear; // Default, Z solver use the classical
// Bastert selection for 101 problem.
for (const auto& cst : csts[i].elements) {
bx_ensures(cst.factor);
A[id++] = cst.factor;
++local_z_variables_max;
if (cst.factor > 0)
upper += cst.factor;
else
lower += cst.factor;
if (cst.factor < -1 || cst.factor > 1) {
Z[i] = subsolver_type::branch_and_bound;
}
}
if (Z[i] == subsolver_type::branch_and_bound &&
local_z_variables_max < maximum_factor_exhaustive_solver)
Z[i] = subsolver_type::exhaustive;
if (csts[i].min == csts[i].max) {
b[i].min = csts[i].min;
b[i].max = csts[i].max;
} else {
if (lower >= csts[i].min || upper <= csts[i].max) {
if (Z[i] == subsolver_type::branch_and_bound)
Z[i] = subsolver_type::unconstrained_branch_and_bound;
else if (Z[i] == subsolver_type::exhaustive)
Z[i] = subsolver_type::unconstrained_exhaustive;
}
b[i].min = std::max(lower, csts[i].min);
b[i].max = std::min(upper, csts[i].max);
}
z_variables_max = std::max(z_variables_max, local_z_variables_max);
if (Z[i] == subsolver_type::exhaustive ||
Z[i] == subsolver_type::unconstrained_exhaustive) {
z_constraint_exhaustive++;
ex.build_constraints(i, csts[i].elements, b[i].min, b[i].max);
}
logger::log("Is Z: {} ({}) with {} <= {}\n",
static_cast<int>(Z[i]),
local_z_variables_max,
b[i].min,
b[i].max);
bx_ensures(b[i].min <= b[i].max);
}
if (z_constraint_exhaustive > 0)
ex.reserve(z_variables_max, z_constraint_exhaustive);
bb.reserve(z_variables_max);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, %r13d
leaq 0x3c7b6(%rip), %rdx # 0x466abb
movq %r9, %r12
movq %r8, %rbp
movl %ecx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
pushq $0x1a
popq %rsi
callq 0xb8418
movq %r15, 0x8(%rbx)
leaq 0x10(%rbx), %r15
movq %r15, %rdi
movq %r12, 0x18(%rsp)
movq %r12, %rsi
movl %r13d, %edx
movl %r14d, %ecx
movq %rbx, 0x50(%rsp)
callq 0x3a4ca
movl 0x38(%rbx), %esi
leaq 0x50(%rbx), %r12
movq %r12, %rdi
movq %r15, 0x78(%rsp)
callq 0x8afb9
movl 0x38(%rbx), %esi
leaq 0x58(%rbx), %rdi
movq %rdi, 0x58(%rsp)
movq %r12, 0x70(%rsp)
callq 0x28eb6
movq 0x18(%rsp), %rdi
leaq 0x60(%rbx), %r15
callq 0x3a89d
movq %r15, %rdi
movq %rax, %rsi
callq 0x42acf4
movslq %r13d, %r12
leaq 0x68(%rbx), %rdi
movq %r12, %rsi
movq %rdi, 0x20(%rsp)
movq %r15, 0x68(%rsp)
callq 0x42ad34
leaq 0x70(%rbx), %rdi
movq %r12, %rsi
movq %rdi, 0x8(%rsp)
callq 0x42ad63
leaq 0x78(%rbx), %rdi
movq %r12, %rsi
movq %rdi, 0x60(%rsp)
callq 0x8afb9
movq 0x18(%rsp), %rcx
vxorps %xmm0, %xmm0, %xmm0
leaq 0x80(%rbx), %rax
vmovups %xmm0, 0x8c(%rbx)
vmovaps %xmm0, 0x80(%rbx)
vxorps %xmm0, %xmm0, %xmm0
movq %rax, 0x40(%rsp)
orl $-0x1, 0x9c(%rbx)
leaq 0x150(%rbx), %rax
vmovups %ymm0, 0xa0(%rbx)
vmovups %ymm0, 0xb0(%rbx)
vxorps %xmm0, %xmm0, %xmm0
andl $0x0, 0x150(%rbx)
andq $0x0, 0x158(%rbx)
andq $0x0, 0x140(%rbx)
vmovups %zmm0, 0x100(%rbx)
movq %rax, 0x160(%rbx)
movq %rax, 0x168(%rbx)
andq $0x0, 0x170(%rbx)
movq %rbp, 0x178(%rbx)
movl %r13d, 0x180(%rbx)
movl %r14d, 0x184(%rbx)
movq 0x8(%rcx), %rax
subq (%rcx), %rax
pushq $0x28
popq %rcx
cqto
xorl %r12d, %r12d
xorl %ebp, %ebp
idivq %rcx
leaq 0x100(%rbx), %rcx
movq $0x0, 0x28(%rsp)
movq $0x0, 0x48(%rsp)
movq %rcx, 0x10(%rsp)
movl %eax, %eax
movq %rax, 0x80(%rsp)
cmpq 0x80(%rsp), %r12
je 0x42a660
movq 0x20(%rsp), %rax
andq $0x0, 0x30(%rsp)
imulq $0x28, %r12, %rsi
movslq %ebp, %rbp
xorl %r11d, %r11d
movq (%rax), %rcx
movq 0x18(%rsp), %rax
movb $0x4, (%rcx,%r12)
movq (%rax), %rax
leaq (%rax,%rsi), %rdx
movq (%rax,%rsi), %r8
movq 0x8(%rax,%rsi), %r9
movq 0x58(%rsp), %rax
movq (%rax), %r10
movb $0x4, %al
pushq $0x1
popq %r15
xorl %esi, %esi
xorl %edi, %edi
leaq (%r8,%r11), %rbx
cmpq %r9, %rbx
je 0x42a53d
movl -0x8(%r8,%r15,8), %ebx
testl %ebx, %ebx
je 0x42a6a1
movl %ebx, (%r10,%rbp,4)
movq %r15, 0x30(%rsp)
movl $0x0, %r14d
movl -0x8(%r8,%r15,8), %ebx
testl %ebx, %ebx
leal -0x2(%rbx), %r13d
cmovsl %ebx, %r14d
cmpl $-0x4, %r13d
ja 0x42a520
xorl %eax, %eax
movb $0x0, (%rcx,%r12)
movl %ebx, %r13d
sarl $0x1f, %r13d
addl %r14d, %edi
incq %r15
addq $0x8, %r11
incq %rbp
andnl %ebx, %r13d, %ebx
addl %ebx, %esi
jmp 0x42a4df
movq 0x30(%rsp), %r10
testb %al, %al
sete %r8b
cmpq $0xa, %r10
setb %r9b
testb %r9b, %r8b
je 0x42a55c
movb $0x1, %al
movb $0x1, (%rcx,%r12)
movl 0x18(%rdx), %r8d
movl 0x1c(%rdx), %r9d
movq 0x50(%rsp), %rbx
cmpl %r9d, %r8d
jne 0x42a583
movq 0x8(%rsp), %rcx
movq (%rcx), %r9
imulq $0xc, %r12, %rcx
movl %r8d, (%r9,%rcx)
movl %r8d, %ecx
jmp 0x42a5c9
cmpl %r8d, %edi
jge 0x42a58d
cmpl %r9d, %esi
jg 0x42a5a5
testb %al, %al
je 0x42a59f
movzbl %al, %r9d
cmpl $0x1, %r9d
jne 0x42a5a5
movb $0x3, %al
jmp 0x42a5a1
movb $0x2, %al
movb %al, (%rcx,%r12)
movq 0x8(%rsp), %r9
cmpl %r8d, %edi
movl %r8d, %ecx
cmovgl %edi, %ecx
imulq $0xc, %r12, %rdi
movq (%r9), %r9
movl %ecx, (%r9,%rdi)
movl 0x1c(%rdx), %edi
cmpl %esi, %edi
cmovll %edi, %esi
movl %esi, %r8d
movq 0x28(%rsp), %rsi
imulq $0xc, %r12, %r15
movzbl %al, %edi
movl %r8d, 0x4(%r9,%r15)
cmpq %r10, %rsi
cmovbeq %r10, %rsi
orl $0x2, %edi
movq %rsi, 0x28(%rsp)
cmpl $0x3, %edi
jne 0x42a617
movq 0x10(%rsp), %rdi
movl %r12d, %esi
vzeroupper
callq 0x42ada0
movq 0x20(%rsp), %rax
movq 0x8(%rsp), %rcx
incq 0x48(%rsp)
movq (%rax), %rax
movq (%rcx), %r9
movb (%rax,%r12), %al
leaq 0x4(%r9,%r15), %rsi
movsbl %al, %eax
addq %r15, %r9
movq %rbx, %rdi
movl %eax, 0x3c(%rsp)
movq %rsi, (%rsp)
pushq $0x1c
popq %rsi
leaq 0x3c519(%rip), %rdx # 0x466b50
leaq 0x3c(%rsp), %rcx
leaq 0x30(%rsp), %r8
vzeroupper
callq 0x36b838
movq 0x70(%rbx), %rax
movl (%rax,%r15), %ecx
cmpl 0x4(%rax,%r15), %ecx
jg 0x42a6c5
incq %r12
jmp 0x42a48d
movq 0x48(%rsp), %rdx
movq 0x28(%rsp), %rbx
testq %rdx, %rdx
je 0x42a67f
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
vzeroupper
callq 0x42afb4
movq 0x40(%rsp), %rdi
movq %rbx, %rsi
vzeroupper
callq 0x42b038
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2dd82(%rip), %rdi # 0x45842a
leaq 0x3c427(%rip), %rsi # 0x466ad6
leaq 0x3c42b(%rip), %rdx # 0x466ae1
leaq 0x3c48f(%rip), %rcx # 0x466b4c
vzeroupper
callq 0x2813f
leaq 0x2dd5e(%rip), %rdi # 0x45842a
leaq 0x2fbd6(%rip), %rsi # 0x45a2a9
leaq 0x3c407(%rip), %rdx # 0x466ae1
leaq 0x3c48c(%rip), %rcx # 0x466b6d
callq 0x2813f
movq %rax, %r14
jmp 0x42a72c
movq %rax, %r14
jmp 0x42a736
movq %rax, %r14
jmp 0x42a740
movq %rax, %r14
jmp 0x42a74a
movq %rax, %r14
jmp 0x42a754
movq %rax, %r14
jmp 0x42a75e
movq %rax, %r14
jmp 0x42a768
jmp 0x42a70b
movq 0x10(%rsp), %rdi
movq %rax, %r14
callq 0x42b062
movq 0x40(%rsp), %rdi
callq 0x42b08a
movq 0x60(%rsp), %rdi
callq 0x8affa
movq 0x8(%rsp), %rdi
callq 0x42b0aa
movq 0x20(%rsp), %rdi
callq 0x42b0c4
movq 0x68(%rsp), %rdi
callq 0x42b0de
movq 0x58(%rsp), %rdi
callq 0x28fb6
movq 0x70(%rsp), %rdi
callq 0x8affa
movq 0x78(%rsp), %rdi
callq 0x3a954
movq 0x50(%rsp), %rdi
callq 0xb853a
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
void baryonyx::itm::compute_order::init<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true> const&, baryonyx::bit_array const&) | void init(const Solver& s, const Xtype& x)
{
switch (order) {
case solver_parameters::constraint_order::infeasibility_decr:
case solver_parameters::constraint_order::infeasibility_incr:
infeasibility_local_compute_violated_constraints(s, x);
break;
case solver_parameters::constraint_order::pi_sign_change:
std::iota(R.begin(), R.end(), 0);
break;
case solver_parameters::constraint_order::none:
case solver_parameters::constraint_order::reversing:
case solver_parameters::constraint_order::random_sorting:
case solver_parameters::constraint_order::lagrangian_decr:
case solver_parameters::constraint_order::lagrangian_incr:
default:
compute_violated_constraints(s, x, R);
break;
}
} | movl 0x30(%rdi), %ecx
movq %rdi, %rax
leal -0x3(%rcx), %edi
cmpl $0x2, %edi
jae 0x42a790
movq %rax, %rdi
jmp 0x42b5cc
cmpl $0x7, %ecx
jne 0x42a7ad
movq (%rax), %rcx
movq 0x8(%rax), %rax
xorl %edx, %edx
cmpq %rax, %rcx
je 0x42a7bb
movl %edx, (%rcx)
incl %edx
addq $0x4, %rcx
jmp 0x42a79e
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
jmp 0x42b6ce
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::run<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double) | int run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta)
{
bool pi_changed = false;
int remaining = 0;
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.compute_update_row(
x, R.crbegin(), R.crend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.compute_update_row(
x, m_order.cbegin(), m_order.cend(), kappa, delta, theta);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.compute_update_row(
x, R.cbegin(), R.cend(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
fldt 0xb0(%rsp)
fldt 0xa0(%rsp)
fldt 0x90(%rsp)
movl 0x30(%rdi), %eax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
decl %eax
cmpl $0x6, %eax
ja 0x42a8dd
leaq 0x3bf6c(%rip), %rdx # 0x466764
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x68(%rsp), %rdx
leaq 0x60(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x42b7c4
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x42b6ce
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x4302ad
jmp 0x42a951
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x42f9d7
jmp 0x42a89c
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
fstpt 0x3c(%rsp)
callq 0x42fe42
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x42bcb2
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x42bf20
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(2)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x42a926
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x42ba44
jmp 0x42a97a
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %r15, %rdx
fstpt 0x3c(%rsp)
callq 0x430801
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x42c022
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x42b6ce
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x54(%rsp)
fstpt 0x48(%rsp)
movq %rcx, %rdx
fstpt 0x3c(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x3c(%rsp)
fstpt 0x20(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x48(%rsp)
fstpt 0x10(%rsp)
fldt 0x54(%rsp)
fstpt (%rsp)
callq 0x42ba44
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x42c290
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
int baryonyx::itm::compute_order::push_and_run<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array, long double>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>&, baryonyx::bit_array&, std::linear_congruential_engine<unsigned long, 16807ul, 0ul, 2147483647ul>&, long double, long double, long double, long double) | int push_and_run(Solver& solver,
Xtype& x,
random_engine& rng,
Float kappa,
Float delta,
Float theta,
Float objective_amplifier)
{
bool pi_changed = 0;
int remaining = 0;
if (use_cycle)
order = next_state(order);
switch (order) {
case solver_parameters::constraint_order::reversing:
solver.push_and_compute_update_row(x,
R.crbegin(),
R.crend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::random_sorting:
std::shuffle(R.begin(), R.end(), rng);
solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::infeasibility_decr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return rhs.second < lhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::infeasibility_incr:
std::sort(m_order.begin(),
m_order.end(),
[](const auto& lhs, const auto& rhs) {
return lhs.second < rhs.second;
});
solver.push_and_compute_update_row(x,
m_order.cbegin(),
m_order.cend(),
kappa,
delta,
theta,
objective_amplifier);
return infeasibility_local_compute_violated_constraints(solver, x);
case solver_parameters::constraint_order::lagrangian_decr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[rhs] < solver.pi[lhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::lagrangian_incr:
std::sort(
R.begin(), R.end(), [&solver](const auto lhs, const auto rhs) {
return solver.pi[lhs] < solver.pi[rhs];
});
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
case solver_parameters::constraint_order::pi_sign_change:
std::shuffle(R.begin(), R.end(), rng);
pi_changed = solver.push_and_compute_update_row(
x, R.begin(), R.end(), kappa, delta, theta, objective_amplifier);
remaining = local_compute_violated_constraints(solver, x);
if (!pi_changed && remaining == 0)
return 0;
return remaining;
case solver_parameters::constraint_order::none:
default:
solver.push_and_compute_update_row(x,
R.cbegin(),
R.cend(),
kappa,
delta,
theta,
objective_amplifier);
return compute_violated_constraints(solver, x, R);
}
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
fldt 0xd0(%rsp)
fldt 0xc0(%rsp)
fldt 0xb0(%rsp)
fldt 0xa0(%rsp)
movl 0x30(%rdi), %eax
cmpb $0x1, 0x34(%rdi)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
jne 0x42aa37
xorl %esi, %esi
leal 0x1(%rax), %edx
cmpl $0x7, %eax
cmovll %edx, %esi
movl %esi, %eax
movl %esi, 0x30(%r14)
decl %eax
cmpl $0x6, %eax
ja 0x42ab4e
leaq 0x3bd37(%rip), %rdx # 0x466780
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movq 0x8(%r14), %rax
leaq 0x78(%rsp), %rdx
leaq 0x70(%rsp), %rcx
movq %r15, %rdi
movq %rbx, %rsi
movq %rax, (%rdx)
movq (%r14), %rax
movq %rax, (%rcx)
fxch %st(3)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x430d52
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x42b6ce
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %r15, %rdx
fstpt 0x40(%rsp)
callq 0x432103
jmp 0x42abdb
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x43182d
jmp 0x42ab02
movq 0x18(%r14), %rdi
movq 0x20(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
fstpt 0x40(%rsp)
callq 0x431c98
movq 0x18(%r14), %rdx
movq 0x20(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x4312c6
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x42bf20
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fxch %st(3)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
fstpt 0x10(%rsp)
jmp 0x42abfe
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %rcx, %rdx
fstpt 0x40(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x431012
jmp 0x42ac0c
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %r15, %rdx
fstpt 0x40(%rsp)
callq 0x432657
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x43157a
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x42b6ce
movq (%r14), %rdi
movq 0x8(%r14), %rsi
fstpt 0x64(%rsp)
fstpt 0x58(%rsp)
fstpt 0x4c(%rsp)
movq %rcx, %rdx
fstpt 0x40(%rsp)
callq 0x3ceed
movq (%r14), %rdx
movq 0x8(%r14), %rcx
fldt 0x40(%rsp)
fstpt 0x30(%rsp)
movq %r15, %rdi
movq %rbx, %rsi
fldt 0x4c(%rsp)
fstpt 0x20(%rsp)
fldt 0x58(%rsp)
fstpt 0x10(%rsp)
fldt 0x64(%rsp)
fstpt (%rsp)
callq 0x431012
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x42c290
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
void baryonyx::itm::exhaustive_solver<baryonyx::itm::minimize_tag, long double>::build_constraints<std::vector<baryonyx::function_element, std::allocator<baryonyx::function_element>>>(int, std::vector<baryonyx::function_element, std::allocator<baryonyx::function_element>> const&, int, int) | void build_constraints(int k,
const C& constraint_elements,
int bk_min,
int bk_max)
{
const auto constraint_size = length(constraint_elements);
const auto start_it_flat_constraints = length(flat_constraints);
auto nb_solution = 0;
bx_ensures(k >= 0);
bx_ensures(constraint_size > 0);
walkers.resize(constraint_elements.size(), 0);
walkers.back() = 1;
bool end = false;
do {
auto i = length(walkers) - 1;
do {
int sum = 0;
for (int j = 0; j != constraint_size; ++j)
if (walkers[j])
sum += constraint_elements[j].factor;
if (bk_min <= sum && sum <= bk_max) {
++nb_solution;
for (int j = 0; j != constraint_size; ++j) {
flat_constraints.emplace_back(
walkers[j] ? constraint_elements[j].factor : 0);
}
}
++walkers[i];
if (walkers[i] > 1) {
walkers[i] = 0;
if (i == 0) {
end = true;
break;
} else {
--i;
}
} else {
break;
}
} while (!end);
} while (!end);
bx_expects(start_it_flat_constraints >= 0);
bx_expects(nb_solution > 0);
constraints.emplace(
k, start_it_flat_constraints, nb_solution, bk_min, bk_max);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, 0x24(%rsp)
movl %ecx, 0x20(%rsp)
movl %r8d, 0x1c(%rsp)
movl %ecx, 0x10(%rsp)
movl %esi, %eax
movl %r8d, 0x14(%rsp)
movq 0x20(%rdi), %rcx
movq 0x8(%rdx), %rsi
subq 0x18(%rdi), %rcx
subq (%rdx), %rsi
andl $0x0, 0x4(%rsp)
shrq $0x2, %rcx
movl %ecx, 0x18(%rsp)
testl %eax, %eax
js 0x42af30
movq %rsi, %rbp
shrq $0x3, %rbp
testl %ebp, %ebp
jle 0x42af51
leaq 0x30(%rdi), %r13
sarq $0x3, %rsi
movq %rdx, %r15
movq %rsp, %rdx
movq %rdi, %rbx
leaq 0x18(%rdi), %r12
movq %rcx, 0x30(%rsp)
movb $0x0, (%rdx)
movq %r13, %rdi
callq 0x36b9b6
movq 0x38(%rbx), %rax
andl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
movq $0x0, 0x8(%rsp)
movq %rbx, 0x28(%rsp)
movb $0x1, -0x1(%rax)
movq 0x30(%rbx), %rax
movl 0x38(%rbx), %ecx
subl %eax, %ecx
movslq %ecx, %r14
movq (%r13), %rax
movq (%r15), %rcx
xorl %esi, %esi
xorl %edx, %edx
cmpq %rsi, %rbp
je 0x42ae64
cmpb $0x0, (%rax,%rsi)
je 0x42ae5f
addl (%rcx,%rsi,8), %edx
incq %rsi
jmp 0x42ae51
cmpl 0x10(%rsp), %edx
setl %cl
cmpl 0x14(%rsp), %edx
setg %dl
orb %cl, %dl
jne 0x42aeb8
movq 0x8(%rsp), %rax
xorl %ebx, %ebx
incl %eax
movq %rax, 0x8(%rsp)
movl %eax, 0x4(%rsp)
cmpq %rbx, %rbp
je 0x42aeb4
movq (%r13), %rax
cmpb $0x0, (%rax,%rbx)
je 0x42ae9f
movq (%r15), %rax
movl (%rax,%rbx,8), %eax
jmp 0x42aea1
xorl %eax, %eax
movl %eax, (%rsp)
movq %r12, %rdi
movq %rsp, %rsi
callq 0x36b9e4
incq %rbx
jmp 0x42ae88
movq (%r13), %rax
decq %r14
incb (%rax,%r14)
movq (%r13), %rax
cmpb $0x2, (%rax,%r14)
jl 0x42aeda
movb $0x0, (%rax,%r14)
testq %r14, %r14
jne 0x42ae46
jmp 0x42aee4
movq 0x28(%rsp), %rbx
jmp 0x42ae3e
cmpl $0x0, 0x30(%rsp)
js 0x42af72
cmpl $0x0, 0x8(%rsp)
jle 0x42af93
movq 0x28(%rsp), %rdi
leaq 0x24(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x4(%rsp), %rcx
leaq 0x20(%rsp), %r8
leaq 0x1c(%rsp), %r9
addq $0x48, %rdi
callq 0x42b0f8
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2d4f3(%rip), %rdi # 0x45842a
leaq 0x3bc33(%rip), %rsi # 0x466b71
leaq 0x3bc33(%rip), %rdx # 0x466b78
leaq 0x2f148(%rip), %rcx # 0x45a094
callq 0x2813f
leaq 0x2d4d2(%rip), %rdi # 0x45842a
leaq 0x3bc7c(%rip), %rsi # 0x466bdb
leaq 0x3bc12(%rip), %rdx # 0x466b78
leaq 0x2e1ee(%rip), %rcx # 0x45915b
callq 0x2813f
leaq 0x2d265(%rip), %rdi # 0x4581de
leaq 0x3bc6f(%rip), %rsi # 0x466bef
leaq 0x3bbf1(%rip), %rdx # 0x466b78
leaq 0x3bc80(%rip), %rcx # 0x466c0e
callq 0x2813f
leaq 0x2d244(%rip), %rdi # 0x4581de
leaq 0x3bc71(%rip), %rsi # 0x466c12
leaq 0x3bbd0(%rip), %rdx # 0x466b78
leaq 0x3bc73(%rip), %rcx # 0x466c22
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/exhaustive-solver.hpp |
baryonyx::itm::exhaustive_solver<baryonyx::itm::minimize_tag, long double>::reserve(unsigned long, unsigned long) | void reserve(std::size_t max_variables, std::size_t max_z_constraints)
{
bx_assert(max_variables > 0);
bx_assert(max_z_constraints > 0);
items.reserve(max_variables);
flat_constraints.reserve(max_variables * max_z_constraints);
walkers.reserve(max_variables);
} | pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x42aff5
movq %rdx, %r15
testq %rdx, %rdx
je 0x42b016
movq %rsi, %rbx
movq %rdi, %r14
callq 0x42b2aa
imulq %rbx, %r15
leaq 0x18(%r14), %rdi
movq %r15, %rsi
callq 0x36bee8
addq $0x30, %r14
movq %rbx, %rsi
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x324c6
leaq 0x2e170(%rip), %rdi # 0x45916c
leaq 0x3bc3a(%rip), %rsi # 0x466c3d
leaq 0x3bb6e(%rip), %rdx # 0x466b78
leaq 0x339cf(%rip), %rcx # 0x45e9e0
callq 0x2813f
leaq 0x2e14f(%rip), %rdi # 0x45916c
leaq 0x3bc2b(%rip), %rsi # 0x466c4f
leaq 0x3bb4d(%rip), %rdx # 0x466b78
leaq 0x386d3(%rip), %rcx # 0x463705
callq 0x2813f
nop
| /quesnel[P]baryonyx/lib/src/exhaustive-solver.hpp |
int baryonyx::itm::compute_violated_constraints<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true> const&, baryonyx::bit_array const&, std::vector<int, std::allocator<int>>&) | int
compute_violated_constraints(const Solver& slv,
const Xtype& x,
std::vector<int>& out)
{
out.clear();
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
out.emplace_back(k);
return length(out);
} | pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rax, 0x8(%rdx)
je 0x42b6ec
movq %rax, 0x8(%rbx)
leaq 0x4(%rsp), %r12
xorl %esi, %esi
movl %esi, 0x4(%rsp)
cmpl 0x180(%r15), %esi
je 0x42b722
movq %r15, %rdi
movq %r14, %rdx
callq 0x42b739
testb %al, %al
jne 0x42b71a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x31460
movl 0x4(%rsp), %esi
incl %esi
jmp 0x42b6f3
movq 0x8(%rbx), %rax
subq (%rbx), %rax
shrq $0x2, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::is_valid_constraint<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true> const&, int, baryonyx::bit_array const&) | bool
is_valid_constraint(const Solver& slv, int k, const Xtype& x)
{
typename sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = slv.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += slv.factor(it->value) * x[it->column];
return slv.bound_min(k) <= v && v <= slv.bound_max(k);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movl %esi, %edx
leaq 0x10(%rdi), %rsi
leaq 0x8(%rsp), %r15
movq %rdi, %rbx
movl %edx, 0x4(%rsp)
movq %r15, %rdi
callq 0x3c868
movq (%r15), %r12
movq 0x8(%r15), %r13
xorl %r15d, %r15d
cmpq %r12, %r13
je 0x42b796
movslq (%r13), %rax
movq 0x58(%rbx), %rcx
movl 0x4(%r13), %esi
movq %r14, %rdi
movl (%rcx,%rax,4), %ebp
callq 0x3664a
imull %ebp, %eax
addq $0x8, %r13
addl %eax, %r15d
jmp 0x42b76e
movslq 0x4(%rsp), %rcx
movq 0x70(%rbx), %rax
imulq $0xc, %rcx, %rcx
cmpl %r15d, (%rax,%rcx)
jle 0x42b7ad
xorl %eax, %eax
jmp 0x42b7b5
cmpl 0x4(%rax,%rcx), %r15d
setle %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::compute_update_row<baryonyx::bit_array, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>>(baryonyx::bit_array&, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, 0x58(%rsp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
leaq 0x30b5a(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
leaq 0x60(%r12), %rcx
leaq 0x100(%r12), %rdx
movq %rbx, 0x50(%rsp)
xorl %ebp, %ebp
movq %rax, 0x48(%rsp)
movq (%rbx), %rax
movq %rcx, 0x20(%rsp)
leaq 0x80(%r12), %rcx
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x58(%rsp), %rcx
cmpq (%rcx), %rax
je 0x42ba2b
movl -0x4(%rax), %ebx
movq 0x48(%rsp), %rsi
leaq 0x38(%rsp), %rdi
movl %ebx, %edx
callq 0x3de66
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x42c2d2
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %r14
callq 0x42c2f8
movq 0x68(%r12), %rcx
movslq %ebx, %r15
movl %eax, %r13d
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x42b9ea
leaq 0x3aec4(%rip), %rcx # 0x46679c
movslq %r13d, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x42b989
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42c928
jmp 0x42b9e7
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x42c8e4
cmpl $-0x2, %eax
jne 0x42b9e7
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %r13d, %edx
callq 0x42c412
jmp 0x42b9e7
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42c8e4
cmpl $-0x2, %eax
jne 0x42b9e7
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %ebx, %esi
movl %r13d, %ecx
callq 0x42c70e
movl %eax, %r8d
movq 0x40(%rsp), %rdx
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq %r14, %r15
movq %r14, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
callq 0x42c96c
movq 0x50(%rsp), %rcx
orb %al, %bpl
movq (%rcx), %rax
addq $-0x4, %rax
movq %rax, (%rcx)
jmp 0x42b860
andb $0x1, %bpl
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int*, std::vector<int, std::allocator<int>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, 0x58(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x308da(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
movq %rax, 0x50(%rsp)
leaq 0x60(%r12), %rax
movq %rax, 0x20(%rsp)
leaq 0x100(%r12), %rax
movq %rax, 0x38(%rsp)
leaq 0x80(%r12), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
cmpq 0x58(%rsp), %r14
je 0x42bc9e
movl (%r14), %ebx
movq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl %eax, 0x2c(%rsp)
movl %ebx, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x42c2d2
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %rbp
callq 0x42c2f8
movq 0x68(%r12), %rcx
movslq %ebx, %r15
movl %eax, %r13d
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x42bc63
leaq 0x3ac5f(%rip), %rcx # 0x4667b0
movslq %r13d, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x42bc02
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42c928
jmp 0x42bc60
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x42c8e4
cmpl $-0x2, %eax
jne 0x42bc60
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %r13d, %edx
callq 0x42c412
jmp 0x42bc60
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42c8e4
cmpl $-0x2, %eax
jne 0x42bc60
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %ebx, %esi
movl %r13d, %ecx
callq 0x42c70e
movl %eax, %r8d
movq 0x48(%rsp), %rdx
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq %rbp, %r15
movq %rbp, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
callq 0x42c96c
movl 0x2c(%rsp), %ecx
addq $0x4, %r14
orb %al, %cl
movl %ecx, %eax
jmp 0x42bad8
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, __gnu_cxx::__normal_iterator<std::pair<int, int> const*, std::vector<std::pair<int, int>, std::allocator<std::pair<int, int>>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, 0x58(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x3066c(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
movq %rax, 0x50(%rsp)
leaq 0x60(%r12), %rax
movq %rax, 0x20(%rsp)
leaq 0x100(%r12), %rax
movq %rax, 0x38(%rsp)
leaq 0x80(%r12), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
cmpq 0x58(%rsp), %r14
je 0x42bf0c
movl (%r14), %ebx
movq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl %eax, 0x2c(%rsp)
movl %ebx, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x42c2d2
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %rbp
callq 0x42c2f8
movq 0x68(%r12), %rcx
movslq %ebx, %r15
movl %eax, %r13d
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x42bed1
leaq 0x3aa05(%rip), %rcx # 0x4667c4
movslq %r13d, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x42be70
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42c928
jmp 0x42bece
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x42c8e4
cmpl $-0x2, %eax
jne 0x42bece
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %r13d, %edx
callq 0x42c412
jmp 0x42bece
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42c8e4
cmpl $-0x2, %eax
jne 0x42bece
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %ebx, %esi
movl %r13d, %ecx
callq 0x42c70e
movl %eax, %r8d
movq 0x48(%rsp), %rdx
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq %rbp, %r15
movq %rbp, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
callq 0x42c96c
movl 0x2c(%rsp), %ecx
addq $0x8, %r14
orb %al, %cl
movl %ecx, %eax
jmp 0x42bd46
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::compute_order::infeasibility_local_compute_violated_constraints<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>&, baryonyx::bit_array const&) | int infeasibility_local_compute_violated_constraints(Solver& solver,
const Xtype& x)
{
m_order.clear();
for (int k = 0, e = solver.m; k != e; ++k) {
sparse_matrix<int>::const_row_iterator it, et;
std::tie(it, et) = solver.ap.row(k);
int v = 0;
for (; it != et; ++it)
v += solver.factor(it->value) * x[it->column];
if (solver.bound_min(k) > v)
m_order.push_back(std::make_pair(k, solver.bound_min(k) - v));
else if (solver.bound_max(k) < v)
m_order.push_back(std::make_pair(k, v - solver.bound_max(k)));
}
return length(m_order);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq 0x18(%rdi), %rax
movq %rdx, %r14
movq %rsi, %r15
cmpq %rax, 0x20(%rdi)
je 0x42bf42
movq %rax, 0x20(%rdi)
leaq 0x18(%rdi), %rax
leaq 0x10(%r15), %rcx
xorl %r12d, %r12d
movq %rdi, 0x20(%rsp)
movq %rax, 0x10(%rsp)
movl 0x180(%r15), %eax
movq %rcx, 0x18(%rsp)
movq %rax, 0x28(%rsp)
cmpq 0x28(%rsp), %r12
je 0x42c007
movq 0x18(%rsp), %rsi
movq %rsp, %rdi
movl %r12d, %edx
movq %r12, 0x30(%rsp)
callq 0x3de66
movq (%rsp), %r13
movq 0x8(%rsp), %r12
xorl %ebx, %ebx
cmpq %r13, %r12
je 0x42bfbb
movslq (%r12), %rax
movq 0x58(%r15), %rcx
movl 0x4(%r12), %esi
movq %r14, %rdi
movl (%rcx,%rax,4), %ebp
callq 0x3664a
imull %ebp, %eax
addq $0x8, %r12
addl %eax, %ebx
jmp 0x42bf93
movq 0x30(%rsp), %r12
movq 0x70(%r15), %rcx
imulq $0xc, %r12, %rdx
movl (%rcx,%rdx), %eax
subl %ebx, %eax
jle 0x42bfdc
shlq $0x20, %rax
orq %r12, %rax
movq %rax, (%rsp)
jmp 0x42bfed
subl 0x4(%rcx,%rdx), %ebx
jle 0x42bffa
shlq $0x20, %rbx
orq %r12, %rbx
movq %rbx, (%rsp)
movq 0x10(%rsp), %rdi
movq %rsp, %rsi
callq 0x3c8c2
movq 0x20(%rsp), %rdi
incq %r12
jmp 0x42bf68
movq 0x20(%rdi), %rax
subq 0x18(%rdi), %rax
shrq $0x3, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::compute_update_row<baryonyx::bit_array, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>>(baryonyx::bit_array&, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, __gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int>>>, long double, long double, long double) | bool compute_update_row(Xtype& x,
Iterator first,
Iterator last,
Float kappa,
Float delta,
Float theta)
{
auto at_least_one_pi_changed{ false };
logger::log("update-row {} {} {}\n", kappa, delta, theta);
for (; first != last; ++first) {
auto k = constraint(first);
const auto it = ap.row(k);
decrease_preference(std::get<0>(it), std::get<1>(it), theta);
const auto r_size =
compute_reduced_costs(std::get<0>(it), std::get<1>(it), x);
Float pi_change;
int selected = -2;
switch (Z[k]) {
case subsolver_type::branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::exhaustive:
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::unconstrained_branch_and_bound:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = bb.solve(R, r_size, b[k].min, b[k].max);
break;
case subsolver_type::unconstrained_exhaustive:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables(r_size, b[k].min, b[k].max);
if (selected == -2)
selected = ex.solve(k, R, r_size);
break;
case subsolver_type::linear:
calculator_sort<Mode>(R.get(), R.get() + r_size, rng);
selected = select_variables_101(r_size, b[k].min, b[k].max);
break;
}
pi_change = local_affect(
x, std::get<0>(it), k, selected, r_size, kappa, delta);
at_least_one_pi_changed = at_least_one_pi_changed || pi_change;
}
return at_least_one_pi_changed;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, 0x58(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x302fc(%rip), %rdx # 0x45c344
fldt 0xf0(%rsp)
fldt 0xe0(%rsp)
fldt 0xd0(%rsp)
fstpt 0x80(%rsp)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
pushq $0x14
popq %rsi
leaq 0x80(%rsp), %rcx
leaq 0x70(%rsp), %r8
leaq 0x60(%rsp), %r9
callq 0x126c32
leaq 0x10(%r12), %rax
movq %rax, 0x50(%rsp)
leaq 0x60(%r12), %rax
movq %rax, 0x20(%rsp)
leaq 0x100(%r12), %rax
movq %rax, 0x38(%rsp)
leaq 0x80(%r12), %rax
movq %rax, 0x30(%rsp)
xorl %eax, %eax
cmpq 0x58(%rsp), %r14
je 0x42c27c
movl (%r14), %ebx
movq 0x50(%rsp), %rsi
leaq 0x40(%rsp), %rdi
movl %eax, 0x2c(%rsp)
movl %ebx, %edx
callq 0x3de66
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
fldt 0x60(%rsp)
movq %r12, %rdi
fstpt (%rsp)
callq 0x42c2d2
movq 0x40(%rsp), %rdx
movq 0x48(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rcx
movq %r15, %rbp
callq 0x42c2f8
movq 0x68(%r12), %rcx
movslq %ebx, %r15
movl %eax, %r13d
movzbl (%rcx,%r15), %eax
pushq $-0x2
popq %r8
cmpq $0x4, %rax
ja 0x42c241
leaq 0x3a6a9(%rip), %rcx # 0x4667d8
movslq %r13d, %rsi
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rdx
movl (%rax,%rdx), %ecx
movl 0x4(%rax,%rdx), %r8d
jmp 0x42c1e0
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42c928
jmp 0x42c23e
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %r15
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%r15), %edx
movl 0x4(%rax,%r15), %ecx
callq 0x42c8e4
cmpl $-0x2, %eax
jne 0x42c23e
movq 0x70(%r12), %rax
movl (%rax,%r15), %ecx
movl 0x4(%rax,%r15), %r8d
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl %r13d, %edx
callq 0x42c412
jmp 0x42c23e
movq 0x60(%r12), %rdi
movq 0x8(%r12), %rdx
shlq $0x5, %rsi
addq %rdi, %rsi
callq 0x42c3df
movq 0x70(%r12), %rax
imulq $0xc, %r15, %rcx
movq %r12, %rdi
movl %r13d, %esi
movl (%rax,%rcx), %edx
movl 0x4(%rax,%rcx), %ecx
callq 0x42c8e4
cmpl $-0x2, %eax
jne 0x42c23e
movq 0x38(%rsp), %rdi
movq 0x20(%rsp), %rdx
movl %ebx, %esi
movl %r13d, %ecx
callq 0x42c70e
movl %eax, %r8d
movq 0x48(%rsp), %rdx
fldt 0x80(%rsp)
fldt 0x70(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
movq %r12, %rdi
movq %rbp, %r15
movq %rbp, %rsi
movl %ebx, %ecx
movl %r13d, %r9d
callq 0x42c96c
movl 0x2c(%rsp), %ecx
addq $0x4, %r14
orb %al, %cl
movl %ecx, %eax
jmp 0x42c0b6
andb $0x1, %al
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::compute_order::local_compute_violated_constraints<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>, baryonyx::bit_array>(baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true> const&, baryonyx::bit_array const&) | int local_compute_violated_constraints(const Solver& slv, const Xtype& x)
{
int remaining = 0;
for (int k = 0; k != slv.m; ++k)
if (!is_valid_constraint(slv, k, x))
++remaining;
return remaining;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl 0x180(%r14), %r15d
je 0x42c2c5
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
callq 0x42b739
xorb $0x1, %al
incl %r15d
movzbl %al, %eax
addl %eax, %ebp
jmp 0x42c2a2
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-common.hpp |
baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::decrease_preference(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, long double) | void decrease_preference(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
Float theta) noexcept
{
for (; begin != end; ++begin)
P[begin->value] *= theta;
} | fldt 0x8(%rsp)
movq 0x50(%rdi), %rax
cmpq %rdx, %rsi
je 0x42c2f4
movslq (%rsi), %rcx
addq $0x8, %rsi
shlq $0x4, %rcx
fldt (%rax,%rcx)
fmul %st(1), %st
fstpt (%rax,%rcx)
jmp 0x42c2da
fstp %st(0)
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::compute_reduced_costs<baryonyx::bit_array>(baryonyx::sparse_matrix<int>::row_value*, baryonyx::sparse_matrix<int>::row_value*, baryonyx::bit_array const&) | int compute_reduced_costs(sparse_matrix<int>::row_iterator begin,
sparse_matrix<int>::row_iterator end,
const Xtype& x) noexcept
{
// to_log(
// debug_os, " compute-reduced-cost {}\n", std::distance(begin,
// end));
int r_size = 0;
for (; begin != end; ++begin) {
Float sum_a_pi_p = 0;
for (auto [first, last] = ap.column(begin->column); first != last;
++first) {
auto a = std::abs(static_cast<Float>(A[first->value]));
sum_a_pi_p += a * (pi[first->row] + P[first->value]);
}
R[r_size].id = r_size;
R[r_size].f = A[begin->value];
R[r_size].value = c(begin->column, x) - sum_a_pi_p;
// to_log(debug_os,
// 4u,
// "Compute: {} = {} - {} - {}\n",
// r_size,
// c(begin->column, x),
// sum_pi,
// sum_p);
// to_log(debug_os, 4u, "{}x{}\n", R[r_size].f, R[r_size].value);
++r_size;
}
// to_log(debug_os, "\n");
return r_size;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x10(%rdi), %r13
leaq 0x8(%rsp), %rbp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
xorl %r15d, %r15d
cmpq %rbx, %r14
je 0x42c3cd
movl 0x4(%r14), %edx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3dede
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rdx
movq 0x50(%r12), %rsi
movq 0x58(%r12), %rax
movq 0x78(%r12), %rdi
fldz
cmpq %rcx, %rdx
je 0x42c38a
movslq (%rdx), %r8
movl (%rax,%r8,4), %r9d
shlq $0x4, %r8
movl %r9d, 0x4(%rsp)
fildl 0x4(%rsp)
fabs
movslq 0x4(%rdx), %r9
addq $0x8, %rdx
shlq $0x4, %r9
fldt (%rdi,%r9)
fldt (%rsi,%r8)
faddp %st, %st(1)
fmulp %st, %st(1)
faddp %st, %st(1)
movq %rdx, 0x10(%rsp)
jmp 0x42c34e
movq 0x60(%r12), %rcx
movq %r15, %rdx
shlq $0x5, %rdx
movl %r15d, 0x10(%rcx,%rdx)
incq %r15
movslq (%r14), %rsi
movl (%rax,%rsi,4), %eax
movl %eax, 0x14(%rcx,%rdx)
movq 0x178(%r12), %rax
movslq 0x4(%r14), %rsi
addq $0x8, %r14
movq 0x8(%rax), %rax
shlq $0x4, %rsi
fldt (%rax,%rsi)
fsubp %st, %st(1)
fstpt (%rcx,%rdx)
jmp 0x42c31b
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
int baryonyx::itm::branch_and_bound_solver<baryonyx::itm::minimize_tag, long double>::solve<std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data []>>>(std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data []>>&, int, int, int) | int solve(R& reduced_cost, int r_size, int bk_min, int bk_max)
{
bx_assert(r_size >= 4);
bx_assert(bk_min <= bk_max);
b_min = bk_min;
b_max = bk_max;
items.resize(r_size);
if (!subvector.init(r_size))
throw solver_failure(solver_error_tag::no_solver_available);
solution = subvector.emplace();
bx_assert(solution == 0u);
nodes.clear();
for (int i = 0; i != r_size; ++i) {
items[i].r = reduced_cost[i].value;
items[i].variable = reduced_cost[i].id;
items[i].original_factor = reduced_cost[i].f;
items[i].factor = std::abs(reduced_cost[i].f);
items[i].result = 0;
}
std::fill_n(
subvector.element_data(solution), subvector.element_size(), 0);
std::sort(std::begin(items), std::end(items));
for (std::size_t i = 0, e = items.size(); i != e; ++i) {
if (items[i].original_factor < 0) {
b_min += items[i].factor;
b_max += items[i].factor;
}
}
// Compute the inversion of the sum z
items.back().sum_z = items.back().r;
for (int i = length(items) - 2; i >= 0; --i)
items[i].sum_z = items[i + 1].sum_z + items[i].r;
if (b_max == b_min)
solve_equality();
else
solve_inequality();
for (int i = 0, e = length(items); i != e; ++i) {
if (items[i].original_factor > 0)
items[i].result = subvector[solution + i] == 0 ? 0 : 1;
else
items[i].result = subvector[solution + i] == 0 ? 1 : 0;
}
std::sort(std::begin(items),
std::end(items),
[](const auto& lhs, const auto& rhs) {
if (lhs.result == rhs.result) {
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs.r < rhs.r;
else
return lhs.r > rhs.r;
} else
return lhs.result > rhs.result;
});
auto middle =
std::find_if(std::begin(items),
std::end(items),
[](const auto& item) { return item.result == 0; });
for (std::size_t i = 0, e = items.size(); i != e; ++i) {
reduced_cost[i].value = items[i].r;
reduced_cost[i].id = items[i].variable;
reduced_cost[i].f = items[i].original_factor;
}
if (middle == std::end(items))
return items[0].result == 0 ? -1 : r_size;
return static_cast<int>(std::distance(std::begin(items), middle) - 1);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x3, %edx
jle 0x42c66c
cmpl %r8d, %ecx
jg 0x42c68d
leaq 0x20(%rdi), %r13
movl %ecx, 0x74(%rdi)
movl %edx, %ebx
movq %rsi, %r14
movl %edx, %r12d
movq %rdi, %r15
movl %r8d, 0x78(%rdi)
movq %r12, %rsi
movq %r13, %rdi
callq 0x42d432
movq %r15, %rdi
movl %ebx, %esi
callq 0x36e080
testb %al, %al
je 0x42c6cf
movq %r15, %rdi
callq 0x36e100
movl %eax, 0x70(%r15)
testl %eax, %eax
jne 0x42c6ae
movq 0x38(%r15), %rax
cmpq %rax, 0x40(%r15)
je 0x42c484
movq %rax, 0x40(%r15)
movq (%r14), %rax
movq (%r13), %rcx
imulq $0x30, %r12, %rdx
xorl %esi, %esi
addq $0x14, %rax
cmpq %rsi, %rdx
je 0x42c4cb
fldt -0x14(%rax)
fstpt (%rcx,%rsi)
movl -0x4(%rax), %edi
movl %edi, 0x28(%rcx,%rsi)
movl (%rax), %edi
movl %edi, %r8d
negl %r8d
movl %edi, 0x24(%rcx,%rsi)
cmovsl %edi, %r8d
addq $0x20, %rax
movl %r8d, 0x20(%rcx,%rsi)
andl $0x0, 0x2c(%rcx,%rsi)
addq $0x30, %rsi
jmp 0x42c495
movq %r15, %rdi
xorl %esi, %esi
callq 0x36e156
leaq 0x4(%rsp), %rdx
movl 0x18(%r15), %esi
movq %rax, %rdi
andl $0x0, (%rdx)
callq 0x36e561
movq 0x20(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0x42d79c
movq 0x28(%r15), %rdi
movq 0x20(%r15), %rcx
movq %rdi, %rax
subq %rcx, %rax
pushq $0x30
popq %r12
cqto
leaq 0x24(%rcx), %r8
idivq %r12
movl 0x74(%r15), %edx
movl 0x78(%r15), %esi
movq %rax, %r9
subq $0x1, %r9
jb 0x42c540
cmpl $0x0, (%r8)
jns 0x42c53a
movl -0x4(%r8), %r10d
addl %r10d, %edx
addl %r10d, %esi
movl %edx, 0x74(%r15)
movl %esi, 0x78(%r15)
addq $0x30, %r8
jmp 0x42c51c
fldt -0x30(%rdi)
fstpt -0x20(%rdi)
addl $-0x2, %eax
leaq 0x40(%rcx), %rdi
testl %eax, %eax
js 0x42c56b
movl %eax, %r8d
imulq $0x30, %r8, %r8
decl %eax
fldt (%rdi,%r8)
fldt (%rcx,%r8)
faddp %st, %st(1)
fstpt 0x10(%rcx,%r8)
jmp 0x42c54d
movl %ebx, (%rsp)
movq %r14, %rbx
movq %r15, %rdi
cmpl %edx, %esi
jne 0x42c57f
callq 0x42d46a
jmp 0x42c584
callq 0x42d52c
movq 0x20(%r15), %rcx
movq 0x28(%r15), %rax
xorl %ebp, %ebp
subq %rcx, %rax
cqto
idivq %r12
xorl %r12d, %r12d
movl %eax, %eax
imulq $0x30, %rax, %r13
cmpq %r12, %r13
je 0x42c5d9
cmpl $0x0, 0x24(%rcx,%r12)
movl 0x70(%r15), %esi
movq %r15, %rdi
setg %r14b
addl %ebp, %esi
callq 0x36e328
cmpb $0x0, (%rax)
movq 0x20(%r15), %rcx
sete %al
incl %ebp
xorb %r14b, %al
movzbl %al, %eax
movl %eax, 0x2c(%rcx,%r12)
addq $0x30, %r12
jmp 0x42c59f
movq 0x20(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0x42e718
movq 0x20(%r15), %rdi
movq 0x28(%r15), %rsi
callq 0x42eec8
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdi
movq %rax, %rcx
movq %rdi, %rax
subq %rsi, %rax
cqto
pushq $0x30
popq %r10
idivq %r10
movq (%rbx), %rdx
movl (%rsp), %r9d
movq %rsi, %r8
addq $0x10, %rdx
subq $0x1, %rax
jb 0x42c640
fldt (%r8)
fstpt -0x10(%rdx)
vmovsd 0x24(%r8), %xmm0
addq $0x30, %r8
vshufps $0xe1, %xmm0, %xmm0, %xmm0 # xmm0 = xmm0[1,0,2,3]
vmovlps %xmm0, (%rdx)
addq $0x20, %rdx
jmp 0x42c61b
cmpq %rdi, %rcx
je 0x42c654
subq %rsi, %rcx
movq %rcx, %rax
cqto
idivq %r10
decl %eax
jmp 0x42c65d
cmpl $0x1, 0x2c(%rsi)
sbbl %eax, %eax
orl %r9d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2caf9(%rip), %rdi # 0x45916c
leaq 0x3a5eb(%rip), %rsi # 0x466c65
leaq 0x3a5f0(%rip), %rdx # 0x466c71
leaq 0x3a652(%rip), %rcx # 0x466cda
callq 0x2813f
leaq 0x2cad8(%rip), %rdi # 0x45916c
leaq 0x3a643(%rip), %rsi # 0x466cde
leaq 0x3a5cf(%rip), %rdx # 0x466c71
leaq 0x3a646(%rip), %rcx # 0x466cef
callq 0x2813f
leaq 0x2cab7(%rip), %rdi # 0x45916c
leaq 0x3a637(%rip), %rsi # 0x466cf3
leaq 0x3a5ae(%rip), %rdx # 0x466c71
leaq 0x3a638(%rip), %rcx # 0x466d02
callq 0x2813f
pushq $0x18
popq %rdi
callq 0xb210
movq %rax, %rbx
pushq $0x1
popq %rsi
movq %rax, %rdi
callq 0x36e0d4
movq 0x2108d4(%rip), %rdx # 0x63cfc0
leaq 0x20dd1d(%rip), %rsi # 0x63a410
movq %rbx, %rdi
callq 0xb3c0
movq %rbx, %rdi
movq %rax, %r14
callq 0xb570
movq %r14, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/branch-and-bound-solver.hpp |
int baryonyx::itm::exhaustive_solver<baryonyx::itm::minimize_tag, long double>::solve<std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data []>>>(int, std::unique_ptr<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data [], std::default_delete<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::rc_data []>>&, int) | int solve(int k, R& reduced_cost, int r_size)
{
const auto it_constraint = constraints.find(k);
bx_expects(it_constraint != constraints.end());
items.resize(r_size);
for (int i = 0; i != r_size; ++i) {
items[i].r = reduced_cost[i].value;
items[i].variable = reduced_cost[i].id;
items[i].factor = reduced_cost[i].f;
items[i].result = 0;
}
Float z_best = 0;
auto best = 0;
auto start_solution = it_constraint->start;
for (int j = 0; j != r_size; ++j)
if (flat_constraints[start_solution + j])
z_best += reduced_cost[j].value;
for (auto i = 1; i != it_constraint->solutions; ++i) {
start_solution = it_constraint->start + (i * r_size);
Float z = 0;
for (int j = 0; j != r_size; ++j)
if (flat_constraints[start_solution + j])
z += reduced_cost[j].value;
if (is_best_solution(z, z_best)) {
z_best = z;
best = i;
}
}
start_solution = it_constraint->start + (best * r_size);
for (int i = 0; i != r_size; ++i)
items[i].result = flat_constraints[start_solution + i] ? 1 : 0;
std::sort(std::begin(items),
std::end(items),
[](const auto& lhs, const auto& rhs) {
if (lhs.result == rhs.result) {
if constexpr (std::is_same_v<Mode, minimize_tag>)
return lhs.r < rhs.r;
else
return lhs.r > rhs.r;
} else
return lhs.result > rhs.result;
});
auto middle =
std::find_if(std::begin(items),
std::end(items),
[](const auto& item) { return item.result == 0; });
for (std::size_t i = 0, e = items.size(); i != e; ++i) {
reduced_cost[i].value = items[i].r;
reduced_cost[i].id = items[i].variable;
reduced_cost[i].f = items[i].factor;
}
if (middle == std::end(items))
return items[0].result == 0 ? -1 : r_size;
return static_cast<int>(std::distance(std::begin(items), middle) - 1);
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
leaq 0xc(%rsp), %rax
movq %rdi, %r15
addq $0x48, %rdi
movl %ecx, %ebx
movq %rdx, %r14
movl %esi, (%rax)
andq $0x0, 0xc(%rax)
movq %rax, %rsi
callq 0x42efa0
leaq 0x50(%r15), %rcx
movq %rax, %r13
cmpq %rcx, %r13
je 0x42c8c2
movslq %ebx, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x42ef6c
movq (%r14), %rcx
movq (%r15), %rdx
movl %r12d, %eax
movq %rax, %rsi
shlq $0x5, %rsi
xorl %edi, %edi
cmpq %rdi, %rsi
je 0x42c792
fldt (%rcx,%rdi)
fstpt (%rdx,%rdi)
vmovsd 0x10(%rcx,%rdi), %xmm0
vshufps $0xe1, %xmm0, %xmm0, %xmm0 # xmm0 = xmm0[1,0,2,3]
vmovlps %xmm0, 0x10(%rdx,%rdi)
andl $0x0, 0x18(%rdx,%rdi)
addq $0x20, %rdi
jmp 0x42c76b
movslq 0x24(%r13), %rdx
movq 0x18(%r15), %rcx
movq (%r14), %rsi
shlq $0x2, %rax
fldz
xorl %r8d, %r8d
leaq (%rcx,%rdx,4), %rdi
cmpq %r8, %rax
je 0x42c7c2
cmpl $0x0, (%rdi,%r8)
je 0x42c7bc
fldt (%rsi,%r8,8)
faddp %st, %st(1)
addq $0x4, %r8
jmp 0x42c7aa
leaq (,%rdx,4), %rdi
movl 0x28(%r13), %r9d
leaq (%rdi,%r12,4), %r8
shlq $0x2, %r12
xorl %edi, %edi
addq %rcx, %r8
pushq $0x1
popq %r10
fldz
cmpq %r9, %r10
je 0x42c817
xorl %r11d, %r11d
fld %st(0)
cmpq %r11, %rax
je 0x42c803
cmpl $0x0, (%r8,%r11)
je 0x42c7fd
fldt (%rsi,%r11,8)
faddp %st, %st(1)
addq $0x4, %r11
jmp 0x42c7eb
fxch %st(2)
fucomi %st(2), %st
fcmovnbe %st(2), %st
fstp %st(2)
cmoval %r10d, %edi
incq %r10
addq %r12, %r8
jmp 0x42c7e1
imull %ebx, %edi
fstp %st(1)
fstp %st(0)
addl %edx, %edi
movq (%r15), %rdx
movslq %edi, %rsi
leaq (%rcx,%rsi,4), %rcx
xorl %esi, %esi
cmpq %rsi, %rax
je 0x42c845
xorl %edi, %edi
cmpl $0x0, (%rcx,%rsi)
setne %dil
movl %edi, 0x18(%rdx,%rsi,8)
addq $0x4, %rsi
jmp 0x42c82c
movq (%r15), %rdi
movq 0x8(%r15), %rsi
callq 0x42f157
movq (%r15), %rdi
movq 0x8(%r15), %rsi
callq 0x42f8b7
movq 0x8(%r15), %rdx
movq (%r15), %rcx
movq (%r14), %rdi
movq %rdx, %rsi
subq %rcx, %rsi
sarq $0x5, %rsi
pushq $0x10
popq %r8
subq $0x1, %rsi
jb 0x42c89c
fldt -0x10(%rcx,%r8)
fstpt -0x10(%rdi,%r8)
vmovsd (%rcx,%r8), %xmm0
vshufps $0xe1, %xmm0, %xmm0, %xmm0 # xmm0 = xmm0[1,0,2,3]
vmovlps %xmm0, (%rdi,%r8)
addq $0x20, %r8
jmp 0x42c875
cmpq %rdx, %rax
je 0x42c8ac
subq %rcx, %rax
shrq $0x5, %rax
decl %eax
jmp 0x42c8b4
cmpl $0x1, 0x18(%rcx)
sbbl %eax, %eax
orl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x2b915(%rip), %rdi # 0x4581de
leaq 0x3a4b6(%rip), %rsi # 0x466d86
leaq 0x3a2a1(%rip), %rdx # 0x466b78
leaq 0x2bb48(%rip), %rcx # 0x458426
callq 0x2813f
nop
| /quesnel[P]baryonyx/lib/src/exhaustive-solver.hpp |
baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::select_variables(int, int, int) | int select_variables(const int r_size, int bkmin, int bkmax)
{
int sum = 0;
int best = -2;
for (int i = -1; i < r_size; ++i) {
if (bkmin <= sum && sum <= bkmax)
best = i;
if (best != -2 && i - 1 < r_size &&
stop_iterating<Mode>(R[i + 1].value))
break;
sum += R[i + 1].f;
}
return best;
} | movq 0x60(%rdi), %rdi
movslq %esi, %rsi
pushq $-0x2
popq %rax
xorl %r8d, %r8d
pushq $-0x1
popq %r9
fldz
cmpq %rsi, %r9
jge 0x42c925
cmpl %ecx, %r8d
movl %r9d, %r10d
cmovgl %eax, %r10d
cmpl %edx, %r8d
cmovgel %r10d, %eax
cmpl $-0x2, %eax
je 0x42c918
fldt (%rdi)
fucompi %st(1), %st
ja 0x42c925
addl 0x14(%rdi), %r8d
incq %r9
addq $0x20, %rdi
jmp 0x42c8f7
fstp %st(0)
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::select_variables_101(int, int, int) | int select_variables_101(const int r_size, int bkmin, int bkmax)
{
int sum = 0;
int best = -2;
for (int i = -1; i < r_size; ++i) {
if (bkmin <= sum && sum <= bkmax)
best = i;
if (best != -2 && i - 1 < r_size &&
stop_iterating<Mode>(R[i + 1].value))
break;
sum += R[i + 1].f;
}
return best;
} | movq 0x60(%rdi), %rdi
movslq %esi, %rsi
pushq $-0x2
popq %rax
xorl %r8d, %r8d
pushq $-0x1
popq %r9
fldz
cmpq %rsi, %r9
jge 0x42c969
cmpl %ecx, %r8d
movl %r9d, %r10d
cmovgl %eax, %r10d
cmpl %edx, %r8d
cmovgel %r10d, %eax
cmpl $-0x2, %eax
je 0x42c95c
fldt (%rdi)
fucompi %st(1), %st
ja 0x42c969
addl 0x14(%rdi), %r8d
incq %r9
addq $0x20, %rdi
jmp 0x42c93b
fstp %st(0)
retq
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
bool baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, true>::local_affect<baryonyx::bit_array, baryonyx::sparse_matrix<int>::row_value*>(baryonyx::bit_array&, baryonyx::sparse_matrix<int>::row_value*, int, int, int, long double, long double) | bool local_affect(Xtype& x,
Iterator it,
int k,
int selected,
int r_size,
const Float kappa,
const Float delta)
{
constexpr Float one{ 1 };
constexpr Float two{ 2 };
constexpr Float middle{ (two + one) / two };
const auto old_pi = pi[k];
auto d = (kappa / (one - kappa)) + delta;
if (selected < 0) {
pi[k] += R[0].value / two;
logger::log(" selected: {}/{} ({})/2 = pi {}\n",
selected,
r_size,
R[0].value,
pi[k]);
for (int i = 0; i != r_size; ++i) {
auto var = it + R[i].id;
x.unset(var->column);
P[var->value] -= d;
auto repair = local_compute_reduced_cost(var->column, x);
if (repair <= 0)
P[var->value] = P[var->value] + repair - d;
}
} else if (selected + 1 >= r_size) {
pi[k] += R[selected].value * middle;
logger::log(" selected: {}/{} ({})/2 = pi {}\n",
selected,
r_size,
R[selected].value,
pi[k]);
for (int i = 0; i != r_size; ++i) {
auto var = it + R[i].id;
x.set(var->column);
P[var->value] += d;
auto repair = local_compute_reduced_cost(var->column, x);
if (repair >= 0)
P[var->value] = P[var->value] - repair + d;
}
} else {
pi[k] += ((R[selected].value + R[selected + 1].value) / two);
logger::log(" selected: {}/{} ({}x{})/2 = pi {}\n",
selected,
r_size,
R[selected].value,
R[selected + 1].value,
pi[k]);
int i = 0;
for (; i <= selected; ++i) {
auto var = it + R[i].id;
x.set(var->column);
P[var->value] += d;
auto repair = local_compute_reduced_cost(var->column, x);
if (repair >= 0)
P[var->value] = P[var->value] - repair + d;
}
for (; i != r_size; ++i) {
auto var = it + R[i].id;
x.unset(var->column);
P[var->value] -= d;
auto repair = local_compute_reduced_cost(var->column, x);
if (repair <= 0)
P[var->value] = P[var->value] + repair - d;
}
}
// TODO job: develops is_valid_constraint for all the solvers
bx_expects(is_valid_constraint(*this, k, x));
return is_signbit_change(old_pi, pi[k]);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
fldt 0x90(%rsp)
fldt 0x80(%rsp)
movl %r8d, 0x14(%rsp)
movl %r9d, 0x10(%rsp)
movq %rdx, %r15
movslq %ecx, %rdx
movl %ecx, 0x24(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movq 0x78(%rdi), %rcx
shlq $0x4, %rdx
fldt (%rcx,%rdx)
addq %rdx, %rcx
movq %rdx, 0x28(%rsp)
fld1
fsub %st(2), %st
fdivrp %st, %st(2)
fxch %st(1)
faddp %st, %st(2)
fxch %st(1)
fstpt 0x18(%rsp)
fld %st(0)
fstpt 0x3c(%rsp)
testl %r8d, %r8d
js 0x42cb6d
movq 0x60(%rbx), %rdx
movl %r8d, %esi
shlq $0x5, %rsi
movl %r9d, %eax
incl %r8d
fldt (%rdx,%rsi)
leaq (%rdx,%rsi), %r9
cmpl %eax, %r8d
jge 0x42cc1b
movl %r8d, %eax
shlq $0x5, %rax
fldt (%rdx,%rax)
faddp %st, %st(1)
fmuls 0x2d0c9(%rip) # 0x459ad0
leaq (%rdx,%rax), %rsi
faddp %st, %st(1)
fstpt (%rcx)
movq %rcx, 0x8(%rsp)
leaq 0x3a3b2(%rip), %rdx # 0x466dcd
movq %rsi, (%rsp)
pushq $0x26
popq %rsi
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %rbx, %rdi
callq 0x408058
pushq $0x10
popq %r13
xorl %ebp, %ebp
movslq 0x14(%rsp), %rax
cmpq %rax, %rbp
jg 0x42cb1e
movq 0x60(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%r13), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
movq %rbx, %rdi
movq %r14, %rdx
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0x18(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
movl 0x4(%r15,%r12,8), %esi
callq 0x42f944
fldz
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jb 0x42caab
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
shlq $0x4, %rax
fldt (%rcx,%rax)
fsubp %st, %st(1)
fldt 0x18(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
fldz
fstp %st(0)
incq %rbp
addq $0x20, %r13
jmp 0x42ca3a
movq 0x60(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%r13), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x36a06
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
movq %rbx, %rdi
movq %r14, %rdx
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0x18(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
movl 0x4(%r15,%r12,8), %esi
callq 0x42f944
fldz
fucompi %st(1), %st
jb 0x42cb15
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
shlq $0x4, %rax
fldt (%rcx,%rax)
faddp %st, %st(1)
fldt 0x18(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
fldz
fstp %st(0)
incq %rbp
addq $0x20, %r13
movl 0x10(%rsp), %eax
cmpq %rax, %rbp
jne 0x42cab6
movl 0x24(%rsp), %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x42b739
testb %al, %al
je 0x42ccc6
movq 0x78(%rbx), %rax
movq 0x28(%rsp), %rcx
movzwl 0x8(%rax,%rcx), %ecx
fldt 0x3c(%rsp)
fstpt 0x30(%rsp)
movzwl 0x38(%rsp), %eax
xorl %ecx, %eax
shrl $0xf, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x60(%rbx), %r9
leaq 0x3a231(%rip), %rdx # 0x466da9
fldt (%r9)
fmuls 0x2cf4f(%rip) # 0x459ad0
faddp %st, %st(1)
fstpt (%rcx)
movq %rcx, (%rsp)
pushq $0x23
popq %rsi
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %rbx, %rdi
callq 0x407f8a
pushq $0x10
popq %r13
xorl %ebp, %ebp
movl 0x10(%rsp), %eax
cmpq %rax, %rbp
je 0x42cb27
movq 0x60(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%r13), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x36a06
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
movq %rbx, %rdi
movq %r14, %rdx
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0x18(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
movl 0x4(%r15,%r12,8), %esi
callq 0x42f944
fldz
fucompi %st(1), %st
jb 0x42cc10
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
shlq $0x4, %rax
fldt (%rcx,%rax)
faddp %st, %st(1)
fldt 0x18(%rsp)
fsubrp %st, %st(1)
fstpt (%rcx,%rax)
fldz
fstp %st(0)
incq %rbp
addq $0x20, %r13
jmp 0x42cba4
fmuls 0x2f0a7(%rip) # 0x45bcc8
faddp %st, %st(1)
fstpt (%rcx)
movq %rcx, (%rsp)
leaq 0x3a179(%rip), %rdx # 0x466da9
pushq $0x23
popq %rsi
leaq 0x14(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %rbx, %rdi
callq 0x407f8a
pushq $0x10
popq %r13
xorl %ebp, %ebp
movl 0x10(%rsp), %eax
cmpq %rax, %rbp
je 0x42cb27
movq 0x60(%rbx), %rax
movq %r14, %rdi
movslq (%rax,%r13), %r12
movl 0x4(%r15,%r12,8), %esi
callq 0x369c8
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
movq %rbx, %rdi
movq %r14, %rdx
shlq $0x4, %rax
fldt (%rcx,%rax)
fldt 0x18(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
movl 0x4(%r15,%r12,8), %esi
callq 0x42f944
fldz
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
jb 0x42ccbb
movslq (%r15,%r12,8), %rax
movq 0x50(%rbx), %rcx
shlq $0x4, %rax
fldt (%rcx,%rax)
fsubp %st, %st(1)
fldt 0x18(%rsp)
faddp %st, %st(1)
fstpt (%rcx,%rax)
fldz
fstp %st(0)
incq %rbp
addq $0x20, %r13
jmp 0x42cc4b
leaq 0x2b511(%rip), %rdi # 0x4581de
leaq 0x2d7b0(%rip), %rsi # 0x45a484
leaq 0x39e06(%rip), %rdx # 0x466ae1
leaq 0x3a112(%rip), %rcx # 0x466df4
callq 0x2813f
| /quesnel[P]baryonyx/lib/src/itm-solver-inequalities-Z.cpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::operator()(std::vector<baryonyx::itm::merged_constraint, std::allocator<baryonyx::itm::merged_constraint>> const&, int, baryonyx::itm::default_cost_type<long double> const&, double) | result operator()(const std::vector<merged_constraint>& constraints,
int variables,
const Cost& original_costs,
double cost_constant)
{
result r;
bit_array x(variables);
int best_remaining = INT_MAX;
auto& p = m_ctx.parameters;
auto norm_costs = normalize_costs<Float, Cost>(
m_ctx, original_costs, m_rng, variables);
const auto kappa_step = static_cast<Float>(p.kappa_step);
const auto kappa_max = static_cast<Float>(p.kappa_max);
const auto alpha = static_cast<Float>(p.alpha);
const auto theta = static_cast<Float>(p.theta);
const auto delta =
p.delta < 0
? compute_delta<Float, Cost>(m_ctx, norm_costs, theta, variables)
: static_cast<Float>(p.delta);
const auto pushing_k_factor = static_cast<Float>(p.pushing_k_factor);
const auto pushing_objective_amplifier =
static_cast<Float>(p.pushing_objective_amplifier);
const long int w_limit = static_cast<long int>(p.w);
Solver slv(
m_rng, length(constraints), variables, norm_costs, constraints);
compute_order compute(p.order, variables);
{
std::bernoulli_distribution choose_mutation(
m_ctx.parameters.init_policy_random);
bit_array empty_x;
switch (p.init_policy) {
case solver_parameters::init_policy_type::pessimistic_solve:
init_with_pre_solve<Cost, Mode>(
x, empty_x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::optimistic_solve:
init_with_pre_solve<Cost, Mode>(
empty_x, x, m_rng, original_costs, constraints, 1.0);
break;
case solver_parameters::init_policy_type::bastert:
init_with_bastert<Cost, Mode>(x, original_costs, variables, 0);
break;
}
for (int i = 0, e = x.size(); i != e; ++i)
if (choose_mutation(m_rng))
x.invert(i);
}
bool start_push = false;
auto kappa = static_cast<Float>(p.kappa_min);
Observer obs("img", slv.m, slv.n, p.limit);
m_begin = std::chrono::steady_clock::now();
m_end = std::chrono::steady_clock::now();
compute.init(slv, x);
for (long int i = 0; i != p.limit; ++i) {
auto remaining = compute.run(slv, x, m_rng, kappa, delta, theta);
obs.make_observation(slv.ap, slv.P.get(), slv.pi.get());
if (remaining == 0) {
store_if_better(
x, original_costs.results(x, cost_constant), i);
best_remaining = remaining;
start_push = true;
break;
}
if (remaining < best_remaining) {
store_if_better(x, remaining, i);
best_remaining = remaining;
}
if (i > w_limit)
kappa += kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max) {
r.status = result_status::kappa_max_reached;
break;
}
if (is_timelimit_reached()) {
r.status = result_status::time_limit_reached;
break;
}
}
if (!start_push) {
r.status = result_status::limit_reached;
} else {
for (int push = 0; push < p.pushes_limit; ++push) {
auto remaining =
compute.push_and_run(slv,
x,
m_rng,
pushing_k_factor * kappa,
delta,
theta,
pushing_objective_amplifier);
if (remaining == 0)
store_if_better(x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - 1);
if (is_timelimit_reached())
break;
for (int iter = 0; iter < p.pushing_iteration_limit; ++iter) {
remaining =
compute.run(slv, x, m_rng, kappa, delta, theta);
if (remaining == 0) {
store_if_better(
x,
original_costs.results(x, cost_constant),
-push * p.pushing_iteration_limit - iter - 1);
break;
}
if (iter > p.w)
kappa +=
kappa_step * std::pow(static_cast<Float>(remaining) /
static_cast<Float>(slv.m),
alpha);
if (kappa > kappa_max)
break;
if (is_timelimit_reached())
break;
}
}
}
if (m_best.remaining_constraints == 0)
r.status = result_status::success;
if (!m_best.x.empty()) {
r.solutions.resize(1);
convert(m_best, r.solutions[0], variables);
}
return r;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2f8, %rsp # imm = 0x2F8
vmovsd %xmm0, 0x80(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
movq %r8, %r13
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, 0x58(%rsp)
vmovupd %zmm0, 0x58(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
movq $0x7fffffff, 0x98(%rdi) # imm = 0x7FFFFFFF
movl $0x2, 0xa0(%rdi)
leaq 0x68(%rsp), %rdi
movl %ecx, %esi
vzeroupper
callq 0x368ae
movq 0x10(%r14), %r12
movq 0x18(%r14), %rcx
leaq 0xc8(%rsp), %rdi
movq %r12, %rsi
movq %r13, %rdx
movl %ebx, %r8d
callq 0x8d226
fldl 0x20(%r12)
fstpt 0xe8(%rsp)
vxorpd %xmm1, %xmm1, %xmm1
fldl 0x28(%r12)
fstpt 0xf4(%rsp)
fldl 0x30(%r12)
fstpt 0xdc(%rsp)
fldl 0x8(%r12)
vmovsd 0x10(%r12), %xmm0
fld %st(0)
fstpt 0x4c(%rsp)
vucomisd %xmm0, %xmm1
jbe 0x43c71a
movq 0x10(%r14), %rdi
leaq 0xc8(%rsp), %rsi
movl %ebx, %edx
fstpt (%rsp)
callq 0x8d304
fstpt 0x94(%rsp)
jmp 0x43c733
fstp %st(0)
vmovsd %xmm0, 0x108(%rsp)
fldl 0x108(%rsp)
fstpt 0x94(%rsp)
fldl 0x38(%r12)
fstpt 0x11c(%rsp)
fldl 0x40(%r12)
fstpt 0x110(%rsp)
vcvttsd2si 0xa0(%r12), %rax
movq 0x18(%r14), %rsi
movq %rax, 0x88(%rsp)
movq 0x8(%r15), %rax
subq (%r15), %rax
pushq $0x28
popq %rcx
cqto
idivq %rcx
leaq 0x160(%rsp), %rdi
leaq 0xc8(%rsp), %r8
movl %eax, %edx
movl %ebx, %ecx
movq %r15, %r9
callq 0x434da6
movl 0xcc(%r12), %esi
leaq 0x128(%rsp), %rdi
movl %ebx, %edx
callq 0x38cd8
movq 0x10(%r14), %rax
movl %ebx, 0x90(%rsp)
vmovsd 0x48(%rax), %xmm0
vmovsd %xmm0, 0x40(%rsp)
vxorpd %xmm0, %xmm0, %xmm0
vmovapd %xmm0, 0xb0(%rsp)
movl 0xd4(%r12), %eax
testl %eax, %eax
je 0x43c815
cmpl $0x1, %eax
je 0x43c7ef
cmpl $0x2, %eax
jne 0x43c826
movq 0x18(%r14), %rdx
leaq 0xb0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
jmp 0x43c800
movq 0x18(%r14), %rdx
leaq 0x68(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
vmovsd 0x17830(%rip), %xmm0 # 0x454038
movq %r13, %rcx
movq %r15, %r8
callq 0xa1dbd
jmp 0x43c826
leaq 0x68(%rsp), %rdi
movq %r13, %rsi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0xa1d47
leaq 0x68(%rsp), %r15
movq %r13, 0x78(%rsp)
xorl %ebx, %ebx
movl (%r15), %ebp
cmpl %ebx, %ebp
je 0x43c85c
movq 0x18(%r14), %rdi
callq 0x36ac3
vmovsd 0x40(%rsp), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x43c858
movq %r15, %rdi
movl %ebx, %esi
callq 0x3626e
incl %ebx
jmp 0x43c835
leaq 0xb8(%rsp), %rdi
callq 0x357fe
vmovsd 0x18(%r12), %xmm0
vmovsd %xmm0, 0x40(%rsp)
callq 0xb5a0
movq %rax, (%r14)
callq 0xb5a0
movq %rax, 0x8(%r14)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x4351ac
vmovsd 0x40(%rsp), %xmm0
movl $0x7fffffff, %ebp # imm = 0x7FFFFFFF
leaq 0x68(%rsp), %rbx
xorl %r15d, %r15d
vmovsd %xmm0, 0x100(%rsp)
fldl 0x100(%rsp)
fldt 0x4c(%rsp)
cmpq 0xb0(%r12), %r15
je 0x43c9b7
movq 0x18(%r14), %rcx
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x160(%rsp), %rsi
movq %rbx, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x4351ee
movl %eax, %r13d
testl %eax, %eax
je 0x43ca5e
cmpl %ebp, %r13d
jge 0x43c92e
movq %r14, %rdi
movq %rbx, %rsi
movl %r13d, %edx
movq %r15, %rcx
callq 0x43cf1c
movl %r13d, %ebp
cmpq 0x88(%rsp), %r15
jle 0x43c980
movl %r13d, 0xa8(%rsp)
fildl 0xa8(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xac(%rsp)
fidivl 0xac(%rsp)
fldt 0xdc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe8(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x43c984
fldt 0x40(%rsp)
fldt 0xf4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
fldz
ja 0x43c9b7
fstp %st(0)
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x43cf54
fldt 0x40(%rsp)
fldt 0x4c(%rsp)
testb %al, %al
jne 0x43c9b7
incq %r15
jmp 0x43c8c8
fstp %st(0)
fstp %st(0)
movq 0x58(%rsp), %rax
movl $0x5, 0xa0(%rax)
fldz
fldz
fstp %st(1)
fstp %st(0)
cmpl $0x0, 0x50(%r14)
jne 0x43c9e5
movq 0x58(%rsp), %rax
andl $0x0, 0xa0(%rax)
cmpq $0x0, 0x28(%r14)
je 0x43ca16
movq 0x58(%rsp), %rax
leaq 0x68(%rax), %rbx
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x35292
movq (%rbx), %rsi
addq $0x20, %r14
movl 0x90(%rsp), %edx
movq %r14, %rdi
callq 0x4f485
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x4356c2
leaq 0xd0(%rsp), %rdi
callq 0x8affa
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rax
addq $0x2f8, %rsp # imm = 0x2F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
leaq 0x68(%rsp), %rbx
movq %rbx, %rsi
callq 0x8b74a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x43cece
movl $0x0, 0x64(%rsp)
leaq 0x160(%rsp), %r15
leaq 0x68(%rsp), %rbp
xorl %ebx, %ebx
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
cmpl 0xbc(%r12), %ebx
jge 0x43c9ce
movq 0x18(%r14), %rcx
fldt 0x11c(%rsp)
fld %st(1)
fstpt 0x40(%rsp)
fmulp %st, %st(1)
fldt 0x110(%rsp)
fstpt 0x30(%rsp)
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0x43541e
testl %eax, %eax
jne 0x43cb2e
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x8b74a
movl 0xc0(%r12), %eax
imull %ebx, %eax
notl %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x43cece
movq %r14, %rdi
callq 0x43cf54
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
testb %al, %al
jne 0x43c9ce
movl %ebx, 0x88(%rsp)
pushq $0x1
popq %rax
movl %eax, %ebx
leal -0x1(%rbx), %r13d
cmpl 0xc0(%r12), %r13d
jge 0x43cc74
movq 0x18(%r14), %rcx
fxch %st(1)
fstpt 0x20(%rsp)
leaq 0x128(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
fldt 0x94(%rsp)
fstpt 0x10(%rsp)
fld %st(0)
fstpt 0x40(%rsp)
fstpt (%rsp)
callq 0x4351ee
testl %eax, %eax
je 0x43cc27
vcvtsi2sd %r13d, %xmm2, %xmm0
vucomisd 0xa0(%r12), %xmm0
jbe 0x43cbf5
movl %eax, 0xa0(%rsp)
fildl 0xa0(%rsp)
movl 0x2e0(%rsp), %eax
movl %eax, 0xa4(%rsp)
fidivl 0xa4(%rsp)
fldt 0xdc(%rsp)
fstpt 0x10(%rsp)
fstpt (%rsp)
callq 0xb110
fldt 0xe8(%rsp)
fmulp %st, %st(1)
fldt 0x40(%rsp)
faddp %st, %st(1)
jmp 0x43cbf9
fldt 0x40(%rsp)
fldt 0xf4(%rsp)
fxch %st(1)
fucomi %st(1), %st
fstp %st(1)
ja 0x43cc64
movq %r14, %rdi
fstpt 0x40(%rsp)
callq 0x43cf54
testb %al, %al
jne 0x43cc6c
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
incl %ebx
jmp 0x43cb52
vmovsd 0x80(%rsp), %xmm0
movq 0x78(%rsp), %rdi
movq %rbp, %rsi
callq 0x8b74a
movl 0xc0(%r12), %eax
imull 0x64(%rsp), %eax
subl %ebx, %eax
movslq %eax, %rdx
movq %r14, %rdi
movq %rbp, %rsi
callq 0x43cece
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
jmp 0x43cc74
fldt 0x4c(%rsp)
fxch %st(1)
jmp 0x43cc74
fldt 0x4c(%rsp)
fldt 0x40(%rsp)
movl 0x88(%rsp), %ebx
decl 0x64(%rsp)
incl %ebx
jmp 0x43caa6
jmp 0x43ccbc
jmp 0x43cc95
fstp %st(1)
fstp %st(0)
jmp 0x43ccbc
movq %rax, %rbx
jmp 0x43cccc
movq %rax, %rbx
jmp 0x43ccd9
movq %rax, %rbx
jmp 0x43cce6
movq %rax, %rbx
jmp 0x43ccf0
jmp 0x43ccbc
jmp 0x43ccbc
jmp 0x43ccbc
leaq 0xb8(%rsp), %rdi
movq %rax, %rbx
callq 0x357fe
jmp 0x43ccbf
movq %rax, %rbx
leaq 0x128(%rsp), %rdi
callq 0x393ac
leaq 0x160(%rsp), %rdi
callq 0x4356c2
leaq 0xd0(%rsp), %rdi
callq 0x8affa
leaq 0x70(%rsp), %rdi
callq 0x357fe
movq 0x58(%rsp), %rdi
callq 0xea60
movq %rbx, %rdi
callq 0xb3d0
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::file_observer>::store_if_better(baryonyx::bit_array const&, double, long) | void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
} | vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x43ce34
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x43ceae
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::file_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1cbe9(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::store_if_better(baryonyx::bit_array const&, double, long) | void store_if_better(const bit_array& x, double current, long int i)
{
if (is_better_solution<Mode>(current, m_best.value)) {
m_best.x = x;
m_best.duration = duration();
m_best.loop = i;
m_best.remaining_constraints = 0;
m_best.value = current;
}
} | vmovsd 0x30(%rdi), %xmm1
vucomisd %xmm0, %xmm1
jbe 0x43cf1a
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
addq $0x20, %rdi
movq %rdx, %rbx
vmovsd %xmm0, (%rsp)
callq 0x36a44
movq %r14, %rdi
callq 0x43cf94
vmovsd (%rsp), %xmm1
vmovsd %xmm0, 0x38(%r14)
movq %rbx, 0x48(%r14)
andl $0x0, 0x50(%r14)
vmovsd %xmm1, 0x30(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
baryonyx::itm::solver_functor<baryonyx::itm::solver_inequalities_Zcoeff<long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, false>, long double, baryonyx::itm::minimize_tag, baryonyx::itm::default_cost_type<long double>, baryonyx::none_observer>::is_timelimit_reached() | bool is_timelimit_reached()
{
m_end = std::chrono::steady_clock::now();
return is_time_limit(m_ctx.parameters.time_limit, m_begin, m_end);
} | pushq %rbx
movq %rdi, %rbx
callq 0xb5a0
movq %rax, 0x8(%rbx)
vxorpd %xmm2, %xmm2, %xmm2
movq 0x10(%rbx), %rcx
subq (%rbx), %rax
vmovsd (%rcx), %xmm0
vcvtsi2sd %rax, %xmm1, %xmm1
vdivsd 0x1cb03(%rip), %xmm1, %xmm1 # 0x459a80
vcmpnlepd %xmm2, %xmm0, %k1
vcmpltpd %xmm1, %xmm0, %k0 {%k1}
kmovd %k0, %eax
andb $0x1, %al
popq %rbx
retq
nop
| /quesnel[P]baryonyx/lib/src/itm-solver-common.hpp |
main | int main(const int argc, char** const argv)
{
int exit_code = EXIT_SUCCESS;
if (argc < 2)
{
fputs(
"This tool decompresses a supplied file that's in the Moduled Kosinski format.\n"
"\n"
"www.github.com/Clownacy/accurate-kosinski\n"
"\n"
"Usage: kosinskim-decompress [in_file] [out_file](optional)\n"
, stdout
);
}
else
{
FILE* const in_file = fopen(argv[1], "rb");
if (in_file == NULL)
{
exit_code = EXIT_FAILURE;
fprintf(stderr, "Could not open '%s'\n", argv[1]);
}
else
{
const char* const out_filename = (argc > 2) ? argv[2] : "out.unc";
FILE* const out_file = fopen(out_filename, "wb");
if (out_file == NULL)
{
exit_code = EXIT_FAILURE;
fprintf(stderr, "Could not open '%s'\n", out_filename);
}
else
{
KosinskiDecompressCallbacks callbacks;
callbacks.read_byte_user_data = in_file;
callbacks.read_byte = ReadByte;
callbacks.write_byte_user_data = out_file;
callbacks.write_byte = WriteByte;
KosinskiDecompressModuled(&callbacks,
#ifdef DEBUG
cc_true
#else
cc_false
#endif
);
fclose(out_file);
}
fclose(in_file);
}
}
return exit_code;
} | pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x11ce
movq 0x2e1e(%rip), %rax # 0x3fd8
movq (%rax), %rsi
leaq 0xe40(%rip), %rdi # 0x2004
callq 0x1040
jmp 0x12ca
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xedd(%rip), %rsi # 0x20ba
callq 0x1080
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x1219
movl $0x1, -0x14(%rbp)
movq 0x2dfd(%rip), %rax # 0x3ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0xeb0(%rip), %rsi # 0x20bd
movb $0x0, %al
callq 0x1070
jmp 0x12c8
cmpl $0x2, -0x8(%rbp)
jle 0x122d
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x123a
leaq 0xe9e(%rip), %rax # 0x20d2
movq %rax, -0x58(%rbp)
jmp 0x123a
movq -0x58(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0xe8d(%rip), %rsi # 0x20da
callq 0x1080
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x1282
movl $0x1, -0x14(%rbp)
movq 0x2d8d(%rip), %rax # 0x3ff8
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0xe44(%rip), %rsi # 0x20bd
movb $0x0, %al
callq 0x1070
jmp 0x12bf
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq 0x4f(%rip), %rax # 0x12e0
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x5c(%rip), %rax # 0x1300
movq %rax, -0x38(%rbp)
leaq -0x50(%rbp), %rdi
movl $0x1, %esi
callq 0x1330
movq -0x30(%rbp), %rdi
callq 0x1030
movq -0x20(%rbp), %rdi
callq 0x1030
jmp 0x12ca
movl -0x14(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
| /Clownacy[P]accurate-kosinski/main-moduled-decompress.c |
main | int main()
{
using just::console::color;
std::cout << "Hello ";
show_color(color::red);
show_color(color::green);
show_color(color::blue);
just::console::reset();
std::cout << "World!" << std::endl;
} | pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x2ad9(%rip), %rdi # 0x4fd8
leaq 0xafe(%rip), %rsi # 0x3004
callq 0x2050
movl 0x2b4b(%rip), %eax # 0x505c
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x24a0
movl 0x2b3e(%rip), %eax # 0x5060
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edi
callq 0x24a0
movl 0x2b31(%rip), %eax # 0x5064
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %edi
callq 0x24a0
callq 0x2be0
movq 0x2a8e(%rip), %rdi # 0x4fd8
leaq 0xaba(%rip), %rsi # 0x300b
callq 0x2050
movq %rax, %rdi
movq 0x2a68(%rip), %rsi # 0x4fc8
callq 0x2060
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
| /sabel83[P]just/libs/console/example/hello_colors/main.cpp |
just::console::text_color(just::console::impl::color<void>) | inline void text_color(color c_)
{
if (c_ == color::black) { std::cout << "\033[30m"; }
else if (c_ == color::red) { std::cout << "\033[31m"; }
else if (c_ == color::green) { std::cout << "\033[32m"; }
else if (c_ == color::yellow) { std::cout << "\033[33m"; }
else if (c_ == color::blue) { std::cout << "\033[34m"; }
else if (c_ == color::magenta) { std::cout << "\033[35m"; }
else if (c_ == color::cyan) { std::cout << "\033[36m"; }
else if (c_ == color::gray) { std::cout << "\033[37m"; }
else if (c_ == color::bright_red) { std::cout << "\033[1;31m"; }
else if (c_ == color::bright_green) { std::cout << "\033[1;32m"; }
else if (c_ == color::bright_yellow) { std::cout << "\033[1;33m"; }
else if (c_ == color::bright_blue) { std::cout << "\033[1;34m"; }
else if (c_ == color::bright_magenta) { std::cout << "\033[1;35m"; }
else if (c_ == color::bright_cyan) { std::cout << "\033[1;36m"; }
else if (c_ == color::white) { std::cout << "\033[1;37m"; }
else { assert(!"Invalid color value"); }
} | pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl 0x2ae7(%rip), %eax # 0x5068
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x2596
jmp 0x25ae
movq 0x2a3b(%rip), %rdi # 0x4fd8
leaq 0xa6e(%rip), %rsi # 0x3012
callq 0x2050
jmp 0x28ad
movl 0x2aa8(%rip), %eax # 0x505c
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x25c9
jmp 0x25e1
movq 0x2a08(%rip), %rdi # 0x4fd8
leaq 0xa41(%rip), %rsi # 0x3018
callq 0x2050
jmp 0x28ab
movl 0x2a79(%rip), %eax # 0x5060
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x25fc
jmp 0x2614
movq 0x29d5(%rip), %rdi # 0x4fd8
leaq 0xa14(%rip), %rsi # 0x301e
callq 0x2050
jmp 0x28a9
movl 0x2a6e(%rip), %eax # 0x5088
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x262f
jmp 0x2647
movq 0x29a2(%rip), %rdi # 0x4fd8
leaq 0x9e7(%rip), %rsi # 0x3024
callq 0x2050
jmp 0x28a7
movl 0x2a17(%rip), %eax # 0x5064
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x2662
jmp 0x267a
movq 0x296f(%rip), %rdi # 0x4fd8
leaq 0x9ba(%rip), %rsi # 0x302a
callq 0x2050
jmp 0x28a5
movl 0x2a20(%rip), %eax # 0x50a0
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x2695
jmp 0x26ad
movq 0x293c(%rip), %rdi # 0x4fd8
leaq 0x98d(%rip), %rsi # 0x3030
callq 0x2050
jmp 0x28a3
movl 0x29fd(%rip), %eax # 0x50b0
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x26c8
jmp 0x26e0
movq 0x2909(%rip), %rdi # 0x4fd8
leaq 0x960(%rip), %rsi # 0x3036
callq 0x2050
jmp 0x28a1
movl 0x29da(%rip), %eax # 0x50c0
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x26fb
jmp 0x2713
movq 0x28d6(%rip), %rdi # 0x4fd8
leaq 0x933(%rip), %rsi # 0x303c
callq 0x2050
jmp 0x289f
movl 0x29b7(%rip), %eax # 0x50d0
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x272e
jmp 0x2746
movq 0x28a3(%rip), %rdi # 0x4fd8
leaq 0x906(%rip), %rsi # 0x3042
callq 0x2050
jmp 0x289d
movl 0x2994(%rip), %eax # 0x50e0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x2761
jmp 0x2779
movq 0x2870(%rip), %rdi # 0x4fd8
leaq 0x8db(%rip), %rsi # 0x304a
callq 0x2050
jmp 0x289b
movl 0x2971(%rip), %eax # 0x50f0
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x2794
jmp 0x27ac
movq 0x283d(%rip), %rdi # 0x4fd8
leaq 0x8b0(%rip), %rsi # 0x3052
callq 0x2050
jmp 0x2899
movl 0x294e(%rip), %eax # 0x5100
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x27c7
jmp 0x27df
movq 0x280a(%rip), %rdi # 0x4fd8
leaq 0x885(%rip), %rsi # 0x305a
callq 0x2050
jmp 0x2897
movl 0x292b(%rip), %eax # 0x5110
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x27fa
jmp 0x2812
movq 0x27d7(%rip), %rdi # 0x4fd8
leaq 0x85a(%rip), %rsi # 0x3062
callq 0x2050
jmp 0x2895
movl 0x2908(%rip), %eax # 0x5120
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x282d
jmp 0x2842
movq 0x27a4(%rip), %rdi # 0x4fd8
leaq 0x82f(%rip), %rsi # 0x306a
callq 0x2050
jmp 0x2893
movl 0x28e8(%rip), %eax # 0x5130
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %esi
leaq -0x4(%rbp), %rdi
callq 0x2c20
testb $0x1, %al
jne 0x285d
jmp 0x2872
movq 0x2774(%rip), %rdi # 0x4fd8
leaq 0x807(%rip), %rsi # 0x3072
callq 0x2050
jmp 0x2891
leaq 0x801(%rip), %rdi # 0x307a
leaq 0x811(%rip), %rsi # 0x3091
movl $0xbf, %edx
leaq 0x866(%rip), %rcx # 0x30f2
callq 0x2030
jmp 0x2893
jmp 0x2895
jmp 0x2897
jmp 0x2899
jmp 0x289b
jmp 0x289d
jmp 0x289f
jmp 0x28a1
jmp 0x28a3
jmp 0x28a5
jmp 0x28a7
jmp 0x28a9
jmp 0x28ab
jmp 0x28ad
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
| /sabel83[P]just/include/just/console.hpp |
foobar(int, char**) | int foobar(int argc, char** argv) {
using namespace csv;
if (argc < 2) {
std::cout << "Usage: " << argv[0] << " [file]" << std::endl;
exit(1);
}
std::string file = argv[1];
auto info = get_file_info(file);
std::cout << file << std::endl
<< "Columns: " << internals::format_row(info.col_names, ", ")
<< "Dimensions: " << info.n_rows << " rows x " << info.n_cols << " columns" << std::endl
<< "Delimiter: " << info.delim << std::endl;
return 0;
} | pushq %rbx
subq $0x90, %rsp
movq %rsi, %rbx
cmpl $0x1, %edi
jle 0x39a0
movq 0x8(%rbx), %rsi
leaq 0x20(%rsp), %rbx
leaq 0x40(%rsp), %rdx
movq %rbx, %rdi
callq 0x3a10
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x3f4a
movq 0x11716(%rip), %rdi # 0x14fd0
leaq 0x20(%rsp), %rsi
callq 0x32c0
movq %rax, %rdi
callq 0x3110
leaq 0x983c(%rip), %rsi # 0xd10f
movq %rax, %rdi
callq 0x32e0
movq %rax, %rbx
leaq 0x60(%rsp), %rsi
leaq 0x982f(%rip), %rcx # 0xd119
movq %rsp, %rdi
pushq $0x2
popq %rdx
callq 0x4111
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x32c0
leaq 0x9815(%rip), %rsi # 0xd11c
movq %rax, %rdi
callq 0x32e0
movq 0x80(%rsp), %rsi
movq %rax, %rdi
callq 0x31e0
leaq 0x9803(%rip), %rsi # 0xd129
movq %rax, %rdi
callq 0x32e0
movq 0x88(%rsp), %rsi
movq %rax, %rdi
callq 0x31e0
leaq 0x97ed(%rip), %rsi # 0xd132
movq %rax, %rdi
callq 0x32e0
movq %rax, %rdi
callq 0x3110
leaq 0x97df(%rip), %rsi # 0xd13b
movq %rax, %rdi
callq 0x32e0
movsbl 0x78(%rsp), %esi
movq %rax, %rdi
callq 0x3350
movq %rax, %rdi
callq 0x3110
movq %rsp, %rdi
callq 0x3598
leaq 0x40(%rsp), %rdi
callq 0x4210
leaq 0x20(%rsp), %rdi
callq 0x3598
xorl %eax, %eax
addq $0x90, %rsp
popq %rbx
retq
movq 0x11629(%rip), %rdi # 0x14fd0
leaq 0x9751(%rip), %rsi # 0xd0ff
callq 0x32e0
movq (%rbx), %rsi
movq %rax, %rdi
callq 0x32e0
leaq 0x9742(%rip), %rsi # 0xd107
movq %rax, %rdi
callq 0x32e0
movq %rax, %rdi
callq 0x3110
pushq $0x1
popq %rdi
callq 0x3360
jmp 0x39e4
movq %rax, %rbx
jmp 0x39fe
movq %rax, %rbx
jmp 0x39f4
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3598
leaq 0x40(%rsp), %rdi
callq 0x4210
leaq 0x20(%rsp), %rdi
callq 0x3598
movq %rbx, %rdi
callq 0x3500
| /vincentlaucsb[P]csv-parser/single_include_test/file1.cpp |
csv::internals::MmapParser::next(unsigned long) | CSV_INLINE void MmapParser::next(size_t bytes = ITERATION_CHUNK_SIZE) {
// Reset parser state
this->field_start = UNINITIALIZED_FIELD;
this->field_length = 0;
this->reset_data_ptr();
// Create memory map
size_t length = std::min(this->source_size - this->mmap_pos, bytes);
std::error_code error;
this->data_ptr->_data = std::make_shared<mio::basic_mmap_source<char>>(mio::make_mmap_source(this->_filename, this->mmap_pos, length, error));
this->mmap_pos += length;
if (error) throw error;
auto mmap_ptr = (mio::basic_mmap_source<char>*)(this->data_ptr->_data.get());
// Create string view
this->data_ptr->data = csv::string_view(mmap_ptr->data(), mmap_ptr->length());
// Parse
this->current_row = CSVRow(this->data_ptr);
size_t remainder = this->parse();
if (this->mmap_pos == this->source_size || no_chunk()) {
this->_eof = true;
this->end_feed();
}
this->mmap_pos -= (length - remainder);
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
orl $-0x1, 0x58(%rdi)
movq %rsi, %r15
andq $0x0, 0x60(%rdi)
callq 0x3be0
movq 0x470(%rbx), %r14
movq 0x5b8(%rbx), %r12
subq %r12, %r14
cmpq %r15, %r14
cmovaeq %r15, %r14
leaq 0x18(%rsp), %r15
andl $0x0, (%r15)
callq 0x3190
movq %rax, 0x8(%r15)
leaq 0x598(%rbx), %rsi
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %r12, %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0x9b14
leaq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x3c4a
movq 0x30(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0xa02c
leaq 0x10(%rsp), %rdi
callq 0x4b62
leaq 0x38(%rsp), %rdi
callq 0x3c68
addq %r14, 0x5b8(%rbx)
cmpl $0x0, 0x18(%rsp)
jne 0x3baa
leaq 0x30(%rbx), %rsi
movq 0x30(%rbx), %rax
movq (%rax), %rcx
movq (%rcx), %rdx
movq 0x8(%rcx), %rcx
movq %rcx, 0x10(%rax)
movq %rdx, 0x18(%rax)
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0x4e3e
leaq 0x38(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3c78
leaq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x3c90
leaq 0x40(%rsp), %rdi
callq 0x4b62
leaq 0x30(%rsp), %rdi
callq 0x4b62
movq %rbx, %rdi
callq 0x3cbc
movq %rax, %r15
movq 0x470(%rbx), %rcx
movq 0x5b8(%rbx), %rax
cmpq %rcx, %rax
setne %dl
cmpq $0x989680, %rcx # imm = 0x989680
setae %cl
testb %cl, %dl
jne 0x3b8f
movb $0x1, 0x468(%rbx)
movq %rbx, %rdi
callq 0x3ee6
movq 0x5b8(%rbx), %rax
subq %r14, %r15
addq %rax, %r15
movq %r15, 0x5b8(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
pushq $0x10
popq %rdi
callq 0x3120
movups 0x18(%rsp), %xmm0
movups %xmm0, (%rax)
leaq 0x10f17(%rip), %rsi # 0x14ad8
movq %rax, %rdi
xorl %edx, %edx
callq 0x34e0
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x3c68
movq %rbx, %rdi
callq 0x3500
| /vincentlaucsb[P]csv-parser/single_include_test/csv.hpp |
csv::internals::IBasicCSVParser::reset_data_ptr() | CSV_INLINE void IBasicCSVParser::reset_data_ptr() {
this->data_ptr = std::make_shared<RawCSVData>();
this->data_ptr->parse_flags = this->_parse_flags;
this->data_ptr->col_names = this->_col_names;
this->fields = &(this->data_ptr->fields);
} | pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x4261
leaq 0x30(%rbx), %rdi
movq %r14, %rsi
callq 0x4daa
leaq 0x10(%rsp), %rdi
callq 0x4b62
leaq 0x68(%rbx), %rsi
movl $0x108, %edi # imm = 0x108
addq 0x30(%rbx), %rdi
movl $0x400, %edx # imm = 0x400
callq 0x3290
leaq 0x40(%rbx), %rsi
movl $0xf8, %edi
addq 0x30(%rbx), %rdi
callq 0x4dd8
movq 0x30(%rbx), %rax
addq $0x20, %rax
movq %rax, 0x50(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
| /vincentlaucsb[P]csv-parser/single_include_test/csv.hpp |
csv::internals::ThreadSafeDeque<csv::CSVRow>::pop_front() | T pop_front() noexcept {
std::lock_guard<std::mutex> lock{ this->_lock };
T item = std::move(data.front());
data.pop_front();
return item;
} | pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x10(%rsi), %r14
movq %r14, %rdi
callq 0x5148
movq 0x78(%r15), %rax
addq $0x68, %r15
movups (%rax), %xmm0
andq $0x0, 0x8(%rax)
movups %xmm0, (%rbx)
andq $0x0, (%rax)
movq 0x20(%rax), %rcx
movq %rcx, 0x20(%rbx)
movups 0x10(%rax), %xmm0
movups %xmm0, 0x10(%rbx)
movq %r15, %rdi
callq 0x8f22
movq %r14, %rdi
callq 0x3270
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rdi
callq 0x43fb
nop
| /vincentlaucsb[P]csv-parser/single_include_test/csv.hpp |
ZNK3csv6CSVRowcvSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EEEv | CSV_INLINE CSVRow::operator std::vector<std::string>() const {
std::vector<std::string> ret;
for (size_t i = 0; i < size(); i++)
ret.push_back(std::string(this->get_field(i)));
return ret;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
xorl %r15d, %r15d
leaq 0x18(%rsp), %r12
leaq 0x8(%rsp), %r13
leaq 0x7(%rsp), %rbp
cmpq 0x20(%r14), %r15
jae 0x8eec
movq %r14, %rdi
movq %r15, %rsi
callq 0x8f94
movq %rax, 0x8(%rsp)
movq %rdx, 0x10(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x709a
movq %rbx, %rdi
movq %r12, %rsi
callq 0x90ca
movq %r12, %rdi
callq 0x3598
incq %r15
jmp 0x8eab
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x3598
jmp 0x8f12
jmp 0x8f0f
movq %rax, %r14
movq %rbx, %rdi
callq 0x58bc
movq %r14, %rdi
callq 0x3500
| /vincentlaucsb[P]csv-parser/single_include_test/csv.hpp |
void mio::basic_mmap<(mio::access_mode)0, char>::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, unsigned long, unsigned long, std::error_code&) | void basic_mmap<AccessMode, ByteT>::map(const String& path, const size_type offset,
const size_type length, std::error_code& error)
{
error.clear();
if(detail::empty(path))
{
error = std::make_error_code(std::errc::invalid_argument);
return;
}
const auto handle = detail::open_file(path, AccessMode, error);
if(error)
{
return;
}
map(handle, offset, length, error);
// This MUST be after the call to map, as that sets this to true.
if(!error)
{
is_handle_internal_ = true;
}
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
movq %r8, %rdi
callq 0x9bc0
cmpq $0x0, 0x8(%r13)
je 0x9ba6
movq %r13, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x9bd2
cmpl $0x0, (%rbx)
jne 0x9bb5
movq %r14, %rdi
movl %eax, %esi
movq %r12, %rdx
movq %r15, %rcx
movq %rbx, %r8
callq 0x9c28
cmpl $0x0, (%rbx)
jne 0x9bb5
movb $0x1, 0x1c(%r14)
jmp 0x9bb5
callq 0x3130
movl $0x16, (%rbx)
movq %rax, 0x8(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
| /vincentlaucsb[P]csv-parser/single_include_test/csv.hpp |
csv::internals::data_type(std::basic_string_view<char, std::char_traits<char>>, long double*, char) | CONSTEXPR_14
DataType data_type(csv::string_view in, long double* const out, const char decimalSymbol) {
// Empty string --> NULL
if (in.size() == 0)
return DataType::CSV_NULL;
bool ws_allowed = true,
dot_allowed = true,
digit_allowed = true,
is_negative = false,
has_digit = false,
prob_float = false;
unsigned places_after_decimal = 0;
long double integral_part = 0,
decimal_part = 0;
for (size_t i = 0, ilen = in.size(); i < ilen; i++) {
const char& current = in[i];
switch (current) {
case ' ':
if (!ws_allowed) {
if (isdigit(in[i - 1])) {
digit_allowed = false;
ws_allowed = true;
}
else {
// Ex: '510 123 4567'
return DataType::CSV_STRING;
}
}
break;
case '+':
if (!ws_allowed) {
return DataType::CSV_STRING;
}
break;
case '-':
if (!ws_allowed) {
// Ex: '510-123-4567'
return DataType::CSV_STRING;
}
is_negative = true;
break;
// case decimalSymbol: not allowed because decimalSymbol is not a literal,
// it is handled in the default block
case 'e':
case 'E':
// Process scientific notation
if (prob_float || (i && i + 1 < ilen && isdigit(in[i - 1]))) {
size_t exponent_start_idx = i + 1;
prob_float = true;
// Strip out plus sign
if (in[i + 1] == '+') {
exponent_start_idx++;
}
return _process_potential_exponential(
in.substr(exponent_start_idx),
is_negative ? -(integral_part + decimal_part) : integral_part + decimal_part,
out
);
}
return DataType::CSV_STRING;
break;
default:
short digit = static_cast<short>(current - '0');
if (digit >= 0 && digit <= 9) {
// Process digit
has_digit = true;
if (!digit_allowed)
return DataType::CSV_STRING;
else if (ws_allowed) // Ex: '510 456'
ws_allowed = false;
// Build current number
if (prob_float)
decimal_part += digit / pow10(++places_after_decimal);
else
integral_part = (integral_part * 10) + digit;
}
// case decimalSymbol: not allowed because decimalSymbol is not a literal.
else if (dot_allowed && current == decimalSymbol) {
dot_allowed = false;
prob_float = true;
}
else {
return DataType::CSV_STRING;
}
}
}
// No non-numeric/non-whitespace characters found
if (has_digit) {
long double number = integral_part + decimal_part;
if (out) {
*out = is_negative ? -number : number;
}
return prob_float ? DataType::CSV_DOUBLE : _determine_integral_type(number);
}
// Just whitespace
return DataType::CSV_NULL;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, 0x68(%rsp)
movq %rsi, 0x70(%rsp)
testq %rdi, %rdi
je 0xbd4e
movq %rsi, %r14
movq %rdx, 0x38(%rsp)
leaq 0x1c(%rsp), %r8
andl $0x0, (%r8)
movq %rdi, 0x50(%rsp)
movq %rdi, %r12
negq %r12
movb $0x1, %al
fldz
xorl %r10d, %r10d
pushq $0x2
popq %r15
xorl %r11d, %r11d
xorl %r9d, %r9d
xorl %edi, %edi
fld %st(0)
xorl %ebx, %ebx
movb $0x1, %bpl
movb $0x1, %r13b
leaq (%r12,%r15), %rdx
cmpq $0x2, %rdx
je 0xbd55
movzbl -0x2(%r14,%r15), %edx
cmpl $0x20, %edx
je 0xbcfc
cmpl $0x2b, %edx
je 0xbcf1
cmpl $0x2d, %edx
je 0xbcef
cmpl $0x45, %edx
je 0xbd93
cmpl $0x65, %edx
je 0xbd93
leal -0x30(%rdx), %esi
cmpb $0x9, %sil
ja 0xbd1b
testb $0x1, %al
je 0xbe2f
movsbl %dl, %eax
addl $-0x30, %eax
testb $0x1, %r13b
movzbl %r13b, %edx
cmovnel %r10d, %edx
movl %edx, %r13d
movl %eax, 0x18(%rsp)
fildl 0x18(%rsp)
testb $0x1, %r9b
je 0xbd37
incl %r11d
movl %r11d, 0xc(%rsp)
movl %r11d, 0x1c(%rsp)
movq %r8, %rdi
fxch %st(2)
fstpt 0x2c(%rsp)
fstpt 0x20(%rsp)
movl %ebx, 0x14(%rsp)
movl %ecx, %ebx
movl %ebp, 0x8(%rsp)
movq %r8, %rbp
movl %r9d, 0x10(%rsp)
fstpt 0x5c(%rsp)
callq 0xbea7
movl 0xc(%rsp), %r11d
xorl %r10d, %r10d
movl 0x10(%rsp), %r9d
movq %rbp, %r8
movl 0x8(%rsp), %ebp
movl %ebx, %ecx
movl 0x14(%rsp), %ebx
fldt 0x20(%rsp)
fldt 0x5c(%rsp)
fdivp %st, %st(2)
faddp %st, %st(1)
fldt 0x2c(%rsp)
movb $0x1, %dil
movb $0x1, %al
fxch %st(1)
jmp 0xbd46
movb $0x1, %bl
testb $0x1, %r13b
jne 0xbd46
jmp 0xbe2f
testb $0x1, %r13b
jne 0xbd46
movsbl -0x3(%r14,%r15), %eax
addl $-0x30, %eax
cmpl $0xa, %eax
jae 0xbe2f
movb $0x1, %r13b
xorl %eax, %eax
jmp 0xbd46
cmpb %cl, %dl
setne %dl
notb %bpl
orb %dl, %bpl
testb $0x1, %bpl
jne 0xbe2f
movb $0x1, %r9b
xorl %ebp, %ebp
jmp 0xbd46
fxch %st(2)
fmuls 0x199d(%rip) # 0xd6dc
faddp %st, %st(2)
movb $0x1, %dil
movb $0x1, %al
incq %r15
jmp 0xbc0a
xorl %eax, %eax
jmp 0xbe3e
xorl %eax, %eax
testb $0x1, %dil
je 0xbe3a
faddp %st, %st(1)
fld %st(0)
fstpt 0x40(%rsp)
movq 0x38(%rsp), %rax
testq %rax, %rax
je 0xbd84
fld %st(0)
fchs
testb $0x1, %bl
fxch %st(1)
fcmovne %st(1), %st
fstp %st(1)
fstpt (%rax)
fldz
fstp %st(0)
testb $0x1, %r9b
je 0xbdf5
pushq $0x7
jmp 0xbe35
testb $0x1, %r9b
je 0xbe01
leaq -0x1(%r15), %rsi
cmpb $0x2b, (%r14,%rsi)
cmovneq %rsi, %r15
leaq 0x68(%rsp), %rdi
pushq $-0x1
popq %rdx
movq %r15, %rsi
fxch %st(1)
fstpt 0x2c(%rsp)
fstpt 0x20(%rsp)
callq 0x9284
fldt 0x2c(%rsp)
fldt 0x20(%rsp)
faddp %st, %st(1)
fld %st(0)
fchs
testb $0x1, %bl
fxch %st(1)
fcmovne %st(1), %st
fstp %st(1)
fstpt 0x40(%rsp)
leaq 0x40(%rsp), %rcx
movq %rax, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
movq 0x38(%rsp), %rcx
callq 0xbe4d
jmp 0xbe36
leaq 0x40(%rsp), %rdi
callq 0xbeb9
jmp 0xbe36
cmpq $0x2, %r15
sete %cl
leaq -0x1(%r15), %rsi
cmpq 0x50(%rsp), %rsi
setae %dl
orb %cl, %dl
jne 0xbe2f
movsbl -0x3(%r14,%r15), %ecx
addl $-0x30, %ecx
cmpl $0x9, %ecx
pushq $0x1
popq %rax
jbe 0xbd9d
jmp 0xbe3a
fstp %st(1)
fstp %st(0)
pushq $0x1
popq %rax
fldz
fldz
fstp %st(1)
fstp %st(0)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /vincentlaucsb[P]csv-parser/single_include_test/csv.hpp |
main | int main (void) {
int number;
int flag = 1;
int numA;
int numB;
int numC;
int numD;
printf("%s", "Enter a 5 digit number: ");
scanf("%d", &number);
while (flag != -1) {
if (number > 10000) {
if (number < 99999) {
numA = number / 10000;
number = number % 10000;
numB = number / 1000;
number = number % 1000;
number = number % 100;
numC = number / 10;
numD = number % 10;
if (numA == numD) {
if (numB == numC) {
puts("The given number is a palindrome!!!");
}
else
puts("Not a palindrome!!!");
}
else
puts("Not a palindrome!!!");
flag = -1;
}
else {
puts("You did not provide a 5 digit number!!!");
printf("%s", "Enter a 5 digit number: ");
scanf("%d", &number);
}
}
else {
puts("You did not provide a 5 digit number!!!");
printf("%s", "Enter a 5 digit number: ");
scanf("%d", &number);
}
}
return 0;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xe96(%rip), %rbx # 0x2004
leaq 0xe92(%rip), %r14 # 0x2007
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0xe97(%rip), %r15 # 0x2020
leaq 0x4(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1050
leaq 0xeb9(%rip), %r13 # 0x205b
xorl %ebp, %ebp
testb $0x1, %bpl
jne 0x1241
movl 0x4(%rsp), %eax
cmpl $0x2711, %eax # imm = 0x2711
jl 0x11c0
cmpl $0x1869e, %eax # imm = 0x1869E
jbe 0x11e4
movq %r13, %rdi
callq 0x1030
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1040
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1050
jmp 0x11a4
xorl %edx, %edx
movl $0x2710, %ecx # imm = 0x2710
divl %ecx
movl %eax, %esi
movl %edx, %eax
xorl %edx, %edx
movw $0x3e8, %cx # imm = 0x3E8
divw %cx
movl %eax, %ecx
movl %edx, %eax
xorl %edx, %edx
movw $0x64, %di
divw %di
movzwl %dx, %eax
movl %eax, 0x4(%rsp)
movzbl %al, %eax
movb $0xa, %dl
divb %dl
movzbl %ah, %edx
cmpl %edx, %esi
jne 0x122d
movzbl %al, %eax
cmpw %ax, %cx
jne 0x122d
leaq 0xdf8(%rip), %rdi # 0x2023
jmp 0x1234
leaq 0xe13(%rip), %rdi # 0x2047
callq 0x1030
movb $0x1, %bpl
jmp 0x11a4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /giannis20012001[P]CGeneralRepo/CStructuredProgrammingDev/PalindromeTester.c |
main | int main(int argc, char *argv[])
{
vector<string> arguments;
char *image = NULL;
int index;
// -O offset
unsigned long long globalOffset = 0;
// -s, specify the size to be read
unsigned int size = -1;
// -i, display information about the disk
bool infoFlag = false;
// -l, list directories in the given path
bool listFlag = false;
string listPath;
// -c, listing for a direct cluster
bool listClusterFlag = false;
unsigned int listCluster;
// -r, reads a file
bool readFlag = false;
string readPath;
// -R, reads from cluster file
bool clusterRead = false;
unsigned int cluster = 0;
// -d, lists deleted
bool listDeleted = false;
// -x: extract
bool extract = false;
string extractDirectory;
// -2: compare two fats
bool compare = false;
// -@: get the cluster address
bool address = false;
// -k: analysis the chains
bool chains = false;
// -b: backup the fats
bool backup = false;
bool patch = false;
string backupFile;
// -w: write next cluster
bool writeNext = false;
// -m: merge the FATs
bool merge = false;
// -v: value
bool hasValue = false;
unsigned int value;
// -t: FAT table to write or read
unsigned int table = 0;
// -S: write random data in unallocated sectors
bool scramble = false;
bool zero = false;
// -f: fix reachable
bool fixReachable = false;
// -e: entry hacking
bool entry = false;
string entryPath;
bool clusterProvided = false;
bool sizeProvided = false;
int attributes = 0;
bool attributesProvided = false;
// -k: entry finder
bool findEntry = false;
OutputFormatType outputFormat = Default;
// Parsing command line
while ((index = getopt(argc, argv, "il:L:r:R:s:dc:hx:2@:ob:p:w:v:mt:Sze:O:fk:a:F:")) != -1) {
switch (index) {
case 'a':
attributesProvided = true;
attributes = atoi(optarg);
break;
case 'k':
findEntry = true;
cluster = atoi(optarg);
break;
case 'f':
fixReachable = true;
break;
case 'O':
globalOffset = atoll(optarg);
break;
case 'e':
entry = true;
entryPath = string(optarg);
break;
case 'z':
zero = true;
break;
case 'S':
scramble = true;
break;
case 't':
table = ATOU(optarg);
break;
case 'm':
merge = true;
break;
case 'v':
hasValue = true;
value = ATOU(optarg);
break;
case 'w':
writeNext = true;
cluster = ATOU(optarg);
break;
case '@':
address = true;
cluster = ATOU(optarg);
break;
case 'o':
chains = true;
break;
case 'i':
infoFlag = true;
break;
case 'l':
listFlag = true;
listPath = string(optarg);
break;
case 'L':
listClusterFlag = true;
listCluster = ATOU(optarg);
break;
case 'r':
readFlag = true;
readPath = string(optarg);
break;
case 'R':
clusterRead = true;
cluster = ATOU(optarg);
break;
case 's':
size = ATOU(optarg);
sizeProvided = true;
break;
case 'd':
listDeleted = true;
break;
case 'c':
cluster = ATOU(optarg);
clusterProvided = true;
break;
case 'x':
extract = true;
extractDirectory = string(optarg);
break;
case '2':
compare = true;
break;
case 'b':
backup = true;
backupFile = string(optarg);
break;
case 'p':
patch = true;
backupFile = string(optarg);
break;
case 'h':
usage();
break;
case 'F':
if (strcmp(optarg, "json") == 0)
outputFormat = Json;
else if (strcmp(optarg, "default") == 0)
outputFormat = Default;
else
{
usage();
}
break;
}
}
// Trying to get the FAT file or device
if (optind != argc) {
image = argv[optind];
}
if (!image) {
usage();
}
// Getting extra arguments
for (index=optind+1; index<argc; index++) {
arguments.push_back(argv[index]);
}
// If the user did not required any actions
if (!(infoFlag || listFlag || listClusterFlag ||
readFlag || clusterRead || extract || compare || address ||
chains || backup || patch || writeNext || merge ||
scramble || zero || entry || fixReachable || findEntry)) {
usage();
}
try {
// Openning the image
FatSystem fat(image, globalOffset, outputFormat);
fat.setListDeleted(listDeleted);
if (fat.init()) {
if (infoFlag) {
fat.infos();
} else if (listFlag) {
if (outputFormat != Json)
cout << "Listing path " << listPath << endl;
FatPath path(listPath);
fat.list(path);
} else if (listClusterFlag) {
if (outputFormat != Json)
cout << "Listing cluster " << listCluster << endl;
fat.list(listCluster);
} else if (readFlag) {
FatPath path(readPath);
fat.readFile(path);
} else if (clusterRead) {
fat.readFile(cluster, size);
} else if (extract) {
FatExtract extract(fat);
extract.extract(cluster, extractDirectory, listDeleted);
} else if (compare) {
FatDiff diff(fat);
diff.compare();
} else if (address) {
cout << "Cluster " << cluster << " address:" << endl;
long long addr = fat.clusterAddress(cluster);
printf("%llu (%016llx)\n", addr, addr);
cout << "Next cluster:" << endl;
int next1 = fat.nextCluster(cluster, 0);
int next2 = fat.nextCluster(cluster, 1);
printf("FAT1: %u (%08x)\n", next1, next1);
printf("FAT2: %u (%08x)\n", next2, next2);
bool isContiguous = false;
FatChains chains(fat);
unsigned long long size = chains.chainSize(cluster, &isContiguous);
printf("Chain size: %llu (%llu / %s)\n", size, size*fat.bytesPerCluster, prettySize(size*fat.bytesPerCluster).c_str());
if (isContiguous) {
printf("Chain is contiguous\n");
} else {
printf("Chain is not contiguous\n");
}
} else if (chains) {
FatChains chains(fat);
chains.chainsAnalysis();
} else if (fixReachable) {
FatFix fix(fat);
fix.fix();
} else if (findEntry) {
FatSearch search(fat);
search.search(cluster);
} else if (backup || patch) {
FatBackup backupSystem(fat);
if (backup) {
backupSystem.backup(backupFile, table);
} else {
backupSystem.patch(backupFile, table);
}
} else if (writeNext) {
if (!hasValue) {
throw string("You should provide a value with -v");
}
int prev = fat.nextCluster(cluster);
printf("Writing next cluster of %u from %u to %u\n", cluster, prev, value);
fat.enableWrite();
if (table == 0 || table == 1) {
printf("Writing on FAT1\n");
fat.writeNextCluster(cluster, value, 0);
}
if (table == 0 || table == 2) {
printf("Writing on FAT2\n");
fat.writeNextCluster(cluster, value, 1);
}
} else if (merge) {
FatDiff diff(fat);
diff.merge();
} else if (scramble) {
fat.enableWrite();
fat.rewriteUnallocated(1);
} else if (zero) {
fat.enableWrite();
fat.rewriteUnallocated();
} else if (entry) {
cout << "Searching entry for " << entryPath << endl;
FatPath path(entryPath);
FatEntry entry;
if (fat.findFile(path, entry)) {
printf("Entry address %016llx\n", entry.address);
printf("Attributes %02X\n", entry.attributes);
cout << "Found entry, cluster=" << entry.cluster;
if (entry.isDirectory()) {
cout << ", directory";
} else {
cout << ", file with size=" << entry.size << " (" << prettySize(entry.size) << ")";
}
cout << endl;
if (clusterProvided) {
cout << "Setting the cluster to " << cluster << endl;
entry.cluster = cluster;
}
if (sizeProvided) {
cout << "Setting the size to " << size << endl;
entry.size = size&0xffffffff;
}
if (attributesProvided) {
cout << "Setting attributes to " << attributes << endl;
entry.attributes = attributes;
}
if (clusterProvided || sizeProvided || attributesProvided) {
entry.updateData();
fat.enableWrite();
string data = entry.data;
fat.writeData(entry.address, data.c_str(), entry.data.size());
}
} else {
cerr << "Entry not found." << endl;
exit(EXIT_FAILURE);
}
}
} else {
cerr << "! Failed to init the FAT filesystem" << endl;
exit(EXIT_FAILURE);
}
} catch (string error) {
cerr << "Error: " << error << endl;
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x508, %rsp # imm = 0x508
movq %rsi, %r15
movl %edi, %r12d
xorps %xmm0, %xmm0
movaps %xmm0, 0x1d0(%rsp)
andq $0x0, 0x1e0(%rsp)
leaq 0x220(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %edx, %edx
movb %dl, (%rax)
leaq 0x480(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x460(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rax)
movb %dl, (%rcx)
leaq 0x1c0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x200(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rax)
movq $0x0, 0x40(%rsp)
movb %dl, (%rcx)
pushq $-0x1
popq %rax
movl %eax, 0xc(%rsp)
leaq 0xab15(%rip), %r13 # 0x16733
leaq 0xa3df(%rip), %rbp # 0x16004
movq $0x0, 0x58(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x60(%rsp)
xorl %ebx, %ebx
movq $0x0, 0xc0(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x70(%rsp)
movq $0x0, 0x80(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x88(%rsp)
movq $0x0, 0x90(%rsp)
movq $0x0, 0xc8(%rsp)
movl $0x0, (%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x98(%rsp)
movq $0x0, 0x78(%rsp)
movq $0x0, 0x50(%rsp)
movq $0x0, 0xa8(%rsp)
movq $0x0, 0xa0(%rsp)
movl $0x0, 0x10(%rsp)
movq $0x0, 0xd0(%rsp)
movq $0x0, 0x68(%rsp)
movl $0x0, 0x4(%rsp)
movq $0x0, 0xb0(%rsp)
movq $0x0, 0xb8(%rsp)
movl %r12d, %edi
movq %r15, %rsi
movq %r13, %rdx
callq 0xb0b0
leal -0x40(%rax), %ecx
cmpl $0x3a, %ecx
ja 0xbd68
movslq (%rbp,%rcx,4), %rax
addq %rbp, %rax
jmpq *%rax
movq 0x1125b(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, %ebx
movb $0x1, %al
movq %rax, 0x70(%rsp)
jmp 0xbd2e
cmpl $0x32, %eax
je 0xc118
cmpl $-0x1, %eax
jne 0xbd2e
jmp 0xc124
movb $0x1, %al
movq %rax, 0x98(%rsp)
jmp 0xbd2e
movq 0x11222(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, %ebx
movb $0x1, %al
movq %rax, 0x68(%rsp)
jmp 0xbd2e
movq 0x11208(%rip), %rax # 0x1cfb0
movq (%rax), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0xcef2
leaq 0x450(%rsp), %rdi
leaq 0x2d0(%rsp), %r14
movq %r14, %rsi
callq 0xb380
movq %r14, %rdi
callq 0xb578
movb $0x1, %al
movq %rax, 0x38(%rsp)
jmp 0xbd2e
movb $0x1, %al
movq %rax, 0xb0(%rsp)
jmp 0xbd2e
movq 0x111ae(%rip), %rax # 0x1cfb0
movq (%rax), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0xcef2
leaq 0x1b0(%rsp), %rdi
leaq 0x2d0(%rsp), %r14
movq %r14, %rsi
callq 0xb380
movq %r14, %rdi
callq 0xb578
movb $0x1, %al
movq %rax, 0x48(%rsp)
jmp 0xbd2e
movq 0x11163(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, 0x8(%rsp)
movb $0x1, %al
movq %rax, 0xc8(%rsp)
jmp 0xbd2e
movq 0x11141(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, %ebx
movb $0x1, %al
movq %rax, 0xa8(%rsp)
jmp 0xbd2e
movq 0x11121(%rip), %rax # 0x1cfb0
movq (%rax), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0xcef2
leaq 0x1b0(%rsp), %rdi
leaq 0x2d0(%rsp), %r14
movq %r14, %rsi
callq 0xb380
movq %r14, %rdi
callq 0xb578
movb $0x1, %al
movq %rax, 0x18(%rsp)
jmp 0xbd2e
movb $0x1, %al
movq %rax, 0x90(%rsp)
jmp 0xbd2e
movq 0x110c7(%rip), %rax # 0x1cfb0
movq (%rax), %r14
leaq 0xa86e(%rip), %rsi # 0x16761
movq %r14, %rdi
callq 0xb3e0
pushq $0x1
popq %rcx
movl %ecx, 0x4(%rsp)
testl %eax, %eax
je 0xbd2e
leaq 0xa855(%rip), %rsi # 0x16766
movq %r14, %rdi
callq 0xb3e0
movl $0x0, 0x4(%rsp)
testl %eax, %eax
je 0xbd2e
jmp 0xc13c
movq 0x1107b(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb260
movq %rax, 0xb8(%rsp)
jmp 0xbd2e
movb $0x1, %al
movq %rax, 0x20(%rsp)
jmp 0xbd2e
movq 0x11053(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, %ebx
movb $0x1, %al
movq %rax, 0x60(%rsp)
jmp 0xbd2e
movq 0x11036(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, 0x14(%rsp)
movb $0x1, %al
movq %rax, 0x58(%rsp)
jmp 0xbd2e
movq 0x11017(%rip), %rax # 0x1cfb0
movq (%rax), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0xcef2
leaq 0x1f0(%rsp), %rdi
leaq 0x2d0(%rsp), %r14
movq %r14, %rsi
callq 0xb380
movq %r14, %rdi
callq 0xb578
movb $0x1, %al
movq %rax, 0x50(%rsp)
jmp 0xbd2e
movq 0x10fcc(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, 0x10(%rsp)
movb $0x1, %al
movq %rax, 0xd0(%rsp)
jmp 0xbd2e
movb $0x1, %al
movq %rax, 0xc0(%rsp)
jmp 0xbd2e
movb $0x1, %al
movq %rax, 0x78(%rsp)
jmp 0xbd2e
movq 0x10f8f(%rip), %rax # 0x1cfb0
movq (%rax), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0xcef2
leaq 0x210(%rsp), %rdi
leaq 0x2d0(%rsp), %r14
movq %r14, %rsi
callq 0xb380
movq %r14, %rdi
callq 0xb578
movb $0x1, %al
movq %rax, 0x40(%rsp)
jmp 0xbd2e
movq 0x10f44(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, 0xc(%rsp)
movb $0x1, %al
movq %rax, 0xa0(%rsp)
jmp 0xbd2e
movb $0x1, %al
movq %rax, 0x80(%rsp)
jmp 0xbd2e
movq 0x10f13(%rip), %rax # 0x1cfb0
movq (%rax), %rsi
leaq 0x2d0(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0xcef2
leaq 0x470(%rsp), %rdi
leaq 0x2d0(%rsp), %r14
movq %r14, %rsi
callq 0xb380
movq %r14, %rdi
callq 0xb578
movb $0x1, %al
movq %rax, 0x30(%rsp)
jmp 0xbd2e
movq 0x10ec8(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, %ebx
movb $0x1, %al
movq %rax, 0x88(%rsp)
jmp 0xbd2e
movq 0x10ea8(%rip), %rax # 0x1cfb0
movq (%rax), %rdi
callq 0xb450
movl %eax, (%rsp)
jmp 0xbd2e
movb $0x1, %al
movq %rax, 0x28(%rsp)
jmp 0xbd2e
movq 0x10ea5(%rip), %rax # 0x1cfd0
movslq (%rax), %rbp
cmpl %r12d, %ebp
je 0xc13c
movq (%r15,%rbp,8), %rax
testq %rax, %rax
jne 0xc141
callq 0xb84c
movq %rax, 0x1a8(%rsp)
movslq %r12d, %r12
incq %rbp
leaq 0x2d0(%rsp), %r14
leaq 0x1d0(%rsp), %r13
cmpq %r12, %rbp
jge 0xc190
movq (%r15,%rbp,8), %rsi
movq %r14, %rdi
leaq 0xf8(%rsp), %rdx
callq 0xcef2
movq %r13, %rdi
movq %r14, %rsi
callq 0xd20a
movq %r14, %rdi
callq 0xb578
incq %rbp
jmp 0xc15f
testb $0x1, 0xb0(%rsp)
movq 0x1a8(%rsp), %rsi
jne 0xc231
testb $0x1, 0x40(%rsp)
jne 0xc231
testb $0x1, 0x58(%rsp)
jne 0xc231
testb $0x1, 0x30(%rsp)
jne 0xc231
testb $0x1, 0x60(%rsp)
jne 0xc231
testb $0x1, 0x38(%rsp)
jne 0xc231
testb $0x1, 0x28(%rsp)
jne 0xc231
testb $0x1, 0x70(%rsp)
jne 0xc231
testb $0x1, 0x80(%rsp)
jne 0xc231
testb $0x1, 0x18(%rsp)
jne 0xc231
testb $0x1, 0x48(%rsp)
jne 0xc231
testb $0x1, 0x88(%rsp)
jne 0xc231
testb $0x1, 0x90(%rsp)
jne 0xc231
testb $0x1, 0x20(%rsp)
jne 0xc231
testb $0x1, 0x98(%rsp)
jne 0xc231
testb $0x1, 0x50(%rsp)
jne 0xc231
testb $0x1, 0x78(%rsp)
jne 0xc231
testb $0x1, 0x68(%rsp)
je 0xc13c
leaq 0x2b0(%rsp), %rdi
leaq 0xf8(%rsp), %rdx
callq 0xcef2
leaq 0x2d0(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
movq 0xb8(%rsp), %rdx
movl 0x4(%rsp), %ecx
callq 0xe248
leaq 0x2b0(%rsp), %rdi
callq 0xb578
movzbl 0xc0(%rsp), %r14d
andl $0x1, %r14d
leaq 0x2d0(%rsp), %rdi
movl %r14d, %esi
callq 0x10ee0
leaq 0x2d0(%rsp), %rdi
callq 0xfcb4
testb %al, %al
je 0xc2cd
testb $0x1, 0xb0(%rsp)
je 0xc2ed
leaq 0x2d0(%rsp), %rdi
callq 0xfd78
leaq 0x2d0(%rsp), %rdi
callq 0xe626
xorl %edi, %edi
callq 0xb370
movq 0x10d1c(%rip), %rdi # 0x1cff0
leaq 0xa636(%rip), %rsi # 0x16911
callq 0xb2e0
movq %rax, %rdi
callq 0xb170
jmp 0xcd96
testb $0x1, 0x40(%rsp)
je 0xc37b
cmpl $0x0, 0x4(%rsp)
jne 0xc32a
movq 0x10cba(%rip), %rdi # 0x1cfc0
leaq 0xa461(%rip), %rsi # 0x1676e
callq 0xb2e0
leaq 0x210(%rsp), %rsi
movq %rax, %rdi
callq 0xb2b0
movq %rax, %rdi
callq 0xb170
leaq 0x290(%rsp), %rdi
leaq 0x210(%rsp), %rsi
callq 0xb3c0
leaq 0xf8(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0xdf6c
leaq 0x290(%rsp), %rdi
callq 0xb578
leaq 0x2d0(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0xf168
jmp 0xc41b
testb $0x1, 0x58(%rsp)
je 0xc3c6
cmpl $0x0, 0x4(%rsp)
jne 0xc3b0
movq 0x10c30(%rip), %rdi # 0x1cfc0
leaq 0xa3e5(%rip), %rsi # 0x1677c
callq 0xb2e0
movl 0x14(%rsp), %esi
movq %rax, %rdi
callq 0xb1e0
movq %rax, %rdi
callq 0xb170
leaq 0x2d0(%rsp), %rdi
movl 0x14(%rsp), %esi
callq 0xf446
jmp 0xc2b9
testb $0x1, 0x30(%rsp)
je 0xc42d
leaq 0x270(%rsp), %rdi
leaq 0x470(%rsp), %rsi
callq 0xb3c0
leaq 0xf8(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0xdf6c
leaq 0x270(%rsp), %rdi
callq 0xb578
leaq 0x2d0(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
xorl %edx, %edx
callq 0x10e22
leaq 0xf8(%rsp), %rdi
callq 0xcf2e
jmp 0xc2b9
testb $0x1, 0x60(%rsp)
je 0xc451
leaq 0x2d0(%rsp), %rdi
movl %ebx, %esi
movl 0xc(%rsp), %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xfafa
jmp 0xc2b9
testb $0x1, 0x38(%rsp)
je 0xc4bb
leaq 0xf8(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x1211c
leaq 0x250(%rsp), %rdi
leaq 0x450(%rsp), %rsi
callq 0xb3c0
leaq 0xf8(%rsp), %rdi
leaq 0x250(%rsp), %rdx
movl %ebx, %esi
movl %r14d, %ecx
callq 0x1237a
leaq 0x250(%rsp), %rdi
callq 0xb578
leaq 0xf8(%rsp), %rdi
callq 0xcf44
jmp 0xc2b9
testb $0x1, 0x28(%rsp)
je 0xc4e9
leaq 0xf8(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x11e8c
leaq 0xf8(%rsp), %rdi
callq 0x11e92
jmp 0xc2b9
movl %ebx, %r14d
testb $0x1, 0x70(%rsp)
je 0xc655
movq 0x10ac2(%rip), %rdi # 0x1cfc0
leaq 0xa288(%rip), %rsi # 0x1678d
callq 0xb2e0
movq %rax, %rdi
movq %r14, %rsi
callq 0xb1e0
leaq 0xa27a(%rip), %rsi # 0x16796
movq %rax, %rdi
callq 0xb2e0
movq %rax, %rdi
callq 0xb170
leaq 0x2d0(%rsp), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0xebba
leaq 0xa25c(%rip), %rdi # 0x167a0
movq %rax, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0xb050
movq 0x10a68(%rip), %rdi # 0x1cfc0
leaq 0xa251(%rip), %rsi # 0x167b0
callq 0xb2e0
movq %rax, %rdi
callq 0xb170
leaq 0x2d0(%rsp), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0xe474
movl %eax, %ebp
leaq 0x2d0(%rsp), %rdi
pushq $0x1
popq %rdx
movl %ebx, %esi
callq 0xe474
movl %eax, %r14d
leaq 0xa223(%rip), %rdi # 0x167be
movl %ebp, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0xb050
leaq 0xa222(%rip), %rdi # 0x167cf
movl %r14d, %esi
movl %r14d, %edx
xorl %eax, %eax
callq 0xb050
movb $0x0, 0xd8(%rsp)
leaq 0xf8(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x12710
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rdx
movl %ebx, %esi
callq 0x135cc
movslq %eax, %rbx
movq 0x3d8(%rsp), %r14
imulq %rbx, %r14
leaq 0x490(%rsp), %rdi
movq %r14, %rsi
callq 0xce36
leaq 0x490(%rsp), %r15
movq (%r15), %rcx
leaq 0xa1c1(%rip), %rdi # 0x167e0
movq %rbx, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0xb050
movq %r15, %rdi
callq 0xb578
leaq 0xa37e(%rip), %rax # 0x169b9
leaq 0xa35f(%rip), %rdi # 0x169a1
cmpb $0x0, 0xd8(%rsp)
cmovneq %rax, %rdi
callq 0xb440
jmp 0xc681
testb $0x1, 0x80(%rsp)
je 0xc693
leaq 0xf8(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x12710
leaq 0xf8(%rsp), %rdi
callq 0x12754
leaq 0xf8(%rsp), %rdi
callq 0xcf5c
jmp 0xc2b9
testb $0x1, 0x78(%rsp)
je 0xc6c1
leaq 0xf8(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x123fc
leaq 0xf8(%rsp), %rdi
callq 0x12412
jmp 0xc2b9
testb $0x1, 0x68(%rsp)
je 0xc6f1
leaq 0xf8(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x14be0
leaq 0xf8(%rsp), %rdi
movl %ebx, %esi
callq 0x14c02
jmp 0xc2b9
testb $0x1, 0x18(%rsp)
jne 0xc6ff
testb $0x1, 0x48(%rsp)
je 0xc74f
leaq 0xf8(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x11b24
testb $0x1, 0x18(%rsp)
je 0xc7fa
leaq 0x4e8(%rsp), %rbx
leaq 0x1b0(%rsp), %rsi
movq %rbx, %rdi
callq 0xb3c0
leaq 0xf8(%rsp), %rdi
movq %rbx, %rsi
movl (%rsp), %edx
callq 0x11b2a
jmp 0xc825
testb $0x1, 0x88(%rsp)
je 0xc832
testb $0x1, 0xc8(%rsp)
je 0xc863
leaq 0x2d0(%rsp), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0xe474
leaq 0xa09e(%rip), %rdi # 0x16821
movl %ebx, %esi
movl %eax, %edx
movl 0x8(%rsp), %ecx
xorl %eax, %eax
callq 0xb050
leaq 0x2d0(%rsp), %rdi
callq 0xe56c
cmpl $0x1, (%rsp)
ja 0xc7c6
leaq 0xa1d5(%rip), %rdi # 0x16981
callq 0xb440
leaq 0x2d0(%rsp), %rdi
movl %ebx, %esi
movl 0x8(%rsp), %edx
xorl %ecx, %ecx
callq 0xea6c
testl $0xfffffffd, (%rsp) # imm = 0xFFFFFFFD
jne 0xc2b9
leaq 0xa1b7(%rip), %rdi # 0x16991
callq 0xb440
leaq 0x2d0(%rsp), %rdi
pushq $0x1
popq %rcx
movl %ebx, %esi
movl 0x8(%rsp), %edx
callq 0xea6c
jmp 0xc2b9
leaq 0x4c8(%rsp), %rbx
leaq 0x1b0(%rsp), %rsi
movq %rbx, %rdi
callq 0xb3c0
leaq 0xf8(%rsp), %rdi
movq %rbx, %rsi
movl (%rsp), %edx
callq 0x11cd6
movq %rbx, %rdi
callq 0xb578
jmp 0xc2b9
testb $0x1, 0x90(%rsp)
je 0xc89b
leaq 0xf8(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x11e8c
leaq 0xf8(%rsp), %rdi
callq 0x11fe8
jmp 0xc2b9
pushq $0x20
popq %rdi
callq 0xb180
movq %rax, %r15
leaq 0x9f89(%rip), %rsi # 0x167fe
leaq 0xf8(%rsp), %rdx
movq %rax, %rdi
callq 0xcef2
leaq 0x103e4(%rip), %rsi # 0x1cc70
movq 0x10715(%rip), %rdx # 0x1cfa8
movq %r15, %rdi
callq 0xb4b0
testb $0x1, 0x20(%rsp)
jne 0xc8ac
testb $0x1, 0x98(%rsp)
je 0xc8d3
leaq 0x2d0(%rsp), %rdi
callq 0xe56c
movzbl 0x20(%rsp), %esi
andl $0x1, %esi
leaq 0x2d0(%rsp), %rdi
callq 0x10f34
jmp 0xc2b9
testb $0x1, 0x50(%rsp)
je 0xc2b9
movq 0x106db(%rip), %rdi # 0x1cfc0
leaq 0x9f5f(%rip), %rsi # 0x1684b
callq 0xb2e0
leaq 0x1f0(%rsp), %rsi
movq %rax, %rdi
callq 0xb2b0
movq %rax, %rdi
callq 0xb170
leaq 0x230(%rsp), %rdi
leaq 0x1f0(%rsp), %rsi
callq 0xb3c0
leaq 0x490(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0xdf6c
leaq 0x230(%rsp), %rdi
callq 0xb578
leaq 0xf8(%rsp), %rdi
callq 0xd3d4
leaq 0x2d0(%rsp), %rdi
leaq 0x490(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x10bec
testb %al, %al
je 0xc9e5
movq 0x178(%rsp), %rsi
leaq 0x9ee3(%rip), %rdi # 0x16860
xorl %eax, %eax
callq 0xb050
movsbl 0x138(%rsp), %esi
leaq 0x9ee4(%rip), %rdi # 0x16877
xorl %eax, %eax
callq 0xb050
movq 0x1061f(%rip), %rdi # 0x1cfc0
leaq 0x9ee0(%rip), %rsi # 0x16888
callq 0xb2e0
movl 0x13c(%rsp), %esi
movq %rax, %rdi
callq 0xb1e0
leaq 0xf8(%rsp), %rdi
callq 0xd7fc
testb %al, %al
je 0xca05
movq 0x105ec(%rip), %rdi # 0x1cfc0
leaq 0x9ec3(%rip), %rsi # 0x1689e
callq 0xb2e0
jmp 0xca7b
movq 0x10604(%rip), %rdi # 0x1cff0
leaq 0x9f0d(%rip), %rsi # 0x16900
callq 0xb2e0
movq %rax, %rdi
callq 0xb170
jmp 0xcd96
movq 0x105b4(%rip), %rdi # 0x1cfc0
leaq 0x9e97(%rip), %rsi # 0x168aa
callq 0xb2e0
movq 0x140(%rsp), %rsi
movq %rax, %rdi
callq 0xb1d0
leaq 0xaa9b(%rip), %rsi # 0x174ca
movq %rax, %rdi
callq 0xb2e0
movq %rax, %r15
movq 0x140(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
callq 0xce36
leaq 0xd8(%rsp), %rsi
movq %r15, %rdi
callq 0xb2b0
leaq 0xa6a3(%rip), %rsi # 0x17109
movq %rax, %rdi
callq 0xb2e0
leaq 0xd8(%rsp), %rdi
callq 0xb578
movq 0x1053e(%rip), %rdi # 0x1cfc0
callq 0xb170
testb $0x1, 0xa8(%rsp)
je 0xcabe
movq 0x10528(%rip), %rdi # 0x1cfc0
leaq 0x9e1d(%rip), %rsi # 0x168bc
callq 0xb2e0
movq %rax, %rdi
movq %r14, %rsi
callq 0xb1e0
movq %rax, %rdi
callq 0xb170
movl %ebx, 0x13c(%rsp)
testb $0x1, 0xa0(%rsp)
je 0xcafa
movq 0x104f1(%rip), %rdi # 0x1cfc0
leaq 0x9dfe(%rip), %rsi # 0x168d4
callq 0xb2e0
movl 0xc(%rsp), %ebx
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb1e0
movq %rax, %rdi
callq 0xb170
movq %rbx, 0x140(%rsp)
testb $0x1, 0xd0(%rsp)
je 0xcb38
movq 0x104b5(%rip), %rdi # 0x1cfc0
leaq 0x9dd7(%rip), %rsi # 0x168e9
callq 0xb2e0
movq %rax, %rdi
movl 0x10(%rsp), %esi
callq 0xb4c0
movq %rax, %rdi
callq 0xb170
movl 0x10(%rsp), %eax
movb %al, 0x138(%rsp)
jmp 0xcb4b
movq 0xa8(%rsp), %rax
orb 0xa0(%rsp), %al
testb $0x1, %al
je 0xcbab
leaq 0xf8(%rsp), %rdi
callq 0xd474
leaq 0x2d0(%rsp), %rdi
callq 0xe56c
leaq 0x188(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
callq 0xb3c0
movq 0x178(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movl 0x190(%rsp), %ecx
leaq 0x2d0(%rsp), %rdi
callq 0xe6f2
leaq 0xd8(%rsp), %rdi
callq 0xb578
leaq 0xf8(%rsp), %rdi
callq 0xcf76
leaq 0x490(%rsp), %rdi
jmp 0xc423
jmp 0xcbcb
jmp 0xcbe0
jmp 0xcbe0
movq %rdx, %r14
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0xb578
jmp 0xcbe6
movq %rdx, %r14
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0xcf76
jmp 0xcbfb
movq %rdx, %r14
movq %rax, %rbx
leaq 0x490(%rsp), %rdi
jmp 0xccf1
movq %rdx, %r14
movq %rax, %rbx
leaq 0x230(%rsp), %rdi
jmp 0xcd08
jmp 0xcd11
jmp 0xcc8a
jmp 0xcc8a
jmp 0xcd11
jmp 0xcd11
jmp 0xcd11
movq %rdx, %r14
movq %rax, %rbx
movq %r15, %rdi
callq 0xb220
jmp 0xcd17
jmp 0xcd11
jmp 0xcd11
movq %rdx, %r14
movq %rax, %rbx
leaq 0x4c8(%rsp), %rdi
jmp 0xcd08
movq %rdx, %r14
movq %rax, %rbx
leaq 0x4e8(%rsp), %rdi
jmp 0xcd08
jmp 0xcd11
jmp 0xcd11
jmp 0xcd11
jmp 0xcd11
movq %rdx, %r14
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0xcf5c
jmp 0xcd17
jmp 0xcd11
jmp 0xcd11
movq %rdx, %r14
movq %rax, %rbx
leaq 0x250(%rsp), %rdi
callq 0xb578
jmp 0xccbe
movq %rdx, %r14
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0xcf44
jmp 0xcd17
jmp 0xcd11
jmp 0xcd11
jmp 0xcce3
movq %rdx, %r14
movq %rax, %rbx
leaq 0x270(%rsp), %rdi
jmp 0xcd08
movq %rdx, %r14
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0xcf2e
jmp 0xcd17
jmp 0xcd11
movq %rdx, %r14
movq %rax, %rbx
leaq 0x290(%rsp), %rdi
callq 0xb578
jmp 0xcd17
jmp 0xcd11
movq %rdx, %r14
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
callq 0xe626
jmp 0xcd41
movq %rdx, %r14
movq %rax, %rbx
leaq 0x2b0(%rsp), %rdi
callq 0xb578
jmp 0xcd41
movq %rdx, %r14
movq %rax, %rbx
cmpl $0x1, %r14d
jne 0xcde0
movq %rbx, %rdi
callq 0xb390
leaq 0x2d0(%rsp), %rdi
movq %rax, %rsi
callq 0xb3c0
movq %rbx, %rdi
callq 0xb130
movq 0x1027e(%rip), %rdi # 0x1cff0
leaq 0x9bbc(%rip), %rsi # 0x16935
callq 0xb2e0
leaq 0x2d0(%rsp), %rsi
movq %rax, %rdi
callq 0xb2b0
movq %rax, %rdi
callq 0xb170
pushq $0x1
popq %rdi
callq 0xb370
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
callq 0xb578
callq 0xb4a0
jmp 0xcde0
movq %rax, %rdi
callq 0xcf98
movq %rax, %rbx
leaq 0x2d0(%rsp), %rdi
callq 0xb578
jmp 0xcde0
jmp 0xcddd
jmp 0xcddd
jmp 0xcddd
jmp 0xcddd
jmp 0xcddd
jmp 0xcddd
jmp 0xcddd
movq %rax, %rbx
leaq 0x1f0(%rsp), %rdi
callq 0xb578
leaq 0x1b0(%rsp), %rdi
callq 0xb578
leaq 0x450(%rsp), %rdi
callq 0xb578
leaq 0x470(%rsp), %rdi
callq 0xb578
leaq 0x210(%rsp), %rdi
callq 0xb578
leaq 0x1d0(%rsp), %rdi
callq 0xcfa4
movq %rbx, %rdi
callq 0xb4d0
| /Gregwar[P]fatcat/src/fatcat.cpp |
FatEntry::isCorrect() | bool FatEntry::isCorrect()
{
if (attributes && !(attributes&FAT_ATTRIBUTES_DIR) && !(attributes&FAT_ATTRIBUTES_FILE)) {
return false;
}
if (isDirectory() && cluster == 0 && getFilename()!="..") {
return false;
}
for (int i=1; i<11; i++) {
if (printable(data[i])) {
return true;
}
}
return false;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movb 0x40(%rdi), %al
testb %al, %al
setne %cl
testb $0x30, %al
sete %dl
testb %dl, %cl
je 0xd867
xorl %ebx, %ebx
jmp 0xd8c9
movq %rdi, %rbx
testb $0x10, %al
je 0xd8a4
cmpl $0x0, 0x44(%rbx)
jne 0xd8a4
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd4ea
leaq 0x9e77(%rip), %rsi # 0x17702
movq %r14, %rdi
callq 0xd8eb
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0xb578
testb %bpl, %bpl
jne 0xd863
movq 0x90(%rbx), %r14
pushq $0x1
popq %r15
cmpq $0xb, %r15
setne %bl
je 0xd8c9
movzbl (%r14,%r15), %esi
callq 0xd838
incq %r15
testb %al, %al
je 0xd8af
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb578
movq %rbx, %rdi
callq 0xb4d0
| /Gregwar[P]fatcat/src/core/FatEntry.cpp |
FatSystem::enableCache() | void FatSystem::enableCache()
{
if (!cacheEnabled) {
cout << "Computing FAT cache..." << endl;
for (int cluster=0; cluster<totalClusters; cluster++) {
cache[cluster] = nextCluster(cluster);
}
cacheEnabled = true;
}
} | cmpb $0x0, 0x130(%rdi)
jne 0xe472
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xebb2(%rip), %rdi # 0x1cfc0
leaq 0x862b(%rip), %rsi # 0x16a40
callq 0xb2e0
movq %rax, %rdi
callq 0xb170
leaq 0x138(%rbx), %r14
xorl %esi, %esi
leaq 0x4(%rsp), %r15
movl %esi, 0x4(%rsp)
movslq %esi, %rax
cmpq %rax, 0x128(%rbx)
jbe 0xe461
movq %rbx, %rdi
xorl %edx, %edx
callq 0xe474
movl %eax, %ebp
movq %r14, %rdi
movq %r15, %rsi
callq 0x11034
movl %ebp, (%rax)
movl 0x4(%rsp), %esi
incl %esi
jmp 0xe430
movb $0x1, 0x130(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
| /Gregwar[P]fatcat/src/core/FatSystem.cpp |
FatSystem::enableWrite() | void FatSystem::enableWrite()
{
close(fd);
fd = open(filename.c_str(), O_RDWR|O_LARGEFILE);
if (fd < 0) {
ostringstream oss;
oss << "! Unable to open the input file: " << filename << " for writing";
throw oss.str();
}
writeMode = true;
} | pushq %r14
pushq %rbx
subq $0x178, %rsp # imm = 0x178
movq %rdi, %rbx
movl 0x28(%rdi), %edi
callq 0xb560
movq (%rbx), %rdi
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0xb230
movl %eax, 0x28(%rbx)
testl %eax, %eax
js 0xe5a4
movb $0x1, 0x2c(%rbx)
addq $0x178, %rsp # imm = 0x178
popq %rbx
popq %r14
retq
movq %rsp, %r14
movq %r14, %rdi
callq 0xb3b0
leaq 0x845b(%rip), %rsi # 0x16a11
movq %r14, %rdi
callq 0xb2e0
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb2b0
leaq 0x8487(%rip), %rsi # 0x16a57
movq %rax, %rdi
callq 0xb2e0
pushq $0x20
popq %rdi
callq 0xb180
movq %rax, %rbx
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xb470
leaq 0xe679(%rip), %rsi # 0x1cc70
movq 0xe9aa(%rip), %rdx # 0x1cfa8
movq %rbx, %rdi
callq 0xb4b0
movq %rax, %r14
movq %rbx, %rdi
callq 0xb220
jmp 0xe616
movq %rax, %r14
movq %rsp, %rdi
callq 0xb0c0
movq %r14, %rdi
callq 0xb4d0
| /Gregwar[P]fatcat/src/core/FatSystem.cpp |
adjust_freqs(std::array<unsigned long, 256ul> const&) | std::array<uint16_t, constants::MAX_SIGMA> adjust_freqs(
const std::array<uint64_t, constants::MAX_SIGMA>& freqs)
{
std::array<uint16_t, constants::MAX_SIGMA> adj_freqs { 0 };
size_t uniq_syms = 0;
size_t initial_sum = 0;
for (size_t i = 0; i < constants::MAX_SIGMA; i++) {
initial_sum += freqs[i];
uniq_syms += freqs[i] != 0;
}
size_t target_frame_size = uniq_syms * constants::FRAME_FACTOR;
if (target_frame_size > constants::MAX_FRAME_SIZE) {
target_frame_size = constants::MAX_FRAME_SIZE;
}
if (!is_power_of_two(target_frame_size)) {
target_frame_size = next_power_of_two(target_frame_size);
}
double c = double(target_frame_size) / double(initial_sum);
size_t cur_frame_size = std::numeric_limits<uint64_t>::max();
double fudge = 1.0;
while (cur_frame_size > target_frame_size) {
fudge -= 0.01;
cur_frame_size = 0;
for (size_t sym = 0; sym < constants::MAX_SIGMA; sym++) {
adj_freqs[sym] = (fudge * double(freqs[sym]) * c);
if (adj_freqs[sym] == 0 && freqs[sym] != 0)
adj_freqs[sym] = 1;
cur_frame_size += adj_freqs[sym];
}
}
int64_t excess = target_frame_size - cur_frame_size;
for (size_t sym = 0; sym < constants::MAX_SIGMA; sym++) {
auto ncnt = adj_freqs[constants::MAX_SIGMA - sym - 1];
if (ncnt == 0)
continue;
double ratio = double(excess) / double(cur_frame_size);
size_t adder = size_t(ratio * double(ncnt));
if (adder > excess) {
adder = excess;
}
excess -= adder;
cur_frame_size -= ncnt;
adj_freqs[constants::MAX_SIGMA - sym - 1] += adder;
}
if (excess != 0) {
size_t max_freq = 0;
size_t max_sym = 0;
for (size_t sym = 0; sym < constants::MAX_SIGMA; sym++) {
if (adj_freqs[sym] > max_freq) {
max_freq = adj_freqs[sym];
max_sym = sym;
}
}
adj_freqs[max_sym] += excess;
}
return adj_freqs;
} | vxorpd %xmm0, %xmm0, %xmm0
movq %rdi, %rax
xorl %ecx, %ecx
xorl %edx, %edx
vmovupd %zmm0, 0x1c0(%rdi)
vmovupd %zmm0, 0x180(%rdi)
vmovupd %zmm0, 0x140(%rdi)
vmovupd %zmm0, 0x100(%rdi)
vmovupd %zmm0, 0xc0(%rdi)
vmovupd %zmm0, 0x80(%rdi)
vmovupd %zmm0, 0x40(%rdi)
vmovupd %zmm0, (%rdi)
xorl %edi, %edi
cmpq $0x100, %rdi # imm = 0x100
je 0x311bd
movq (%rsi,%rdi,8), %r8
addq %r8, %rcx
cmpq $0x1, %r8
sbbq $-0x1, %rdx
incq %rdi
jmp 0x311a0
shlq $0x6, %rdx
movl $0x1000, %edi # imm = 0x1000
cmpq %rdi, %rdx
cmovbq %rdx, %rdi
popcntl %edi, %r8d
cmpl $0x1, %r8d
je 0x311ef
lzcntq %rdi, %rdi
negb %dil
testq %rdx, %rdx
pushq $0x1
popq %rdx
shlxq %rdi, %rdx, %rdi
cmoveq %rdx, %rdi
vcvtsi2sd %rdi, %xmm1, %xmm0
vcvtusi2sd %rcx, %xmm1, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vmovsd 0x1ee2a(%rip), %xmm1 # 0x50030
pushq $-0x1
popq %rcx
vmovsd 0x1ee27(%rip), %xmm2 # 0x50038
pushq $0x1
popq %r8
movq %rdi, %rdx
subq %rcx, %rdx
jae 0x31267
vaddsd %xmm2, %xmm1, %xmm1
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x100, %rdx # imm = 0x100
je 0x31215
movq (%rsi,%rdx,8), %r9
movl %r8d, %r11d
vcvtusi2sd %r9, %xmm4, %xmm3
vmulsd %xmm3, %xmm1, %xmm3
vmulsd %xmm3, %xmm0, %xmm3
vcvttsd2si %xmm3, %r10d
testw %r10w, %r10w
cmovnel %r10d, %r11d
testq %r9, %r9
cmovel %r10d, %r11d
movzwl %r11w, %r9d
movw %r11w, (%rax,%rdx,2)
incq %rdx
addq %r9, %rcx
jmp 0x31225
movl $0xff, %esi
cmpq $-0x1, %rsi
je 0x312b2
movzwl (%rax,%rsi,2), %edi
testq %rdi, %rdi
je 0x312ad
vcvtsi2sd %rdx, %xmm3, %xmm0
vcvtusi2sd %rcx, %xmm3, %xmm1
vdivsd %xmm1, %xmm0, %xmm0
vcvtsi2sd %edi, %xmm3, %xmm1
vmulsd %xmm1, %xmm0, %xmm0
vcvttsd2usi %xmm0, %r8
cmpq %r8, %rdx
cmovbq %rdx, %r8
subq %rdi, %rcx
subq %r8, %rdx
addl %edi, %r8d
movw %r8w, (%rax,%rsi,2)
decq %rsi
jmp 0x3126c
testq %rdx, %rdx
je 0x312df
xorl %ecx, %ecx
xorl %esi, %esi
xorl %edi, %edi
cmpq $0x100, %rdi # imm = 0x100
je 0x312db
movzwl (%rax,%rdi,2), %r8d
cmpq %r8, %rcx
cmovbeq %r8, %rcx
cmovbq %rdi, %rsi
incq %rdi
jmp 0x312bd
addw %dx, (%rax,%rsi,2)
vzeroupper
retq
| /mpetri[P]ans-large-alphabet/include/ans_byte.hpp |
ans_msb_compress(unsigned char*, unsigned long, unsigned int const*, unsigned long) | size_t ans_msb_compress(
uint8_t* dst, size_t dstCapacity, const uint32_t* src, size_t srcSize)
{
const uint32_t num_states = 4;
#ifdef RECORD_STATS
auto start_compress = std::chrono::high_resolution_clock::now();
#endif
auto in_u32 = reinterpret_cast<const uint32_t*>(src);
auto ans_frame = ans_msb_encode::create(in_u32, srcSize);
uint8_t* out_u8 = reinterpret_cast<uint8_t*>(dst);
// serialize model
ans_frame.serialize(out_u8);
std::array<uint64_t, num_states> states;
// start encoding
for (uint32_t i = 0; i < num_states; i++)
states[i] = ans_frame.initial_state();
#ifdef RECORD_STATS
auto stop_prelude = std::chrono::high_resolution_clock::now();
get_stats().prelude_bytes = out_u8 - reinterpret_cast<uint8_t*>(dst);
get_stats().prelude_time_ns = (stop_prelude - start_compress).count();
#endif
size_t cur_sym = 0;
while ((srcSize - cur_sym) % num_states != 0) {
ans_frame.encode_symbol(
states[0], in_u32[srcSize - cur_sym - 1], out_u8);
cur_sym += 1;
}
while (cur_sym != srcSize) {
ans_frame.encode_symbol(
states[0], in_u32[srcSize - cur_sym - 1], out_u8);
ans_frame.encode_symbol(
states[1], in_u32[srcSize - cur_sym - 2], out_u8);
ans_frame.encode_symbol(
states[2], in_u32[srcSize - cur_sym - 3], out_u8);
ans_frame.encode_symbol(
states[3], in_u32[srcSize - cur_sym - 4], out_u8);
cur_sym += num_states;
}
// flush final state
for (uint32_t i = 0; i < num_states; i++)
ans_frame.flush_state(states[i], out_u8);
#ifdef RECORD_STATS
auto stop_compress = std::chrono::high_resolution_clock::now();
get_stats().encode_bytes = (out_u8 - reinterpret_cast<uint8_t*>(dst))
- get_stats().prelude_bytes;
get_stats().encode_time_ns = (stop_compress - stop_prelude).count();
#endif
return out_u8 - reinterpret_cast<uint8_t*>(dst);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
leaq 0x38(%rsp), %rbx
movq %rdi, %r12
movq %rcx, %r14
movq %rdx, %r15
movq %rdx, %rsi
movq %rcx, %rdx
movq %rbx, %rdi
callq 0x33988
leaq 0x8(%rsp), %rsi
movq %r12, (%rsi)
movq %rbx, %rdi
callq 0x33ae0
movq 0x70(%rsp), %rax
xorl %ecx, %ecx
cmpq $0x4, %rcx
je 0x319eb
movq %rax, 0x18(%rsp,%rcx,8)
incq %rcx
jmp 0x319db
movl %r14d, %ebp
andl $0x3, %ebp
leaq -0x4(%r15,%r14,4), %rbx
leaq 0x8(%rsp), %r13
movq %r12, 0x10(%rsp)
xorl %r12d, %r12d
negq %rbp
cmpq %r12, %rbp
je 0x31a26
movl (%rbx,%r12,4), %edx
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %r13, %rcx
callq 0x33aec
decq %r12
jmp 0x31a06
leaq 0x30(%rsp), %rbp
andq $-0x4, %r14
leaq 0x38(%rsp), %rbx
leaq 0x18(%rsp), %r12
leaq 0x8(%rsp), %r13
testq %r14, %r14
je 0x31a99
movl -0x4(%r15,%r14,4), %edx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rcx
callq 0x33aec
movl -0x8(%r15,%r14,4), %edx
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
movq %r13, %rcx
callq 0x33aec
movl -0xc(%r15,%r14,4), %edx
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
movq %r13, %rcx
callq 0x33aec
movl -0x10(%r15,%r14,4), %edx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rcx
callq 0x33aec
addq $-0x4, %r14
jmp 0x31a3e
movq 0x8(%rsp), %rbx
movq 0x10(%rsp), %rdx
xorl %eax, %eax
cmpq $0x20, %rax
je 0x31abf
movq 0x18(%rsp,%rax), %rcx
subq 0x70(%rsp), %rcx
movq %rcx, (%rbx,%rax)
addq $0x8, %rax
jmp 0x31aa5
subq %rdx, %rbx
leaq 0x38(%rsp), %rdi
addq %rax, %rbx
callq 0x33b4e
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x38(%rsp), %rdi
movq %rax, %rbx
callq 0x33b4e
movq %rbx, %rdi
callq 0x2e800
| /mpetri[P]ans-large-alphabet/include/ans_msb.hpp |
ans_smsb_decode::load(unsigned char const*) | static ans_smsb_decode load(const uint8_t* in_u8)
{
ans_smsb_decode model;
model.nfreqs = ans_load_interp(in_u8);
model.frame_size = std::accumulate(
std::begin(model.nfreqs), std::end(model.nfreqs), 0);
model.frame_mask = model.frame_size - 1;
model.frame_log2 = log2(model.frame_size);
model.table.resize(model.frame_size);
auto max_sym = model.nfreqs.size() - 1;
uint64_t tmp = constants::K * constants::RADIX;
uint32_t cur_base = 0;
for (size_t sym = 0; sym <= max_sym; sym++) {
auto cur_freq = model.nfreqs[sym];
for (uint32_t k = 0; k < cur_freq; k++) {
uint32_t except_bytes = ans_smsb_exception_bytes(sym);
model.table[cur_base + k].freq = cur_freq;
model.table[cur_base + k].mapped_num
= ans_smsb_undo_mapping(sym) + (except_bytes << 30);
model.table[cur_base + k].offset = k;
}
cur_base += model.nfreqs[sym];
}
model.lower_bound = constants::K * model.frame_size;
return model;
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
vxorpd %xmm0, %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movq %rdi, %rbx
vmovupd %xmm0, (%rdi)
andq $0x0, 0x48(%rdi)
vmovupd %xmm0, 0x38(%rdi)
leaq 0x30(%rsp), %rdi
movq %rbx, 0x8(%rsp)
callq 0x30ce0
leaq 0x38(%rbx), %rax
leaq 0x30(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, 0x10(%rsp)
callq 0x384e0
movq %r15, %rdi
callq 0x36d6c
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
xorl %ecx, %ecx
cmpq %rdx, %rax
je 0x34014
addl (%rax), %ecx
addq $0x4, %rax
jmp 0x34007
movslq %ecx, %rax
vcvtusi2sd %rax, %xmm1, %xmm0
leaq -0x1(%rax), %rcx
movq %rax, 0x18(%rbx)
movq %rcx, 0x20(%rbx)
callq 0x2e820
vcvttsd2usi %xmm0, %rax
movq %rax, 0x28(%rbx)
movq 0x18(%rbx), %rsi
movq 0x10(%rsp), %rdi
callq 0x364ea
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
xorl %edx, %edx
subq %rax, %rcx
movq %rax, 0x20(%rsp)
sarq $0x2, %rcx
movq %rcx, 0x28(%rsp)
xorl %ecx, %ecx
cmpq 0x28(%rsp), %rdx
je 0x34105
xorl %r14d, %r14d
cmpl $0x301, %edx # imm = 0x301
movl (%rax,%rdx,4), %ebx
movl $0x40000000, %eax # imm = 0x40000000
movq %rdx, 0x18(%rsp)
movl %ecx, 0x4(%rsp)
movl %ecx, %r12d
setae %r14b
orl $-0x2, %r14d
shll $0x1e, %r14d
cmpl $0x201, %edx # imm = 0x201
cmovbl %eax, %r14d
cmpl $0x101, %edx # imm = 0x101
movq 0x10(%rsp), %rdx
movl $0x0, %eax
cmovbl %eax, %r14d
xorl %ebp, %ebp
movq (%rdx), %r13
cmpq %rbp, %rbx
je 0x340e7
leal (%r12,%rbp), %eax
movq 0x18(%rsp), %rdi
imulq $0xc, %rax, %r15
movl %ebx, (%r13,%r15)
callq 0x31e8e
addl %r14d, %eax
movl %eax, 0x8(%r13,%r15)
movl %ebp, 0x4(%r13,%r15)
incq %rbp
jmp 0x340b9
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rdx
movl 0x4(%rsp), %ecx
movq 0x8(%rsp), %rbx
addl (%rax,%rdx,4), %ecx
incq %rdx
jmp 0x34062
movq 0x18(%rbx), %rax
shlq $0x4, %rax
movq %rax, 0x30(%rbx)
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x34125
movq 0x8(%rsp), %rdi
movq %rax, %r14
callq 0x34194
movq %r14, %rdi
callq 0x2e800
| /mpetri[P]ans-large-alphabet/include/ans_smsb.hpp |
void run<ANSfold<4u>>(std::vector<unsigned int, std::allocator<unsigned int>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) | void run(std::vector<uint32_t>& input, std::string input_name)
{
// (0) compute entropy
auto [input_entropy, sigma] = compute_entropy(input);
// (1) encode
std::vector<uint8_t> encoded_data(input.size() * 8);
std::vector<uint8_t> tmp_buf(input.size() * 8);
size_t encoded_bytes;
size_t encoding_time_ns_min = std::numeric_limits<size_t>::max();
for (int i = 0; i < NUM_RUNS; i++) {
auto start_encode = std::chrono::high_resolution_clock::now();
encoded_bytes = t_compressor::encode(input.data(), input.size(),
encoded_data.data(), encoded_data.size(), tmp_buf.data());
auto stop_encode = std::chrono::high_resolution_clock::now();
auto encoding_time_ns = stop_encode - start_encode;
encoding_time_ns_min
= std::min((size_t)encoding_time_ns.count(), encoding_time_ns_min);
}
double BPI = double(encoded_bytes * 8) / double(input.size());
double encode_IPS = compute_ips(input.size(), encoding_time_ns_min);
double enc_ns_per_int = double(encoding_time_ns_min) / double(input.size());
// (4) output stats
printf("(%s,%2.4f)\n", t_compressor::name().c_str(), BPI);
fflush(stdout);
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
callq 0x2f2da
movq 0x8(%rbx), %rsi
leaq 0x18(%rsp), %rdx
movq %rsp, %rdi
subq (%rbx), %rsi
addq %rsi, %rsi
callq 0x32bee
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
addq %rsi, %rsi
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x32bee
movb $0x1, %al
testb $0x1, %al
je 0x347c0
callq 0x2e080
movq (%rbx), %rdx
movq 0x8(%rbx), %rcx
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
subq %rdx, %rcx
subq %rdi, %rsi
sarq $0x2, %rcx
callq 0x4aa4c
movq %rax, %r14
callq 0x2e080
xorl %eax, %eax
jmp 0x3478c
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
leaq 0x18(%rsp), %rdi
callq 0x4a9ce
subq %r15, %rbx
shlq $0x3, %r14
leaq 0x1c9b6(%rip), %rdi # 0x51195
movb $0x1, %al
sarq $0x2, %rbx
vcvtusi2sd %rbx, %xmm1, %xmm0
leaq 0x18(%rsp), %rbx
movq (%rbx), %rsi
vcvtusi2sd %r14, %xmm1, %xmm1
vdivsd %xmm0, %xmm1, %xmm0
callq 0x2e070
movq %rbx, %rdi
callq 0x2e968
movq 0x2f76f(%rip), %rax # 0x63f80
movq (%rax), %rdi
callq 0x2e4d0
leaq 0x38(%rsp), %rdi
callq 0x36c00
movq %rsp, %rdi
callq 0x36c00
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x3483c
movq %rax, %rbx
jmp 0x34849
leaq 0x38(%rsp), %rdi
movq %rax, %rbx
callq 0x36c00
movq %rsp, %rdi
callq 0x36c00
movq %rbx, %rdi
callq 0x2e800
| /mpetri[P]ans-large-alphabet/src/fold_effectiveness.cpp |
void run<ANSrfold<3u>>(std::vector<unsigned int, std::allocator<unsigned int>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>) | void run(std::vector<uint32_t>& input, std::string input_name)
{
// (0) compute entropy
auto [input_entropy, sigma] = compute_entropy(input);
// (1) encode
std::vector<uint8_t> encoded_data(input.size() * 8);
std::vector<uint8_t> tmp_buf(input.size() * 8);
size_t encoded_bytes;
size_t encoding_time_ns_min = std::numeric_limits<size_t>::max();
for (int i = 0; i < NUM_RUNS; i++) {
auto start_encode = std::chrono::high_resolution_clock::now();
encoded_bytes = t_compressor::encode(input.data(), input.size(),
encoded_data.data(), encoded_data.size(), tmp_buf.data());
auto stop_encode = std::chrono::high_resolution_clock::now();
auto encoding_time_ns = stop_encode - start_encode;
encoding_time_ns_min
= std::min((size_t)encoding_time_ns.count(), encoding_time_ns_min);
}
double BPI = double(encoded_bytes * 8) / double(input.size());
double encode_IPS = compute_ips(input.size(), encoding_time_ns_min);
double enc_ns_per_int = double(encoding_time_ns_min) / double(input.size());
// (4) output stats
printf("(%s,%2.4f)\n", t_compressor::name().c_str(), BPI);
fflush(stdout);
} | pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
callq 0x2f2da
movq 0x8(%rbx), %rsi
leaq 0x18(%rsp), %rdx
movq %rsp, %rdi
subq (%rbx), %rsi
addq %rsi, %rsi
callq 0x32bee
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
addq %rsi, %rsi
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x32bee
movb $0x1, %al
testb $0x1, %al
je 0x34f30
callq 0x2e080
movq (%rbx), %rdx
movq 0x8(%rbx), %rcx
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
subq %rdx, %rcx
subq %rdi, %rsi
sarq $0x2, %rcx
callq 0x4d3bc
movq %rax, %r14
callq 0x2e080
xorl %eax, %eax
jmp 0x34efc
movq (%rbx), %r15
movq 0x8(%rbx), %rbx
leaq 0x18(%rsp), %rdi
callq 0x4d33e
subq %r15, %rbx
shlq $0x3, %r14
leaq 0x1c246(%rip), %rdi # 0x51195
movb $0x1, %al
sarq $0x2, %rbx
vcvtusi2sd %rbx, %xmm1, %xmm0
leaq 0x18(%rsp), %rbx
movq (%rbx), %rsi
vcvtusi2sd %r14, %xmm1, %xmm1
vdivsd %xmm0, %xmm1, %xmm0
callq 0x2e070
movq %rbx, %rdi
callq 0x2e968
movq 0x2efff(%rip), %rax # 0x63f80
movq (%rax), %rdi
callq 0x2e4d0
leaq 0x38(%rsp), %rdi
callq 0x36c00
movq %rsp, %rdi
callq 0x36c00
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x34fac
movq %rax, %rbx
jmp 0x34fb9
leaq 0x38(%rsp), %rdi
movq %rax, %rbx
callq 0x36c00
movq %rsp, %rdi
callq 0x36c00
movq %rbx, %rdi
callq 0x2e800
| /mpetri[P]ans-large-alphabet/src/fold_effectiveness.cpp |
SHUFF_OUTPUT_BIT(bit_io_t*, long) | inline void SHUFF_OUTPUT_BIT(bit_io_t* bio, int64_t b)
{
*bio->out_u64 <<= 1;
if (b)
*bio->out_u64 |= 1;
bio->buff_btg--;
if (bio->buff_btg == 0) {
SHUFF_OUTPUT_NEXT(bio);
*bio->out_u64 = 0;
bio->buff_btg = SHUFF_BUFF_BITS;
}
} | movq 0x10(%rdi), %rax
xorl %edx, %edx
testq %rsi, %rsi
setne %dl
movq (%rax), %rcx
leaq (%rdx,%rcx,2), %rcx
movq %rcx, (%rax)
decq 0x20(%rdi)
je 0x3561e
retq
leaq 0x8(%rax), %rcx
movq %rcx, 0x10(%rdi)
andq $0x0, 0x8(%rax)
movq $0x40, 0x20(%rdi)
retq
| /mpetri[P]ans-large-alphabet/include/shuff.hpp |
interpolative_internal::read_center_mid(bit_stream&, unsigned long) | static inline uint64_t read_center_mid(bit_stream& is, uint64_t u)
{
auto b = u == 1ULL ? 0ULL : bits::hi(u - 1ULL) + 1ULL;
auto d = 2ULL * u - (1ULL << b);
uint64_t val = 1ULL;
if (u != 1) {
uint64_t m = (1ULL << b) - u;
val = is.get_int(b - 1) + 1;
if (val > m) {
val = (2ULL * val + is.get_int(1)) - m - 1ULL;
}
}
val = val + (d >> 1ULL);
if (val > u)
val -= u;
return val;
} | pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
cmpq $0x1, %rsi
jne 0x356f3
pushq $0x1
popq %r14
movq %r14, %r12
jmp 0x3573f
leaq -0x1(%rbx), %rax
leaq (%rbx,%rbx), %r14
movq %rdi, %r15
lzcntq %rax, %rsi
movl %esi, %eax
negb %al
pushq $0x1
popq %rcx
shlxq %rax, %rcx, %r13
xorq $0x3f, %rsi
subq %r13, %r14
subq %rbx, %r13
callq 0x3575e
movq %rax, %r12
incq %r12
cmpq %r13, %r12
jbe 0x3573f
pushq $0x1
popq %rsi
movq %r15, %rdi
callq 0x3575e
notq %r13
leaq (%r13,%r12,2), %r12
addq %rax, %r12
shrq %r14
xorl %eax, %eax
addq %r12, %r14
cmpq %rbx, %r14
cmovaq %rbx, %rax
subq %rax, %r14
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
| /mpetri[P]ans-large-alphabet/include/interp.hpp |
interpolative_internal::encode_interpolative(bit_stream&, unsigned int const*, unsigned long, unsigned long, unsigned long) | static inline void encode_interpolative(bit_stream& os,
const uint32_t* in_buf, size_t n, size_t low, size_t high)
{
if (n == 0ULL)
return;
uint64_t h = (n + 1ULL) >> 1ULL;
uint64_t n1 = h - 1ULL;
uint64_t n2 = n - h;
uint64_t v = in_buf[h - 1ULL] + 1ULL; // we don't encode 0
write_center_mid(os, v - low - n1 + 1ULL, high - n2 - low - n1 + 1ULL);
encode_interpolative(os, in_buf, n1, low, v - 1ULL);
encode_interpolative(os, in_buf + h, n2, v + 1ULL, high);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, (%rsp)
incq %r8
movq %rcx, %r12
movq %rdx, %r14
movq %rsi, %r15
movq (%rsp), %rbx
movq %r8, 0x8(%rsp)
testq %r14, %r14
je 0x358d5
leaq 0x1(%r14), %rax
shrq %rax
leaq -0x1(%rax), %rcx
movq %rcx, 0x10(%rsp)
pushq $0x1
popq %rcx
leaq (%r15,%rax,4), %r13
movq 0x8(%rsp), %rdx
subq %rax, %r14
subq %rax, %rcx
movq %rbx, %rdi
movl -0x4(%r13), %ebp
subq %r12, %rdx
subq %r14, %rdx
addq %rcx, %rdx
subq %r12, %rcx
leaq 0x2(%rbp,%rcx), %rsi
callq 0x358e4
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rcx
movq %rbp, %r8
callq 0x35848
addq $0x2, %rbp
movq %r13, %r15
movq %rbp, %r12
jmp 0x3586f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
| /mpetri[P]ans-large-alphabet/include/interp.hpp |
bits::write_int(unsigned int*&, unsigned int, unsigned char&, unsigned char) | inline void write_int(
uint32_t*& word, uint32_t x, uint8_t& offset, const uint8_t len)
{
x &= lo_set[len & 63];
if (offset + len < 32) {
*word &= ((all_set << (offset + len))
| lo_set[offset]); // mask 1..10..01..1
*word |= (x << offset);
offset += len;
} else {
*word &= ((lo_set[offset])); // mask 0....01..1
*word |= (x << offset);
if ((offset = (offset + len)) > 32) { // offset+len >= 32
offset &= 31;
*(++word) &= (~lo_set[offset]); // mask 1...10..0
*word |= (x >> (len - offset));
} else {
offset = 0;
++word;
}
}
} | movl %ecx, %r8d
andl $0x3f, %r8d
leaq 0x1b83f(%rip), %rax # 0x51200
andl (%rax,%r8,4), %esi
movzbl (%rdx), %r8d
movl %r8d, %r9d
addl %ecx, %r9d
cmpl $0x1f, %r9d
ja 0x359fc
pushq $-0x1
popq %r10
shlxl %r9d, %r10d, %r9d
orl (%rax,%r8,4), %r9d
movq (%rdi), %r8
andl (%r8), %r9d
movl %r9d, (%r8)
movb (%rdx), %dil
shlxl %edi, %esi, %esi
orl %r9d, %esi
movl %esi, (%r8)
addb %cl, (%rdx)
retq
movq (%rdi), %r9
movl (%r9), %r10d
andl (%rax,%r8,4), %r10d
movl %r10d, (%r9)
movb (%rdx), %r8b
shlxl %r8d, %esi, %r8d
orl %r10d, %r8d
movl %r8d, (%r9)
movb (%rdx), %r8b
addb %cl, %r8b
cmpb $0x21, %r8b
jb 0x35a57
andb $0x1f, %r8b
movb %r8b, (%rdx)
movzbl %r8b, %r8d
movq (%rdi), %r10
movl (%rax,%r8,4), %eax
leaq 0x4(%r10), %r9
movq %r9, (%rdi)
andnl 0x4(%r10), %eax, %eax
movl %eax, 0x4(%r10)
movzbl (%rdx), %edx
subl %edx, %ecx
shrxl %ecx, %esi, %ecx
orl %eax, %ecx
movl %ecx, 0x4(%r10)
retq
movb $0x0, (%rdx)
addq $0x4, (%rdi)
retq
nop
| /mpetri[P]ans-large-alphabet/include/bits.hpp |
ans_fold_encode<1u>::encode_symbol(unsigned long&, unsigned int, unsigned char*&) | void encode_symbol(uint64_t& state, uint32_t sym, uint8_t*& out_u8)
{
auto mapped_sym
= ans_fold_mapping_and_exceptions<fidelity>(sym, out_u8);
const auto& e = table[mapped_sym];
if (state >= e.sym_upper_bound) {
auto out_ptr_u32 = reinterpret_cast<uint32_t*>(out_u8);
*out_ptr_u32 = state & 0xFFFFFFFF;
out_u8 += sizeof(uint32_t);
state = state >> constants::RADIX_LOG2;
}
state = ((state / e.freq) * frame_size) + (state % e.freq) + e.base;
} | pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rcx, %r15
movl %edx, %edi
movq %rcx, %rsi
callq 0x4a023
movq 0x18(%r14), %rsi
movl %eax, %edx
movq (%rbx), %rax
shlq $0x4, %rdx
leaq (%rsi,%rdx), %rcx
cmpq 0x8(%rsi,%rdx), %rax
jb 0x49dc9
movq (%r15), %rdx
movl %eax, (%rdx)
addq $0x4, %rdx
shrq $0x20, %rax
movq %rdx, (%r15)
movq %rax, (%rbx)
movzwl (%rcx), %esi
xorl %edx, %edx
divq %rsi
movl 0x4(%rcx), %ecx
addq %rdx, %rcx
imulq 0x30(%r14), %rax
addq %rax, %rcx
movq %rcx, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
| /mpetri[P]ans-large-alphabet/include/ans_fold.hpp |
unsigned long ans_fold_compress<2u>(unsigned char*, unsigned long, unsigned int const*, unsigned long) | size_t ans_fold_compress(
uint8_t* dst, size_t dstCapacity, const uint32_t* src, size_t srcSize)
{
auto in_u32 = reinterpret_cast<const uint32_t*>(src);
auto ans_frame = ans_fold_encode<fidelity>::create(in_u32, srcSize);
uint8_t* out_u8 = reinterpret_cast<uint8_t*>(dst);
// serialize model
ans_frame.serialize(out_u8);
// start encoding, we encode 4 states at the same time for speed
std::array<uint64_t, 4> states;
states[0] = ans_frame.initial_state();
states[1] = ans_frame.initial_state();
states[2] = ans_frame.initial_state();
states[3] = ans_frame.initial_state();
size_t cur_sym = 0;
while ((srcSize - cur_sym) % 4 != 0) {
ans_frame.encode_symbol(
states[0], in_u32[srcSize - cur_sym - 1], out_u8);
cur_sym += 1;
}
while (cur_sym != srcSize) {
ans_frame.encode_symbol(
states[0], in_u32[srcSize - cur_sym - 1], out_u8);
ans_frame.encode_symbol(
states[1], in_u32[srcSize - cur_sym - 2], out_u8);
ans_frame.encode_symbol(
states[2], in_u32[srcSize - cur_sym - 3], out_u8);
ans_frame.encode_symbol(
states[3], in_u32[srcSize - cur_sym - 4], out_u8);
cur_sym += 4;
}
// flush final state
ans_frame.flush_state(states[0], out_u8);
ans_frame.flush_state(states[1], out_u8);
ans_frame.flush_state(states[2], out_u8);
ans_frame.flush_state(states[3], out_u8);
return out_u8 - reinterpret_cast<uint8_t*>(dst);
} | pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
leaq 0x38(%rsp), %rbx
movq %rdi, %r12
movq %rcx, %r14
movq %rdx, %r15
movq %rdx, %rsi
movq %rcx, %rdx
movq %rbx, %rdi
callq 0x4a3a0
leaq 0x8(%rsp), %rsi
movq %r12, 0x30(%rsp)
movq %r12, (%rsi)
movq %rbx, %rdi
callq 0x4a4f8
leaq 0x38(%rsp), %rcx
movl %r14d, %ebp
andl $0x3, %ebp
leaq -0x4(%r15,%r14,4), %rbx
leaq 0x28(%rsp), %rax
leaq 0x8(%rsp), %r13
xorl %r12d, %r12d
vbroadcastsd 0x38(%rcx), %ymm0
negq %rbp
vmovups %ymm0, -0x18(%rax)
cmpq %r12, %rbp
je 0x4a2b1
movl (%rbx,%r12,4), %edx
leaq 0x38(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %r13, %rcx
vzeroupper
callq 0x4a504
decq %r12
jmp 0x4a28e
andq $-0x4, %r14
leaq 0x38(%rsp), %rbx
leaq 0x10(%rsp), %r12
leaq 0x8(%rsp), %r13
leaq 0x18(%rsp), %rbp
testq %r14, %r14
je 0x4a327
movl -0x4(%r15,%r14,4), %edx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rcx
vzeroupper
callq 0x4a504
movl -0x8(%r15,%r14,4), %edx
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rcx
callq 0x4a504
movl -0xc(%r15,%r14,4), %edx
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
movq %r13, %rcx
callq 0x4a504
movl -0x10(%r15,%r14,4), %edx
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
movq %r13, %rcx
callq 0x4a504
addq $-0x4, %r14
jmp 0x4a2c9
leaq 0x38(%rsp), %rdi
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rbx
subq 0x38(%rdi), %rax
movq %rax, (%rbx)
movq 0x18(%rsp), %rax
subq 0x38(%rdi), %rax
movq %rax, 0x8(%rbx)
movq 0x20(%rsp), %rax
subq 0x38(%rdi), %rax
movq %rax, 0x10(%rbx)
movq 0x28(%rsp), %rax
subq 0x38(%rdi), %rax
movq %rax, 0x18(%rbx)
subq 0x30(%rsp), %rbx
addq $0x20, %rbx
vzeroupper
callq 0x4a566
movq %rbx, %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4a38b
jmp 0x4a38b
leaq 0x38(%rsp), %rdi
movq %rax, %rbx
callq 0x4a566
movq %rbx, %rdi
callq 0x2e800
| /mpetri[P]ans-large-alphabet/include/ans_fold.hpp |
ans_fold_encode<2u>::encode_symbol(unsigned long&, unsigned int, unsigned char*&) | void encode_symbol(uint64_t& state, uint32_t sym, uint8_t*& out_u8)
{
auto mapped_sym
= ans_fold_mapping_and_exceptions<fidelity>(sym, out_u8);
const auto& e = table[mapped_sym];
if (state >= e.sym_upper_bound) {
auto out_ptr_u32 = reinterpret_cast<uint32_t*>(out_u8);
*out_ptr_u32 = state & 0xFFFFFFFF;
out_u8 += sizeof(uint32_t);
state = state >> constants::RADIX_LOG2;
}
state = ((state / e.freq) * frame_size) + (state % e.freq) + e.base;
} | pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rcx, %r15
movl %edx, %edi
movq %rcx, %rsi
callq 0x4a595
movq 0x18(%r14), %rsi
movl %eax, %edx
movq (%rbx), %rax
shlq $0x4, %rdx
leaq (%rsi,%rdx), %rcx
cmpq 0x8(%rsi,%rdx), %rax
jb 0x4a547
movq (%r15), %rdx
movl %eax, (%rdx)
addq $0x4, %rdx
shrq $0x20, %rax
movq %rdx, (%r15)
movq %rax, (%rbx)
movzwl (%rcx), %esi
xorl %edx, %edx
divq %rsi
movl 0x4(%rcx), %ecx
addq %rdx, %rcx
imulq 0x30(%r14), %rax
addq %rax, %rcx
movq %rcx, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
| /mpetri[P]ans-large-alphabet/include/ans_fold.hpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.