	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function choose_next_subplan_locally
_choose_next_subplan_locally:           ## @choose_next_subplan_locally
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	(%rdi), %ebx
	movq	_NO_MATCHING_SUBPLANS@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpl	(%rax), %ebx
	setne	%dil
	callq	_Assert
	movq	_INVALID_SUBPLAN_INDEX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_3
## %bb.1:
	movl	$-1, %ebx
	cmpq	$0, 8(%r14)
	jne	LBB0_4
## %bb.2:
	movl	24(%r14), %edi
	callq	_ExecFindMatchingSubPlans
	movq	%rax, 8(%r14)
	jmp	LBB0_4
LBB0_3:
	xorl	%edi, %edi
	cmpl	$-1, %ebx
	jl	LBB0_5
LBB0_4:
	xorl	%edi, %edi
	cmpl	4(%r14), %ebx
	setle	%dil
LBB0_5:
	callq	_Assert
	movq	16(%r14), %rax
	movl	(%rax), %edi
	callq	_ScanDirectionIsForward
	movq	8(%r14), %rdi
	movl	%ebx, %esi
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	callq	_bms_next_member
	testl	%eax, %eax
	js	LBB0_9
LBB0_10:
	movl	%eax, (%r14)
	movl	$1, %eax
	jmp	LBB0_11
LBB0_7:
	callq	_bms_prev_member
	testl	%eax, %eax
	jns	LBB0_10
LBB0_9:
	xorl	%eax, %eax
LBB0_11:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NO_MATCHING_SUBPLANS,4,2       ## @NO_MATCHING_SUBPLANS
	.comm	_INVALID_SUBPLAN_INDEX,4,2      ## @INVALID_SUBPLAN_INDEX
	.no_dead_strip	_choose_next_subplan_locally
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function choose_next_subplan_locally
_choose_next_subplan_locally:           ; @choose_next_subplan_locally
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w20, [x0]
Lloh0:
	adrp	x8, _NO_MATCHING_SUBPLANS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NO_MATCHING_SUBPLANS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w20, w8
	cset	w0, ne
	bl	_Assert
Lloh3:
	adrp	x8, _INVALID_SUBPLAN_INDEX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _INVALID_SUBPLAN_INDEX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_4
; %bb.1:
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	w0, [x19, #24]
	bl	_ExecFindMatchingSubPlans
	str	x0, [x19, #8]
LBB0_3:
	mov	w20, #-1
	b	LBB0_5
LBB0_4:
	cmn	w20, #1
	b.lt	LBB0_6
LBB0_5:
	ldr	w8, [x19, #4]
	cmp	w20, w8
	cset	w0, le
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	bl	_Assert
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	bl	_ScanDirectionIsForward
	mov	x8, x0
	ldr	x0, [x19, #8]
	mov	x1, x20
	cbz	x8, LBB0_10
; %bb.8:
	bl	_bms_next_member
	tbnz	w0, #31, LBB0_11
LBB0_9:
	str	w0, [x19]
	mov	w0, #1
	b	LBB0_12
LBB0_10:
	bl	_bms_prev_member
	tbz	w0, #31, LBB0_9
LBB0_11:
	mov	w0, #0
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NO_MATCHING_SUBPLANS,4,2       ; @NO_MATCHING_SUBPLANS
	.comm	_INVALID_SUBPLAN_INDEX,4,2      ; @INVALID_SUBPLAN_INDEX
	.no_dead_strip	_choose_next_subplan_locally
.subsections_via_symbols
