	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function shutdown_onchannelcallback
_shutdown_onchannelcallback:            ## @shutdown_onchannelcallback
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_util_shutdown@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-40(%rbp), %rcx
	leaq	-28(%rbp), %r8
	movq	%rbx, %rsi
	callq	_vmbus_recvpacket
	cmpq	$0, -40(%rbp)
	jle	LBB0_8
## %bb.1:
	movq	16(%rbx), %rax
	movq	_ICMSGTYPE_NEGOTIATE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	leaq	16(%rbx), %rdi
	movq	_fw_versions@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FW_VER_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_sd_versions@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_SD_VER_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_sd_srv_version@GOTPCREL(%rip), %r15
	movq	%rbx, %rsi
	pushq	%r15
	pushq	$0
	callq	_vmbus_prep_negotiate_resp
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movl	(%r15), %esi
	movzwl	%si, %edx
	sarl	$16, %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	jmp	LBB0_7
LBB0_4:
	cmpl	$1, 80(%rbx)
	ja	LBB0_6
## %bb.5:
	movq	_HV_S_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
	movq	_ICMSGHDRFLAG_TRANSACTION@GOTPCREL(%rip), %rax
	movq	_ICMSGHDRFLAG_RESPONSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 24(%rbx)
	movq	-40(%rbp), %rdx
	movl	-28(%rbp), %ecx
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%r9d, %r9d
	callq	_vmbus_sendpacket
	movq	_shutdown_work@GOTPCREL(%rip), %rdi
	callq	_schedule_work
	jmp	LBB0_8
LBB0_6:
	movq	_HV_E_FAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
LBB0_7:
	movq	_ICMSGHDRFLAG_TRANSACTION@GOTPCREL(%rip), %rax
	movq	_ICMSGHDRFLAG_RESPONSE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 24(%rbx)
	movq	-40(%rbp), %rdx
	movl	-28(%rbp), %ecx
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%r9d, %r9d
	callq	_vmbus_sendpacket
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_util_shutdown,8,3              ## @util_shutdown
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_ICMSGTYPE_NEGOTIATE,8,3        ## @ICMSGTYPE_NEGOTIATE
	.comm	_fw_versions,4,2                ## @fw_versions
	.comm	_FW_VER_COUNT,4,2               ## @FW_VER_COUNT
	.comm	_sd_versions,4,2                ## @sd_versions
	.comm	_SD_VER_COUNT,4,2               ## @SD_VER_COUNT
	.comm	_sd_srv_version,4,2             ## @sd_srv_version
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Shutdown IC version %d.%d\n"

	.comm	_HV_S_OK,4,2                    ## @HV_S_OK
L_.str.1:                               ## @.str.1
	.asciz	"Shutdown request received - graceful shutdown initiated\n"

	.comm	_HV_E_FAIL,4,2                  ## @HV_E_FAIL
L_.str.2:                               ## @.str.2
	.asciz	"Shutdown request received - Invalid request\n"

	.comm	_ICMSGHDRFLAG_TRANSACTION,4,2   ## @ICMSGHDRFLAG_TRANSACTION
	.comm	_ICMSGHDRFLAG_RESPONSE,4,2      ## @ICMSGHDRFLAG_RESPONSE
	.comm	_VM_PKT_DATA_INBAND,4,2         ## @VM_PKT_DATA_INBAND
	.comm	_shutdown_work,4,2              ## @shutdown_work
	.no_dead_strip	_shutdown_onchannelcallback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function shutdown_onchannelcallback
_shutdown_onchannelcallback:            ; @shutdown_onchannelcallback
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x0
Lloh0:
	adrp	x8, _util_shutdown@GOTPAGE
Lloh1:
	ldr	x8, [x8, _util_shutdown@GOTPAGEOFF]
Lloh2:
	ldr	x19, [x8]
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x3, sp, #24
	add	x4, sp, #20
	mov	x1, x19
	bl	_vmbus_recvpacket
	ldr	x8, [sp, #24]
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x0, x19
	ldr	x8, [x0, #16]!
Lloh6:
	adrp	x9, _ICMSGTYPE_NEGOTIATE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ICMSGTYPE_NEGOTIATE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
Lloh9:
	adrp	x8, _fw_versions@GOTPAGE
Lloh10:
	ldr	x8, [x8, _fw_versions@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x8, _FW_VER_COUNT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FW_VER_COUNT@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
Lloh15:
	adrp	x8, _sd_versions@GOTPAGE
Lloh16:
	ldr	x8, [x8, _sd_versions@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
Lloh18:
	adrp	x8, _SD_VER_COUNT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SD_VER_COUNT@GOTPAGEOFF]
Lloh20:
	ldr	w5, [x8]
Lloh21:
	adrp	x21, _sd_srv_version@GOTPAGE
Lloh22:
	ldr	x21, [x21, _sd_srv_version@GOTPAGEOFF]
	mov	x1, x19
	mov	x6, #0
	mov	x7, x21
	bl	_vmbus_prep_negotiate_resp
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w8, [x21]
	asr	w9, w8, #16
	and	w8, w8, #0xffff
	stp	x9, x8, [sp]
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_4:
	ldr	w8, [x19, #80]
	cmp	w8, #1
	b.hi	LBB0_6
; %bb.5:
Lloh25:
	adrp	x8, _HV_S_OK@GOTPAGE
Lloh26:
	ldr	x8, [x8, _HV_S_OK@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	str	w8, [x19, #28]
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
Lloh30:
	adrp	x8, _ICMSGHDRFLAG_TRANSACTION@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ICMSGHDRFLAG_TRANSACTION@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
Lloh33:
	adrp	x9, _ICMSGHDRFLAG_RESPONSE@GOTPAGE
Lloh34:
	ldr	x9, [x9, _ICMSGHDRFLAG_RESPONSE@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #24]
	ldr	x2, [sp, #24]
	ldr	w3, [sp, #20]
Lloh36:
	adrp	x8, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh37:
	ldr	x8, [x8, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
Lloh38:
	ldr	w4, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	w5, #0
	bl	_vmbus_sendpacket
Lloh39:
	adrp	x0, _shutdown_work@GOTPAGE
Lloh40:
	ldr	x0, [x0, _shutdown_work@GOTPAGEOFF]
	bl	_schedule_work
	b	LBB0_9
LBB0_6:
Lloh41:
	adrp	x8, _HV_E_FAIL@GOTPAGE
Lloh42:
	ldr	x8, [x8, _HV_E_FAIL@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	str	w8, [x19, #28]
Lloh44:
	adrp	x0, l_.str.2@PAGE
Lloh45:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_pr_info
LBB0_8:
Lloh46:
	adrp	x8, _ICMSGHDRFLAG_TRANSACTION@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ICMSGHDRFLAG_TRANSACTION@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
Lloh49:
	adrp	x9, _ICMSGHDRFLAG_RESPONSE@GOTPAGE
Lloh50:
	ldr	x9, [x9, _ICMSGHDRFLAG_RESPONSE@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x19, #24]
	ldr	x2, [sp, #24]
	ldr	w3, [sp, #20]
Lloh52:
	adrp	x8, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh53:
	ldr	x8, [x8, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
Lloh54:
	ldr	w4, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	w5, #0
	bl	_vmbus_sendpacket
LBB0_9:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_util_shutdown,8,3              ; @util_shutdown
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_ICMSGTYPE_NEGOTIATE,8,3        ; @ICMSGTYPE_NEGOTIATE
	.comm	_fw_versions,4,2                ; @fw_versions
	.comm	_FW_VER_COUNT,4,2               ; @FW_VER_COUNT
	.comm	_sd_versions,4,2                ; @sd_versions
	.comm	_SD_VER_COUNT,4,2               ; @SD_VER_COUNT
	.comm	_sd_srv_version,4,2             ; @sd_srv_version
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Shutdown IC version %d.%d\n"

	.comm	_HV_S_OK,4,2                    ; @HV_S_OK
l_.str.1:                               ; @.str.1
	.asciz	"Shutdown request received - graceful shutdown initiated\n"

	.comm	_HV_E_FAIL,4,2                  ; @HV_E_FAIL
l_.str.2:                               ; @.str.2
	.asciz	"Shutdown request received - Invalid request\n"

	.comm	_ICMSGHDRFLAG_TRANSACTION,4,2   ; @ICMSGHDRFLAG_TRANSACTION
	.comm	_ICMSGHDRFLAG_RESPONSE,4,2      ; @ICMSGHDRFLAG_RESPONSE
	.comm	_VM_PKT_DATA_INBAND,4,2         ; @VM_PKT_DATA_INBAND
	.comm	_shutdown_work,4,2              ; @shutdown_work
	.no_dead_strip	_shutdown_onchannelcallback
.subsections_via_symbols
