	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function heap_sort_res
_heap_sort_res:                         ## @heap_sort_res
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_R_cnt@GOTPCREL(%rip), %r8
	movl	(%r8), %r12d
	cmpl	$2, %r12d
	jl	LBB0_11
## %bb.1:
	movq	_RV@GOTPCREL(%rip), %r10
	movq	(%r10), %rdx
	movq	_R@GOTPCREL(%rip), %r11
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%edi, %ebx
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r11), %rax
	movslq	%ebx, %rcx
	movq	%r9, (%rax,%rcx,8)
	movq	(%r10), %rdx
	movl	%r14d, (%rdx,%rcx,4)
	cmpq	$2, %r12
	movq	%r15, %r12
	jbe	LBB0_11
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	(%r11), %rax
	movq	(%rax,%r12,8), %r9
	movl	(%rdx,%r12,4), %r14d
	movq	8(%rax), %rdx
	movq	%rdx, (%rax,%r12,8)
	movq	(%r10), %rdx
	movl	4(%rdx), %eax
	movl	%eax, (%rdx,%r12,4)
	cmpq	$3, %r12
	jb	LBB0_19
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	-1(%r12), %r15
	movl	$1, %edi
	movl	$2, %esi
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%r15d, %esi
	jge	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%esi, %ebx
	orl	$1, %ebx
	movslq	%ebx, %rax
	movl	(%rdx,%rax,4), %eax
	movslq	%esi, %rcx
	cmpl	(%rdx,%rcx,4), %eax
	jg	LBB0_7
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=2
	movl	%esi, %ebx
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=2
	movslq	%ebx, %rsi
	cmpl	(%rdx,%rsi,4), %r14d
	jge	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	(%r11), %rax
	movq	(%rax,%rsi,8), %rcx
	movslq	%edi, %rdi
	movq	%rcx, (%rax,%rdi,8)
	movq	(%r10), %rdx
	movl	(%rdx,%rsi,4), %eax
	movl	%eax, (%rdx,%rdi,4)
	addl	%esi, %esi
	movslq	%esi, %rax
	movl	%ebx, %edi
	cmpq	%rax, %r12
	jg	LBB0_4
	jmp	LBB0_10
LBB0_19:
	movq	(%r11), %rax
	movq	%r9, 8(%rax)
	movq	(%r10), %rax
	movl	%r14d, 4(%rax)
LBB0_11:
	movq	_Q_order@GOTPCREL(%rip), %rcx
	movq	_FLAG_REVERSE_SEARCH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r8), %eax
	testl	%edx, (%rcx)
	je	LBB0_15
## %bb.12:
	testl	%eax, %eax
	jle	LBB0_18
## %bb.13:
	xorl	%ecx, %ecx
	movq	_R@GOTPCREL(%rip), %rax
	movq	_RV@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rax), %rsi
	movq	8(%rsi,%rcx,8), %rdi
	movq	%rdi, (%rsi,%rcx,8)
	movq	(%rdx), %rsi
	movl	4(%rsi,%rcx,4), %edi
	notl	%edi
	movl	%edi, (%rsi,%rcx,4)
	leaq	1(%rcx), %rsi
	movslq	(%r8), %rdi
	movq	%rsi, %rcx
	cmpq	%rdi, %rsi
	jl	LBB0_14
	jmp	LBB0_18
LBB0_15:
	testl	%eax, %eax
	jle	LBB0_18
## %bb.16:
	xorl	%ecx, %ecx
	movq	_R@GOTPCREL(%rip), %rax
	movq	_RV@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rax), %rsi
	movq	8(%rsi,%rcx,8), %rdi
	movq	%rdi, (%rsi,%rcx,8)
	movq	(%rdx), %rsi
	movl	4(%rsi,%rcx,4), %edi
	movl	%edi, (%rsi,%rcx,4)
	leaq	1(%rcx), %rsi
	movslq	(%r8), %rdi
	movq	%rsi, %rcx
	cmpq	%rdi, %rsi
	jl	LBB0_17
LBB0_18:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_R_cnt,4,2                      ## @R_cnt
	.comm	_R,8,3                          ## @R
	.comm	_RV,8,3                         ## @RV
	.comm	_Q_order,4,2                    ## @Q_order
	.comm	_FLAG_REVERSE_SEARCH,4,2        ## @FLAG_REVERSE_SEARCH
	.no_dead_strip	_heap_sort_res
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function heap_sort_res
_heap_sort_res:                         ; @heap_sort_res
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _R_cnt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _R_cnt@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #2
	b.lt	LBB0_12
; %bb.1:
Lloh2:
	adrp	x10, _RV@GOTPAGE
Lloh3:
	ldr	x10, [x10, _RV@GOTPAGEOFF]
	ldr	x15, [x10]
Lloh4:
	adrp	x11, _R@GOTPAGE
Lloh5:
	ldr	x11, [x11, _R@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x17, x16
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x15, [x11]
	str	x13, [x15, w17, sxtw #3]
	ldr	x15, [x10]
	str	w12, [x15, w17, sxtw #2]
	cmp	x9, #2
	mov	x9, x14
	b.ls	LBB0_12
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	ldr	x14, [x11]
	lsl	x16, x9, #3
	ldr	x13, [x14, x16]
	lsl	x17, x9, #2
	ldr	w12, [x15, x17]
	ldr	x15, [x14, #8]
	str	x15, [x14, x16]
	ldr	x15, [x10]
	ldr	w14, [x15, #4]
	str	w14, [x15, x17]
	cmp	x9, #3
	b.lo	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	x14, x9, #1
	mov	w16, #1
	mov	w0, #2
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w0, w14
	b.ge	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	sxtw	x17, w0
	orr	x17, x17, #0x1
	ldr	w1, [x15, x17, lsl #2]
	ldr	w2, [x15, w0, sxtw #2]
	cmp	w1, w2
	csel	w17, w17, w0, gt
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=2
	mov	x17, x0
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=2
	ldr	w15, [x15, w17, sxtw #2]
	cmp	w12, w15
	b.ge	LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=2
	sxtw	x0, w17
	ldr	x15, [x11]
	ldr	x1, [x15, x0, lsl #3]
	str	x1, [x15, w16, sxtw #3]
	ldr	x15, [x10]
	ldr	w0, [x15, x0, lsl #2]
	str	w0, [x15, w16, sxtw #2]
	lsl	w0, w17, #1
	cmp	x9, w0, sxtw
	mov	x16, x17
	b.gt	LBB0_6
	b	LBB0_3
LBB0_11:
	ldr	x9, [x11]
	str	x13, [x9, #8]
	ldr	x9, [x10]
	str	w12, [x9, #4]
LBB0_12:
Lloh6:
	adrp	x9, _Q_order@GOTPAGE
Lloh7:
	ldr	x9, [x9, _Q_order@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x9]
Lloh9:
	adrp	x9, _FLAG_REVERSE_SEARCH@GOTPAGE
Lloh10:
	ldr	x9, [x9, _FLAG_REVERSE_SEARCH@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x9]
	ldr	w9, [x8]
	tst	w11, w10
	b.eq	LBB0_16
; %bb.13:
	cmp	w9, #1
	b.lt	LBB0_19
; %bb.14:
	mov	x11, #0
Lloh12:
	adrp	x9, _R@GOTPAGE
Lloh13:
	ldr	x9, [x9, _R@GOTPAGEOFF]
Lloh14:
	adrp	x10, _RV@GOTPAGE
Lloh15:
	ldr	x10, [x10, _RV@GOTPAGEOFF]
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x9]
	add	x12, x12, x11, lsl #3
	ldr	x13, [x12, #8]
	str	x13, [x12]
	ldr	x12, [x10]
	add	x12, x12, x11, lsl #2
	add	x13, x11, #1
	ldr	w11, [x12, #4]
	mvn	w11, w11
	str	w11, [x12]
	ldrsw	x12, [x8]
	mov	x11, x13
	cmp	x13, x12
	b.lt	LBB0_15
	b	LBB0_19
LBB0_16:
	cmp	w9, #1
	b.lt	LBB0_19
; %bb.17:
	mov	x11, #0
Lloh16:
	adrp	x9, _R@GOTPAGE
Lloh17:
	ldr	x9, [x9, _R@GOTPAGEOFF]
Lloh18:
	adrp	x10, _RV@GOTPAGE
Lloh19:
	ldr	x10, [x10, _RV@GOTPAGEOFF]
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x9]
	add	x12, x12, x11, lsl #3
	ldr	x13, [x12, #8]
	str	x13, [x12]
	ldr	x12, [x10]
	add	x12, x12, x11, lsl #2
	add	x13, x11, #1
	ldr	w11, [x12, #4]
	str	w11, [x12]
	ldrsw	x12, [x8]
	mov	x11, x13
	cmp	x13, x12
	b.lt	LBB0_18
LBB0_19:
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_R_cnt,4,2                      ; @R_cnt
	.comm	_R,8,3                          ; @R
	.comm	_RV,8,3                         ; @RV
	.comm	_Q_order,4,2                    ; @Q_order
	.comm	_FLAG_REVERSE_SEARCH,4,2        ; @FLAG_REVERSE_SEARCH
	.no_dead_strip	_heap_sort_res
.subsections_via_symbols
