	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _bt_parallel_scan_and_sort
__bt_parallel_scan_and_sort:            ## @_bt_parallel_scan_and_sort
	.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
	movl	%r9d, %r13d
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movl	$4, %edi
	callq	_palloc0
	movabsq	$-4294967295, %rcx              ## imm = 0xFFFFFFFF00000001
	movq	%rcx, (%rax)
	movq	%r12, 8(%rax)
	movq	%r14, %r12
	movl	20(%rbx), %edi
	movl	(%rbx), %edx
	movl	16(%rbx), %esi
	movl	%r13d, %ecx
	movq	%rax, %r8
	xorl	%r9d, %r9d
	callq	_tuplesort_begin_index_btree
	movq	%rax, 8(%rbx)
	testq	%r14, %r14
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movl	$4, %edi
	callq	_palloc0
	movq	%rax, %r12
	movabsq	$-4294967295, %rax              ## imm = 0xFFFFFFFF00000001
	movq	%rax, (%r12)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r12)
	movl	16(%rbx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	20(%rbx), %r14d
	movq	_work_mem@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %edi
	callq	_Min
	movl	%r14d, %edi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	movl	%eax, %ecx
	movq	%r12, %r8
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	xorl	%r9d, %r9d
	callq	_tuplesort_begin_index_btree
	movq	%rax, 8(%r12)
LBB0_2:
	movl	36(%r15), %eax
	movl	%eax, -60(%rbp)
	movl	$0, -104(%rbp)
	movl	20(%rbx), %eax
	movl	%eax, -64(%rbp)
	movq	%rbx, -72(%rbp)
	movq	%r12, -80(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -96(%rbp)
	movl	16(%rbx), %edi
	callq	_BuildIndexInfo
	movq	%rax, %r13
	movl	32(%r15), %eax
	movl	%eax, 8(%r13)
	movl	20(%rbx), %r14d
	movq	%r15, %rdi
	callq	_ParallelTableScanFromBTShared
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_table_beginscan_parallel
                                        ## kill: def $eax killed $eax def $rax
	movl	16(%rbx), %esi
	movl	20(%rbx), %edi
	movq	__bt_build_callback@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	leaq	-104(%rbp), %r10
	movq	%r13, %rdx
	movl	$1, %ecx
	movl	16(%rbp), %r8d
	pushq	%rax
	pushq	%r10
	callq	_table_index_build_scan
	addq	$16, %rsp
	movsd	%xmm0, -48(%rbp)                ## 8-byte Spill
	movq	8(%rbx), %rdi
	callq	_tuplesort_performsort
	testq	%r12, %r12
	je	LBB0_4
## %bb.3:
	movq	8(%r12), %rdi
	callq	_tuplesort_performsort
LBB0_4:
	leaq	20(%r15), %r12
	movq	%r12, %rdi
	callq	_SpinLockAcquire
	incl	28(%r15)
	movsd	-48(%rbp), %xmm0                ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	addsd	(%r15), %xmm0
	movsd	%xmm0, (%r15)
	cmpl	$0, -104(%rbp)
	je	LBB0_6
## %bb.5:
	movl	$1, 8(%r15)
LBB0_6:
	movl	-96(%rbp), %eax
	addl	%eax, 24(%r15)
	cmpq	$0, (%r13)
	je	LBB0_8
## %bb.7:
	movl	$1, 12(%r15)
LBB0_8:
	movq	%r12, %rdi
	callq	_SpinLockRelease
	addq	$16, %r15
	movq	%r15, %rdi
	callq	_ConditionVariableSignal
	movq	8(%rbx), %rdi
	callq	_tuplesort_end
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	8(%rax), %rdi
	callq	_tuplesort_end
LBB0_10:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_work_mem,4,2                   ## @work_mem
	.comm	__bt_build_callback,4,2         ## @_bt_build_callback
	.no_dead_strip	__bt_parallel_scan_and_sort
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function _bt_parallel_scan_and_sort
lCPI0_0:
	.long	1                               ; 0x1
	.long	4294967295                      ; 0xffffffff
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
__bt_parallel_scan_and_sort:            ; @_bt_parallel_scan_and_sort
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	d9, d8, [sp, #48]               ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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 b8, -88
	.cfi_offset b9, -96
	mov	x22, x6
	mov	x23, x5
	mov	x24, x4
	mov	x25, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	mov	w0, #4
	bl	_palloc0
	mov	x4, x0
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	d8, [x8, lCPI0_0@PAGEOFF]
	str	d8, [x0]
	str	x25, [x0, #8]
	ldp	w1, w0, [x20, #16]
	ldr	w2, [x20]
	mov	x3, x23
	mov	w5, #0
	bl	_tuplesort_begin_index_btree
	str	x0, [x20, #8]
	cbz	x19, LBB0_2
; %bb.1:
	mov	w0, #4
	bl	_palloc0
	mov	x25, x0
	str	d8, [x0]
	str	x24, [x0, #8]
	ldp	w26, w24, [x20, #16]
Lloh2:
	adrp	x8, _work_mem@GOTPAGE
Lloh3:
	ldr	x8, [x8, _work_mem@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_Min
	mov	x3, x0
	mov	x0, x24
	mov	x1, x26
	mov	w2, #0
	mov	x4, x25
	mov	w5, #0
	bl	_tuplesort_begin_index_btree
	str	x0, [x19, #8]
LBB0_2:
	ldr	w8, [x21, #36]
	str	wzr, [sp]
	ldp	w0, w9, [x20, #16]
	stp	w9, w8, [sp, #40]
	stp	x19, x20, [sp, #24]
	stp	xzr, xzr, [sp, #8]
	bl	_BuildIndexInfo
	mov	x23, x0
	ldr	w8, [x21, #32]
	str	w8, [x0, #8]
	ldr	w24, [x20, #20]
	mov	x0, x21
	bl	_ParallelTableScanFromBTShared
	mov	x1, x0
	mov	x0, x24
	bl	_table_beginscan_parallel
	mov	x7, x0
	ldp	w1, w0, [x20, #16]
Lloh5:
	adrp	x8, __bt_build_callback@GOTPAGE
Lloh6:
	ldr	x8, [x8, __bt_build_callback@GOTPAGEOFF]
Lloh7:
	ldr	w5, [x8]
	mov	x6, sp
	mov	x2, x23
	mov	w3, #1
	mov	x4, x22
	bl	_table_index_build_scan
	fmov	d8, d0
	ldr	x0, [x20, #8]
	bl	_tuplesort_performsort
	cbz	x19, LBB0_4
; %bb.3:
	ldr	x0, [x19, #8]
	bl	_tuplesort_performsort
LBB0_4:
	add	x22, x21, #20
	mov	x0, x22
	bl	_SpinLockAcquire
	ldr	w8, [x21, #28]
	add	w8, w8, #1
	str	w8, [x21, #28]
	ldr	d0, [x21]
	fadd	d0, d8, d0
	str	d0, [x21]
	ldr	w8, [sp]
	cbz	w8, LBB0_6
; %bb.5:
	mov	w8, #1
	str	w8, [x21, #8]
LBB0_6:
	ldr	w8, [sp, #8]
	ldr	w9, [x21, #24]
	add	w8, w9, w8
	str	w8, [x21, #24]
	ldr	x8, [x23]
	cbz	x8, LBB0_8
; %bb.7:
	mov	w8, #1
	str	w8, [x21, #12]
LBB0_8:
	mov	x0, x22
	bl	_SpinLockRelease
	add	x0, x21, #16
	bl	_ConditionVariableSignal
	ldr	x0, [x20, #8]
	bl	_tuplesort_end
	cbz	x19, LBB0_10
; %bb.9:
	ldr	x0, [x19, #8]
	bl	_tuplesort_end
LBB0_10:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #48]               ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_work_mem,4,2                   ; @work_mem
	.comm	__bt_build_callback,4,2         ; @_bt_build_callback
	.no_dead_strip	__bt_parallel_scan_and_sort
.subsections_via_symbols
