	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tuplesort_begin_heap           ## -- Begin function tuplesort_begin_heap
	.p2align	4, 0x90
_tuplesort_begin_heap:                  ## @tuplesort_begin_heap
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -104(%rbp)                 ## 8-byte Spill
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, %r12d
	movl	%edi, %r14d
	movl	16(%rbp), %edi
	movl	24(%rbp), %esi
	movl	32(%rbp), %edx
	callq	_tuplesort_begin_common
	movq	%rax, %rbx
	movl	44(%rax), %edi
	callq	_MemoryContextSwitchTo
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%r12d, %r12d
	setg	%dil
	callq	_AssertArg
	movl	%r12d, (%rbx)
	movq	_HEAP_SORT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_PARALLEL_SORT
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%r12d, %edx
	movl	16(%rbp), %ecx
	movl	32(%rbp), %r8d
	movl	%eax, %r9d
	callq	_TRACE_POSTGRESQL_SORT_START
	movq	_comparetup_heap@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	_copytup_heap@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movq	_writetup_heap@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	_readtup_heap@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movl	%r14d, 24(%rbx)
	movl	$10, 4(%rbx)
	leal	(,%r12,4), %edi
	callq	_palloc0
	movq	%rax, 8(%rbx)
	testl	%r12d, %r12d
	jle	LBB0_7
## %bb.1:
	movq	%rax, %r14
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, %eax
	leaq	-4(,%rax,4), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r14,%r12), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	xorl	%edi, %edi
	cmpq	$0, (%r15,%rbx,2)
	setne	%dil
	callq	_AssertArg
	xorl	%edi, %edi
	cmpq	$0, (%r13,%rbx,2)
	setne	%dil
	callq	_AssertArg
	movq	_CurrentMemoryContext@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r14,%r12)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%rbx,2), %rax
	movq	%rax, 24(%r14,%r12)
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movl	(%rax,%rbx), %eax
	movl	%eax, (%r14,%r12)
	movq	(%r15,%rbx,2), %rax
	movq	%rax, 16(%r14,%r12)
	xorl	%eax, %eax
	testq	%rbx, %rbx
	sete	%al
	movl	%eax, 4(%r14,%r12)
	movq	(%r13,%rbx,2), %rdi
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	callq	_PrepareSortSupportFromOrderingOp
	cmpq	%rbx, -72(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r14
	addq	$4, %rbx
	addq	$40, %r12
	jmp	LBB0_2
LBB0_4:
	cmpl	$1, -64(%rbp)                   ## 4-byte Folded Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jne	LBB0_7
## %bb.5:
	movq	8(%rbx), %rax
	cmpl	$0, 8(%rax)
	jne	LBB0_7
## %bb.6:
	movq	%rax, 16(%rbx)
LBB0_7:
	movl	%r13d, %edi
	callq	_MemoryContextSwitchTo
	movq	%rbx, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HEAP_SORT,4,2                  ## @HEAP_SORT
	.comm	_comparetup_heap,4,2            ## @comparetup_heap
	.comm	_copytup_heap,4,2               ## @copytup_heap
	.comm	_writetup_heap,4,2              ## @writetup_heap
	.comm	_readtup_heap,4,2               ## @readtup_heap
	.comm	_CurrentMemoryContext,4,2       ## @CurrentMemoryContext
	.comm	_LOG,4,2                        ## @LOG
	.comm	_trace_sort,8,3                 ## @trace_sort
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tuplesort_begin_heap           ; -- Begin function tuplesort_begin_heap
	.p2align	2
_tuplesort_begin_heap:                  ; @tuplesort_begin_heap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x26, x6
	mov	x20, x5
	mov	x21, x4
	mov	x22, x3
	mov	x24, x2
	mov	x23, x1
	mov	x27, x0
	ldr	w28, [x29, #16]
	mov	x0, x6
	mov	x1, x7
	mov	x2, x28
	bl	_tuplesort_begin_common
	mov	x19, x0
	ldr	w0, [x0, #44]
	bl	_MemoryContextSwitchTo
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	cmp	w23, #0
	cset	w0, gt
	bl	_AssertArg
	str	w23, [x19]
Lloh0:
	adrp	x8, _HEAP_SORT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HEAP_SORT@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	mov	x0, x19
	bl	_PARALLEL_SORT
	mov	x5, x0
	mov	x0, x25
	mov	w1, #0
	mov	x2, x23
	mov	x3, x26
	mov	x4, x28
	bl	_TRACE_POSTGRESQL_SORT_START
Lloh3:
	adrp	x8, _comparetup_heap@GOTPAGE
Lloh4:
	ldr	x8, [x8, _comparetup_heap@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #40]
Lloh6:
	adrp	x8, _copytup_heap@GOTPAGE
Lloh7:
	ldr	x8, [x8, _copytup_heap@GOTPAGEOFF]
Lloh8:
	adrp	x9, _writetup_heap@GOTPAGE
Lloh9:
	ldr	x9, [x9, _writetup_heap@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #32]
Lloh12:
	adrp	x8, _readtup_heap@GOTPAGE
Lloh13:
	ldr	x8, [x8, _readtup_heap@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	stp	w27, w8, [x19, #24]
	mov	w8, #10
	str	w8, [x19, #4]
	lsl	w0, w23, #2
	bl	_palloc0
	str	x0, [x19, #8]
	cmp	w23, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x26, #0
	mov	w8, #40
	mov	x9, #-40
	umaddl	x27, w23, w8, x9
Lloh15:
	adrp	x28, _CurrentMemoryContext@GOTPAGE
Lloh16:
	ldr	x28, [x28, _CurrentMemoryContext@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x25, x0, x26
	ldr	x8, [x24]
	cmp	x8, #0
	cset	w0, ne
	bl	_AssertArg
	ldr	x8, [x22]
	cmp	x8, #0
	cset	w0, ne
	bl	_AssertArg
	ldr	w8, [x28]
	str	w8, [x25, #32]
	ldr	x8, [x21]
	str	x8, [x25, #24]
	ldr	w8, [x20]
	ldr	x9, [x24]
	str	x9, [x25, #16]
	cmp	x26, #0
	cset	w9, eq
	stp	w8, w9, [x25]
	ldr	x0, [x22]
	mov	x1, x25
	bl	_PrepareSortSupportFromOrderingOp
	cmp	x27, x26
	b.eq	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x26, x26, #40
	ldr	x0, [x19, #8]
	add	x20, x20, #4
	add	x21, x21, #8
	add	x22, x22, #8
	add	x24, x24, #8
	b	LBB0_2
LBB0_4:
	cmp	w23, #1
	b.ne	LBB0_7
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	w9, [x8, #8]
	cbnz	w9, LBB0_7
; %bb.6:
	str	x8, [x19, #16]
LBB0_7:
	ldr	w0, [sp, #12]                   ; 4-byte Folded Reload
	bl	_MemoryContextSwitchTo
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_HEAP_SORT,4,2                  ; @HEAP_SORT
	.comm	_comparetup_heap,4,2            ; @comparetup_heap
	.comm	_copytup_heap,4,2               ; @copytup_heap
	.comm	_writetup_heap,4,2              ; @writetup_heap
	.comm	_readtup_heap,4,2               ; @readtup_heap
	.comm	_CurrentMemoryContext,4,2       ; @CurrentMemoryContext
	.comm	_LOG,4,2                        ; @LOG
	.comm	_trace_sort,8,3                 ; @trace_sort
.subsections_via_symbols
