// File: /workspace/github_cpp_makefile_star2_O1/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 0x348d6
testb $0x1, %al
je 0x348f5
movl %r8d, %r15d
movq %rdx, %r12
movq %rdi, %rbx
movb 0x98(%rsp), %bpl
movb 0x90(%rsp), %r13b
cmpl $0x1, %eax
jne 0x3480e
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 0x1f586
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 0x1f586
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 0x337bc
addq $0x10, %rsp
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x347fb
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
jne 0x348b7
jmp 0x348c4
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 0x3472e
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 0x3472e
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 0x337bc
addq $0x10, %rsp
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x348a8
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
movq 0x48(%rsp), %rbx
je 0x348c4
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 0x6a2b(%rip), %rdi      # 0x3b308
leaq 0x6834(%rip), %rsi      # 0x3b118
leaq 0x6a25(%rip), %rcx      # 0x3b310
movl $0x80, %edx
callq 0x31b0
leaq 0x6a84(%rip), %rdi      # 0x3b380
leaq 0x6815(%rip), %rsi      # 0x3b118
leaq 0x6a06(%rip), %rcx      # 0x3b310
movl $0x81, %edx
callq 0x31b0
jmp 0x34916
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x34937
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
jmp 0x34937
jmp 0x34934
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x34953
movq 0x38(%rsp), %rsi
subq %rdi, %rsi
callq 0x32b0
jmp 0x34953
movq %rax, %rbx
movq %rbx, %rdi
callq 0x34a0
nop