// File: /workspace/github_cpp_makefile_star2_O3/Laakeri[P]maxpre/src/cardinalityconstraint.cpp
// Function: maxPreprocessor::CardinalityConstraint::HSort(std::vector<int, std::allocator<int>> const&, int, int, maxPreprocessor::CardinalityConstraint::Formula&, bool, bool)
vector<int> CardinalityConstraint::HSort(const vector<int>& A, int l, int r, Formula& F, bool d1, bool d2) {
	int le = r-l+1;
	assert(le >= 2);
	assert(le%2 == 0);
	if (le == 2) {
		vector<int> a = {A[l]};
		vector<int> b = {A[r]};
		return HMerge(a, b, F, d1, d2);
	}
	else {
		int m = (l+r)/2;
		vector<int> a = HSort(A, l, m, F, d1, d2);
		vector<int> b = HSort(A, m+1, r, F, d1, d2);
		return HMerge(a, b, F, d1, d2);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r8d, %eax
subl %ecx, %eax
jle 0x3392c
testb $0x1, %al
je 0x3394b
movl %r8d, %r15d
movq %rdx, %r12
movq %rdi, %rbx
movb 0x98(%rsp), %bpl
movb 0x90(%rsp), %r13b
cmpl $0x1, %eax
jne 0x33864
movq %r9, %r14
movslq %ecx, %rax
movq (%r12), %rcx
movl (%rcx,%rax,4), %eax
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x28(%rsp), %rdi
leaq 0x44(%rsp), %rcx
movl $0x1, %edx
callq 0x1e9a8
movslq %r15d, %rax
movq (%r12), %rcx
movl (%rcx,%rax,4), %eax
leaq 0x44(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x1e9a8
subq $0x8, %rsp
movzbl %bpl, %eax
movzbl %r13b, %r9d
leaq 0x30(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq %rbx, %rdi
movq %r14, %r8
pushq %rax
callq 0x327e4
addq $0x10, %rsp
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x33851
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
jne 0x3390d
jmp 0x3391a
movq %rbx, 0x48(%rsp)
leal (%r15,%rcx), %eax
movl %eax, %ebx
shrl $0x1f, %ebx
addl %eax, %ebx
sarl %ebx
movzbl %bpl, %eax
movq %rax, 0x50(%rsp)
movzbl %r13b, %ebp
leaq 0x28(%rsp), %rdi
movq %rsi, %r14
movq %r12, %rdx
movl %ebx, %r8d
movq %r9, %r13
pushq %rax
pushq %rbp
callq 0x33784
addq $0x10, %rsp
incl %ebx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %ebx, %ecx
movq 0x50(%rsp), %rbx
movl %r15d, %r8d
movq %r13, %r9
pushq %rbx
pushq %rbp
callq 0x33784
addq $0x10, %rsp
subq $0x8, %rsp
leaq 0x30(%rsp), %rdx
leaq 0x18(%rsp), %rcx
movq 0x50(%rsp), %rdi
movq %r13, %r8
movl %ebp, %r9d
pushq %rbx
callq 0x327e4
addq $0x10, %rsp
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x338fe
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
movq 0x48(%rsp), %rbx
je 0x3391a
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6ae9(%rip), %rdi      # 0x3a41c
leaq 0x68f2(%rip), %rsi      # 0x3a22c
leaq 0x6ae3(%rip), %rcx      # 0x3a424
movl $0x80, %edx
callq 0x31b0
leaq 0x6b42(%rip), %rdi      # 0x3a494
leaq 0x68d3(%rip), %rsi      # 0x3a22c
leaq 0x6ac4(%rip), %rcx      # 0x3a424
movl $0x81, %edx
callq 0x31b0
jmp 0x3396c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3398d
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
jmp 0x3398d
jmp 0x3398a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x339a9
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
jmp 0x339a9
movq %rax, %rbx
movq %rbx, %rdi
callq 0x34a0
nop