	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ri_PlanCheck
_ri_PlanCheck:                          ## @ri_PlanCheck
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movq	%rcx, %r15
	movq	%rdx, %r12
	movl	%esi, %r13d
	movq	%rdi, %r14
	movq	(%rcx), %rax
	movq	_RI_PLAN_LAST_ON_PK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	cmovlel	%r9d, %ebx
	leaq	-48(%rbp), %rdi
	leaq	-44(%rbp), %rsi
	callq	_GetUserIdAndSecContext
	movl	%ebx, %edi
	callq	_RelationGetForm
	movq	_SECURITY_LOCAL_USERID_CHANGE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	-44(%rbp), %esi
	movl	(%rax), %edi
	movq	_SECURITY_NOFORCE_RLS@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	_SetUserIdAndSecContext
	movq	%r14, %rdi
	movl	%r13d, %esi
	movq	%r12, %rdx
	callq	_SPI_prepare
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_SPI_result@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_SPI_result_code_string
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edi
	movl	%eax, %edx
	movq	%r14, %rcx
	callq	_elog
LBB0_2:
	movl	-48(%rbp), %edi
	movl	-44(%rbp), %esi
	callq	_SetUserIdAndSecContext
	movq	%rbx, %rdi
	callq	_SPI_keepplan
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_ri_HashPreparedPlan
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RI_PLAN_LAST_ON_PK,8,3         ## @RI_PLAN_LAST_ON_PK
	.comm	_SECURITY_LOCAL_USERID_CHANGE,4,2 ## @SECURITY_LOCAL_USERID_CHANGE
	.comm	_SECURITY_NOFORCE_RLS,4,2       ## @SECURITY_NOFORCE_RLS
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SPI_prepare returned %s for %s"

	.comm	_SPI_result,4,2                 ## @SPI_result
	.no_dead_strip	_ri_PlanCheck
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ri_PlanCheck
_ri_PlanCheck:                          ; @ri_PlanCheck
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x8, [x3]
Lloh0:
	adrp	x9, _RI_PLAN_LAST_ON_PK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _RI_PLAN_LAST_ON_PK@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	w23, w4, w5, gt
	add	x0, sp, #12
	add	x1, sp, #8
	bl	_GetUserIdAndSecContext
	mov	x0, x23
	bl	_RelationGetForm
	ldr	w0, [x0]
	ldr	w8, [sp, #8]
Lloh3:
	adrp	x9, _SECURITY_LOCAL_USERID_CHANGE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SECURITY_LOCAL_USERID_CHANGE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _SECURITY_NOFORCE_RLS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SECURITY_NOFORCE_RLS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w8, w9
	bl	_SetUserIdAndSecContext
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	bl	_SPI_prepare
	mov	x21, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
Lloh12:
	adrp	x8, _SPI_result@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SPI_result@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_SPI_result_code_string
	mov	x2, x0
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x3, x20
	bl	_elog
LBB0_2:
	ldp	w1, w0, [sp, #8]
	bl	_SetUserIdAndSecContext
	mov	x0, x21
	bl	_SPI_keepplan
	mov	x0, x19
	mov	x1, x21
	bl	_ri_HashPreparedPlan
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_RI_PLAN_LAST_ON_PK,8,3         ; @RI_PLAN_LAST_ON_PK
	.comm	_SECURITY_LOCAL_USERID_CHANGE,4,2 ; @SECURITY_LOCAL_USERID_CHANGE
	.comm	_SECURITY_NOFORCE_RLS,4,2       ; @SECURITY_NOFORCE_RLS
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SPI_prepare returned %s for %s"

	.comm	_SPI_result,4,2                 ; @SPI_result
	.no_dead_strip	_ri_PlanCheck
.subsections_via_symbols
