	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PortalCleanup                  ## -- Begin function PortalCleanup
	.p2align	4, 0x90
_PortalCleanup:                         ## @PortalCleanup
	.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
	movq	%rdi, %rbx
	callq	_PortalIsValid
	movl	%eax, %edi
	callq	_AssertArg
	leaq	_PortalCleanup(%rip), %rax
	xorl	%edi, %edi
	cmpq	%rax, (%rbx)
	sete	%dil
	callq	_AssertArg
	movq	24(%rbx), %r14
	testq	%r14, %r14
	je	LBB0_5
## %bb.1:
	movq	$0, 24(%rbx)
	movq	8(%rbx), %rax
	movq	_PORTAL_FAILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.2:
	movq	_CurrentResourceOwner@GOTPCREL(%rip), %r15
	movq	(%r15), %r12
	movq	16(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%rax, (%r15)
LBB0_4:
	movq	%r14, %rdi
	callq	_ExecutorFinish
	movq	%r14, %rdi
	callq	_ExecutorEnd
	movq	%r14, %rdi
	callq	_FreeQueryDesc
	movq	%r12, (%r15)
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PORTAL_FAILED,8,3              ## @PORTAL_FAILED
	.comm	_CurrentResourceOwner,8,3       ## @CurrentResourceOwner
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PortalCleanup                  ; -- Begin function PortalCleanup
	.p2align	2
_PortalCleanup:                         ; @PortalCleanup
	.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	x19, x0
	bl	_PortalIsValid
	bl	_AssertArg
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _PortalCleanup@PAGE
Lloh1:
	add	x9, x9, _PortalCleanup@PAGEOFF
	cmp	x8, x9
	cset	w0, eq
	bl	_AssertArg
	ldr	x20, [x19, #24]
	cbz	x20, LBB0_5
; %bb.1:
	str	xzr, [x19, #24]
	ldr	x8, [x19, #8]
Lloh2:
	adrp	x9, _PORTAL_FAILED@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PORTAL_FAILED@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.2:
Lloh5:
	adrp	x21, _CurrentResourceOwner@GOTPAGE
Lloh6:
	ldr	x21, [x21, _CurrentResourceOwner@GOTPAGEOFF]
	ldr	x22, [x21]
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_4
; %bb.3:
	str	x8, [x21]
LBB0_4:
	mov	x0, x20
	bl	_ExecutorFinish
	mov	x0, x20
	bl	_ExecutorEnd
	mov	x0, x20
	bl	_FreeQueryDesc
	str	x22, [x21]
LBB0_5:
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_PORTAL_FAILED,8,3              ; @PORTAL_FAILED
	.comm	_CurrentResourceOwner,8,3       ; @CurrentResourceOwner
.subsections_via_symbols
