	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CompleteCachedPlan             ## -- Begin function CompleteCachedPlan
	.p2align	4, 0x90
_CompleteCachedPlan:                    ## @CompleteCachedPlan
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
                                        ## kill: def $r8d killed $r8d def $r8
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	104(%rdi), %r14
	movq	_CurrentMemoryContext@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	_CACHEDPLANSOURCE_MAGIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_Assert
	xorl	%edi, %edi
	cmpl	$0, 8(%rbx)
	sete	%dil
	callq	_Assert
	cmpq	$0, 80(%rbx)
	je	LBB0_2
## %bb.1:
	movq	(%r13), %rax
	movq	%rax, 96(%rbx)
	movq	%r12, 88(%rbx)
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_8
LBB0_2:
	testq	%r15, %r15
	je	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_MemoryContextSetParent
	movq	%r15, %rdi
	callq	_MemoryContextSwitchTo
	jmp	LBB0_5
LBB0_4:
	movq	_ALLOCSET_START_SMALL_SIZES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_AllocSetContextCreate
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_MemoryContextSwitchTo
	movq	%r12, %rdi
	callq	_copyObject
	movq	%rax, %r12
LBB0_5:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r15, 96(%rbx)
	movq	%r12, 88(%rbx)
	cmpq	$0, 80(%rbx)
	jne	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	callq	_IsTransactionStmtPlan
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	leaq	76(%rbx), %rsi
	leaq	72(%rbx), %rdx
	leaq	68(%rbx), %rcx
	movq	%r12, %rdi
	callq	_extract_query_dependencies
	xorl	%eax, %eax
	callq	_GetUserId
	movl	%eax, 64(%rbx)
	movq	_row_security@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 60(%rbx)
	movq	%r15, %rdi
	callq	_GetOverrideSearchPath
	movl	%eax, 56(%rbx)
LBB0_8:
	movl	32(%rbp), %r15d
	movq	%r14, %rdi
	callq	_MemoryContextSwitchTo
	testl	%r13d, %r13d
	jle	LBB0_10
## %bb.9:
	leal	(,%r13,4), %r14d
	movl	%r14d, %edi
	callq	_palloc
	movq	%rax, 48(%rbx)
	movq	%rax, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_memcpy
	jmp	LBB0_11
LBB0_10:
	movq	$0, 48(%rbx)
LBB0_11:
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	24(%rbp), %ecx
	movq	16(%rbp), %rdx
	movl	%r13d, 12(%rbx)
	movl	%eax, 40(%rbx)
	movq	%rdx, 32(%rbx)
	movl	%ecx, 16(%rbx)
	movl	%r15d, 20(%rbx)
	movq	%r12, %rdi
	callq	_PlanCacheComputeResultDesc
	movl	%eax, 28(%rbx)
	movq	%r14, %rdi
	callq	_MemoryContextSwitchTo
	movl	$1, 8(%rbx)
	movl	$1, 24(%rbx)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CurrentMemoryContext,8,3       ## @CurrentMemoryContext
	.comm	_CACHEDPLANSOURCE_MAGIC,8,3     ## @CACHEDPLANSOURCE_MAGIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CachedPlanQuery"

	.comm	_ALLOCSET_START_SMALL_SIZES,4,2 ## @ALLOCSET_START_SMALL_SIZES
	.comm	_row_security,4,2               ## @row_security
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CompleteCachedPlan             ; -- Begin function CompleteCachedPlan
	.p2align	2
_CompleteCachedPlan:                    ; @CompleteCachedPlan
	.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	x20, x7
	mov	x22, x6
	mov	x24, x5
	mov	x23, x4
	str	x3, [sp, #8]                    ; 8-byte Folded Spill
	mov	x28, x2
	mov	x25, x1
	mov	x19, x0
	ldr	x27, [x0, #104]
Lloh0:
	adrp	x26, _CurrentMemoryContext@GOTPAGE
Lloh1:
	ldr	x26, [x26, _CurrentMemoryContext@GOTPAGEOFF]
	ldr	x21, [x26]
	ldr	x8, [x0]
Lloh2:
	adrp	x9, _CACHEDPLANSOURCE_MAGIC@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CACHEDPLANSOURCE_MAGIC@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_Assert
	ldr	w8, [x19, #8]
	cmp	w8, #0
	cset	w0, eq
	bl	_Assert
	ldr	x8, [x19, #80]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x26]
	stp	x25, x8, [x19, #88]
	b	LBB0_8
LBB0_2:
	cbz	x28, LBB0_4
; %bb.3:
	mov	x0, x28
	mov	x1, x27
	bl	_MemoryContextSetParent
	mov	x0, x28
	bl	_MemoryContextSwitchTo
	b	LBB0_5
LBB0_4:
Lloh5:
	adrp	x8, _ALLOCSET_START_SMALL_SIZES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ALLOCSET_START_SMALL_SIZES@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x27
	bl	_AllocSetContextCreate
	mov	x28, x0
	bl	_MemoryContextSwitchTo
	mov	x0, x25
	bl	_copyObject
	mov	x25, x0
LBB0_5:
	ldr	x8, [x19, #80]
	stp	x25, x28, [x19, #88]
	cbnz	x8, LBB0_8
; %bb.6:
	mov	x0, x19
	bl	_IsTransactionStmtPlan
	cbnz	w0, LBB0_8
; %bb.7:
	add	x1, x19, #76
	add	x2, x19, #72
	add	x3, x19, #68
	mov	x0, x25
	bl	_extract_query_dependencies
	bl	_GetUserId
Lloh10:
	adrp	x8, _row_security@GOTPAGE
Lloh11:
	ldr	x8, [x8, _row_security@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	stp	w8, w0, [x19, #60]
	mov	x0, x28
	bl	_GetOverrideSearchPath
	str	w0, [x19, #56]
LBB0_8:
	ldr	w28, [x29, #16]
	mov	x0, x27
	bl	_MemoryContextSwitchTo
	cmp	w23, #1
	b.lt	LBB0_10
; %bb.9:
	lsl	w27, w23, #2
	mov	x0, x27
	bl	_palloc
	str	x0, [x19, #48]
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, x27
	bl	_memcpy
	b	LBB0_11
LBB0_10:
	str	xzr, [x19, #48]
LBB0_11:
	str	w24, [x19, #40]
	str	x22, [x19, #32]
	stp	w23, w20, [x19, #12]
	str	w28, [x19, #20]
	mov	x0, x25
	bl	_PlanCacheComputeResultDesc
	str	w0, [x19, #28]
	mov	x0, x21
	bl	_MemoryContextSwitchTo
	mov	w8, #1
	str	w8, [x19, #8]
	str	w8, [x19, #24]
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_CurrentMemoryContext,8,3       ; @CurrentMemoryContext
	.comm	_CACHEDPLANSOURCE_MAGIC,8,3     ; @CACHEDPLANSOURCE_MAGIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CachedPlanQuery"

	.comm	_ALLOCSET_START_SMALL_SIZES,4,2 ; @ALLOCSET_START_SMALL_SIZES
	.comm	_row_security,4,2               ; @row_security
.subsections_via_symbols
