	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ecma_builtin_helper_array_heap_sort_helper ## -- Begin function ecma_builtin_helper_array_heap_sort_helper
	.p2align	4, 0x90
_ecma_builtin_helper_array_heap_sort_helper: ## @ecma_builtin_helper_array_heap_sort_helper
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movq	_ECMA_VALUE_EMPTY@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmpl	$-1, %esi
	jl	LBB0_7
## %bb.1:
	movq	%rdi, %r13
	movl	%esi, %r14d
	shrl	$31, %r14d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	addl	%esi, %r14d
	sarl	%r14d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	callq	_ecma_is_value_empty
	testq	%rax, %rax
	je	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_value@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r15d
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	callq	_ecma_builtin_helper_array_to_heap
	movl	%r15d, %edi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_ECMA_TRY_CATCH
	movl	(%rbx), %edi
	callq	_ECMA_FINALIZE
	leal	-1(%r14), %eax
	incl	%r14d
	cmpl	$1, %r14d
	movl	%eax, %r14d
	jg	LBB0_2
LBB0_3:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jle	LBB0_7
## %bb.4:
	movl	%eax, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %edi
	callq	_ecma_is_value_empty
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r13), %eax
	movl	(%r13,%rbx,4), %ecx
	movl	%ecx, (%r13)
	movl	%eax, (%r13,%rbx,4)
	movq	_value@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	-1(%rbx), %r15
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	callq	_ecma_builtin_helper_array_to_heap
	movl	%r14d, %edi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_ECMA_TRY_CATCH
	movq	_value@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ECMA_FINALIZE
	cmpq	$1, %rbx
	movq	%r15, %rbx
	jg	LBB0_5
LBB0_7:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ECMA_VALUE_EMPTY,4,2           ## @ECMA_VALUE_EMPTY
	.comm	_value,4,2                      ## @value
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ecma_builtin_helper_array_heap_sort_helper ; -- Begin function ecma_builtin_helper_array_heap_sort_helper
	.p2align	2
_ecma_builtin_helper_array_heap_sort_helper: ; @ecma_builtin_helper_array_heap_sort_helper
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x8, _ECMA_VALUE_EMPTY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ECMA_VALUE_EMPTY@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	cmn	w1, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x23, x1
	mov	x21, x0
	cmp	w1, #0
	cinc	w8, w1, lt
	asr	w24, w8, #1
Lloh3:
	adrp	x26, _value@GOTPAGE
Lloh4:
	ldr	x26, [x26, _value@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_ecma_is_value_empty
	cbz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w25, [x26]
	mov	x0, x21
	mov	x1, x24
	mov	x2, x23
	mov	x3, x20
	mov	x4, x19
	bl	_ecma_builtin_helper_array_to_heap
	mov	x1, x0
	mov	x0, x25
	mov	x2, x22
	bl	_ECMA_TRY_CATCH
	ldr	w0, [x26]
	bl	_ECMA_FINALIZE
	add	w8, w24, #1
	sub	w24, w24, #1
	cmp	w8, #1
	b.gt	LBB0_2
LBB0_4:
	cmp	w23, #1
	b.lt	LBB0_8
; %bb.5:
	mov	w24, w23
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_ecma_is_value_empty
	cbz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	lsl	x8, x24, #2
	ldr	w9, [x21, x8]
	ldr	w10, [x21]
	str	w9, [x21]
	str	w10, [x21, x8]
	ldr	w23, [x26]
	subs	x2, x24, #1
	mov	x0, x21
	mov	w1, #0
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	x3, x20
	mov	x4, x19
	bl	_ecma_builtin_helper_array_to_heap
	mov	x1, x0
	mov	x0, x23
	mov	x2, x22
	bl	_ECMA_TRY_CATCH
	ldr	w0, [x26]
	bl	_ECMA_FINALIZE
	subs	x24, x24, #1
	b.gt	LBB0_6
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ECMA_VALUE_EMPTY,4,2           ; @ECMA_VALUE_EMPTY
	.comm	_value,4,2                      ; @value
.subsections_via_symbols
