	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmbus_close_internal
_vmbus_close_internal:                  ## @vmbus_close_internal
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_vmbus_reset_channel_cb
	movq	(%rbx), %rax
	movq	_CHANNEL_OPENED_STATE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	_CHANNEL_OPEN_STATE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rbx)
	leaq	20(%rbx), %r15
	movq	_CHANNELMSG_CLOSECHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movl	16(%rbx), %eax
	movl	%eax, 20(%rbx)
	movq	%r15, %rdi
	movl	$8, %esi
	movl	$1, %edx
	callq	_vmbus_post_msg
	movl	%eax, %r14d
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_trace_vmbus_close_internal
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	callq	_pr_err
	jmp	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_9:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	8(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.6:
	movq	%rbx, %rdi
	callq	_vmbus_teardown_gpadl
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	callq	_pr_err
LBB0_8:
	movq	$0, 8(%rbx)
	jmp	LBB0_9
LBB0_5:
	xorl	%r14d, %r14d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_CHANNEL_OPENED_STATE,8,3       ## @CHANNEL_OPENED_STATE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CHANNEL_OPEN_STATE,8,3         ## @CHANNEL_OPEN_STATE
	.comm	_CHANNELMSG_CLOSECHANNEL,4,2    ## @CHANNELMSG_CLOSECHANNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Close failed: close post msg return is %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Close failed: teardown gpadl return %d\n"

	.no_dead_strip	_vmbus_close_internal
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmbus_close_internal
_vmbus_close_internal:                  ; @vmbus_close_internal
	.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	_vmbus_reset_channel_cb
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _CHANNEL_OPENED_STATE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHANNEL_OPENED_STATE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _CHANNEL_OPEN_STATE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHANNEL_OPEN_STATE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x19]
Lloh6:
	adrp	x8, _CHANNELMSG_CLOSECHANNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CHANNELMSG_CLOSECHANNEL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #24]
	ldr	w8, [x19, #16]
	mov	x21, x19
	str	w8, [x21, #20]!
	mov	x0, x21
	mov	w1, #8
	mov	w2, #1
	bl	_vmbus_post_msg
	mov	x20, x0
	mov	x0, x21
	mov	x1, x20
	bl	_trace_vmbus_close_internal
	cbz	w20, LBB0_5
; %bb.2:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_pr_err
	b	LBB0_4
LBB0_3:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	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:
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_9
; %bb.6:
	mov	x0, x19
	bl	_vmbus_teardown_gpadl
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.7:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_pr_err
LBB0_8:
	str	xzr, [x19, #8]
	b	LBB0_4
LBB0_9:
	mov	w20, #0
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_CHANNEL_OPENED_STATE,8,3       ; @CHANNEL_OPENED_STATE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CHANNEL_OPEN_STATE,8,3         ; @CHANNEL_OPEN_STATE
	.comm	_CHANNELMSG_CLOSECHANNEL,4,2    ; @CHANNELMSG_CLOSECHANNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Close failed: close post msg return is %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Close failed: teardown gpadl return %d\n"

	.no_dead_strip	_vmbus_close_internal
.subsections_via_symbols
