	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_delta_ipc_close                ## -- Begin function delta_ipc_close
	.p2align	4, 0x90
_delta_ipc_close:                       ## @delta_ipc_close
	.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
	movq	%rdi, %rbx
	callq	_to_ctx
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_to_pctx
	movq	%rax, %r14
	movq	8(%rax), %r12
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.3:
	movq	8(%r12), %rbx
	movq	8(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_hw_free
	movq	$0, 8(%r15)
LBB0_5:
	testq	%rbx, %rbx
	je	LBB0_6
## %bb.7:
	movq	_DELTA_IPC_CLOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %r13
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_build_msg_header
	movl	(%rbx), %edi
	movq	%r13, %rsi
	movl	$4, %edx
	callq	_rpmsg_send
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	(%r12), %edi
	movl	4(%r14), %edx
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %ecx
LBB0_13:
	xorl	%eax, %eax
	callq	_dev_err
LBB0_14:
	incl	(%r14)
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	(%r12), %edi
	movl	4(%r14), %edx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_6:
	movl	(%r12), %edi
	movl	4(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_9:
	movq	%r15, %rbx
	addq	$4, %rbx
	movq	_IPC_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	(%r15), %ecx
	testl	%ecx, %ecx
	je	LBB0_15
## %bb.12:
	movl	(%r12), %edi
	movl	4(%r14), %edx
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_13
LBB0_10:
	movl	(%r12), %edi
	movl	4(%r14), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s   ipc: failed to close, invalid ipc handle\n"

L_.str.1:                               ## @.str.1
	.asciz	"%s   ipc: failed to close, rpmsg is not initialized\n"

	.comm	_DELTA_IPC_CLOSE,4,2            ## @DELTA_IPC_CLOSE
L_.str.2:                               ## @.str.2
	.asciz	"%s   ipc: failed to close, rpmsg_send failed (%d) for DELTA_IPC_CLOSE\n"

	.comm	_IPC_TIMEOUT,4,2                ## @IPC_TIMEOUT
L_.str.3:                               ## @.str.3
	.asciz	"%s   ipc: failed to close, timeout waiting for DELTA_IPC_CLOSE callback\n"

L_.str.4:                               ## @.str.4
	.asciz	"%s   ipc: failed to close, DELTA_IPC_CLOSE completed but with error (%d)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_delta_ipc_close                ; -- Begin function delta_ipc_close
	.p2align	2
_delta_ipc_close:                       ; @delta_ipc_close
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	bl	_to_ctx
	mov	x20, x0
	bl	_to_pctx
	mov	x19, x0
	ldr	x22, [x0, #8]
	cbz	x21, LBB0_8
; %bb.1:
	ldr	x21, [x22, #8]
	ldr	x1, [x20, #8]
	cbz	x1, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_hw_free
	str	xzr, [x20, #8]
LBB0_3:
	cbz	x21, LBB0_9
; %bb.4:
Lloh0:
	adrp	x8, _DELTA_IPC_CLOSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DELTA_IPC_CLOSE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x20
	bl	_build_msg_header
	ldr	w0, [x21]
	add	x1, sp, #8
	mov	w2, #4
	bl	_rpmsg_send
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_11
; %bb.5:
	ldr	w8, [x22]
	ldr	w2, [x19, #4]
	str	x0, [sp]
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x8
LBB0_6:
	bl	_dev_err
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
	ldr	w0, [x22]
	ldr	w2, [x19, #4]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_9:
	ldr	w0, [x22]
	ldr	w2, [x19, #4]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_dev_err
LBB0_11:
	add	x21, x20, #4
Lloh9:
	adrp	x8, _IPC_TIMEOUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IPC_TIMEOUT@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_14
; %bb.12:
	ldr	w8, [x20]
	cbz	w8, LBB0_7
; %bb.13:
	ldr	w0, [x22]
	ldr	w2, [x19, #4]
	str	x8, [sp]
Lloh12:
	adrp	x1, l_.str.4@PAGE
Lloh13:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_6
LBB0_14:
	ldr	w0, [x22]
	ldr	w2, [x19, #4]
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s   ipc: failed to close, invalid ipc handle\n"

l_.str.1:                               ; @.str.1
	.asciz	"%s   ipc: failed to close, rpmsg is not initialized\n"

	.comm	_DELTA_IPC_CLOSE,4,2            ; @DELTA_IPC_CLOSE
l_.str.2:                               ; @.str.2
	.asciz	"%s   ipc: failed to close, rpmsg_send failed (%d) for DELTA_IPC_CLOSE\n"

	.comm	_IPC_TIMEOUT,4,2                ; @IPC_TIMEOUT
l_.str.3:                               ; @.str.3
	.asciz	"%s   ipc: failed to close, timeout waiting for DELTA_IPC_CLOSE callback\n"

l_.str.4:                               ; @.str.4
	.asciz	"%s   ipc: failed to close, DELTA_IPC_CLOSE completed but with error (%d)\n"

.subsections_via_symbols
