	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CreatePortal                   ## -- Begin function CreatePortal
	.p2align	4, 0x90
_CreatePortal:                          ## @CreatePortal
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_PointerIsValid
	movl	%eax, %edi
	callq	_AssertArg
	movq	%r14, %rdi
	callq	_GetPortalByName
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_PortalIsValid
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.3:
	testl	%r15d, %r15d
	je	LBB0_4
LBB0_5:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_PortalDrop
LBB0_6:
	movq	_TopPortalContext@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	$52, %esi
	callq	_MemoryContextAllocZero
	movq	%rax, %rbx
	movl	(%r15), %edi
	movq	_ALLOCSET_SMALL_SIZES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rsi
	callq	_AllocSetContextCreate
	movl	%eax, 16(%rbx)
	movq	_CurTransactionResourceOwner@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_ResourceOwnerCreate
	movl	%eax, 48(%rbx)
	movq	_PORTAL_NEW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	movq	_PortalCleanup@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	xorl	%eax, %eax
	callq	_GetCurrentSubTransactionId
	movl	%eax, 32(%rbx)
	movl	%eax, 36(%rbx)
	movq	_PORTAL_MULTI_QUERY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_CURSOR_OPT_NO_SCROLL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, (%rbx)
	movl	$1, 8(%rbx)
	xorl	%eax, %eax
	callq	_GetCurrentStatementStartTimestamp
	movl	%eax, 20(%rbx)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_PortalHashTableInsert
	movl	12(%rbx), %esi
	movl	16(%rbx), %edi
	callq	_MemoryContextSetIdentifier
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_DUPLICATE_CURSOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
	testl	%r15d, %r15d
	jne	LBB0_5
LBB0_4:
	movq	_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_ERRCODE_DUPLICATE_CURSOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	callq	_errmsg
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_ereport
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_ERRCODE_DUPLICATE_CURSOR,4,2   ## @ERRCODE_DUPLICATE_CURSOR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cursor \"%s\" already exists"

	.comm	_WARNING,4,2                    ## @WARNING
L_.str.1:                               ## @.str.1
	.asciz	"closing existing cursor \"%s\""

	.comm	_TopPortalContext,4,2           ## @TopPortalContext
L_.str.2:                               ## @.str.2
	.asciz	"PortalContext"

	.comm	_ALLOCSET_SMALL_SIZES,4,2       ## @ALLOCSET_SMALL_SIZES
	.comm	_CurTransactionResourceOwner,4,2 ## @CurTransactionResourceOwner
L_.str.3:                               ## @.str.3
	.asciz	"Portal"

	.comm	_PORTAL_NEW,4,2                 ## @PORTAL_NEW
	.comm	_PortalCleanup,4,2              ## @PortalCleanup
	.comm	_PORTAL_MULTI_QUERY,4,2         ## @PORTAL_MULTI_QUERY
	.comm	_CURSOR_OPT_NO_SCROLL,4,2       ## @CURSOR_OPT_NO_SCROLL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CreatePortal                   ; -- Begin function CreatePortal
	.p2align	2
_CreatePortal:                          ; @CreatePortal
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	bl	_PointerIsValid
	bl	_AssertArg
	mov	x0, x19
	bl	_GetPortalByName
	mov	x20, x0
	bl	_PortalIsValid
	cbz	x0, LBB0_4
; %bb.1:
	cbz	w22, LBB0_5
; %bb.2:
	cbz	w21, LBB0_6
LBB0_3:
	mov	x0, x20
	mov	w1, #0
	bl	_PortalDrop
LBB0_4:
Lloh0:
	adrp	x21, _TopPortalContext@GOTPAGE
Lloh1:
	ldr	x21, [x21, _TopPortalContext@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	w1, #52
	bl	_MemoryContextAllocZero
	mov	x20, x0
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _ALLOCSET_SMALL_SIZES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ALLOCSET_SMALL_SIZES@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_AllocSetContextCreate
	str	w0, [x20, #16]
Lloh7:
	adrp	x8, _CurTransactionResourceOwner@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CurTransactionResourceOwner@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_ResourceOwnerCreate
	str	w0, [x20, #48]
Lloh12:
	adrp	x8, _PORTAL_NEW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PORTAL_NEW@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _PortalCleanup@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PortalCleanup@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #40]
	bl	_GetCurrentSubTransactionId
	stp	w0, w0, [x20, #32]
Lloh18:
	adrp	x8, _PORTAL_MULTI_QUERY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PORTAL_MULTI_QUERY@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _CURSOR_OPT_NO_SCROLL@GOTPAGE
Lloh22:
	ldr	x9, [x9, _CURSOR_OPT_NO_SCROLL@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #24]
	movi.2s	v0, #1
	str	d0, [x20]
	mov	w8, #1
	str	w8, [x20, #8]
	bl	_GetCurrentStatementStartTimestamp
	str	w0, [x20, #20]
	mov	x0, x20
	mov	x1, x19
	bl	_PortalHashTableInsert
	ldp	w1, w0, [x20, #12]
	bl	_MemoryContextSetIdentifier
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh24:
	adrp	x8, _ERROR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh26:
	ldr	w22, [x8]
Lloh27:
	adrp	x8, _ERRCODE_DUPLICATE_CURSOR@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ERRCODE_DUPLICATE_CURSOR@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	bl	_errcode
Lloh30:
	adrp	x0, l_.str@PAGE
Lloh31:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_errmsg
	mov	x1, x0
	mov	x0, x22
	bl	_ereport
	cbnz	w21, LBB0_3
LBB0_6:
Lloh32:
	adrp	x8, _WARNING@GOTPAGE
Lloh33:
	ldr	x8, [x8, _WARNING@GOTPAGEOFF]
Lloh34:
	ldr	w21, [x8]
Lloh35:
	adrp	x8, _ERRCODE_DUPLICATE_CURSOR@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ERRCODE_DUPLICATE_CURSOR@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	bl	_errcode
Lloh38:
	adrp	x0, l_.str.1@PAGE
Lloh39:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_errmsg
	mov	x1, x0
	mov	x0, x21
	bl	_ereport
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_ERRCODE_DUPLICATE_CURSOR,4,2   ; @ERRCODE_DUPLICATE_CURSOR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cursor \"%s\" already exists"

	.comm	_WARNING,4,2                    ; @WARNING
l_.str.1:                               ; @.str.1
	.asciz	"closing existing cursor \"%s\""

	.comm	_TopPortalContext,4,2           ; @TopPortalContext
l_.str.2:                               ; @.str.2
	.asciz	"PortalContext"

	.comm	_ALLOCSET_SMALL_SIZES,4,2       ; @ALLOCSET_SMALL_SIZES
	.comm	_CurTransactionResourceOwner,4,2 ; @CurTransactionResourceOwner
l_.str.3:                               ; @.str.3
	.asciz	"Portal"

	.comm	_PORTAL_NEW,4,2                 ; @PORTAL_NEW
	.comm	_PortalCleanup,4,2              ; @PortalCleanup
	.comm	_PORTAL_MULTI_QUERY,4,2         ; @PORTAL_MULTI_QUERY
	.comm	_CURSOR_OPT_NO_SCROLL,4,2       ; @CURSOR_OPT_NO_SCROLL
.subsections_via_symbols
