	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function timesync_onchannelcallback
_timesync_onchannelcallback:            ## @timesync_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_timesynch@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_9
## %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	_ts_versions@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_TS_VER_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_ts_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_8
## %bb.3:
	movl	(%r15), %esi
	movzwl	%si, %edx
	sarl	$16, %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	jmp	LBB0_8
LBB0_4:
	movq	_ts_srv_version@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_TS_VERSION_3@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_6
## %bb.5:
	movl	88(%rbx), %edi
	movl	80(%rbx), %edx
	movl	84(%rbx), %esi
	jmp	LBB0_7
LBB0_6:
	movl	84(%rbx), %r15d
	movq	_hyperv_cs@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	*(%rdi)
	movl	80(%rbx), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
LBB0_7:
	callq	_adj_guesttime
LBB0_8:
	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_9:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_util_timesynch,8,3             ## @util_timesynch
	.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	_ts_versions,4,2                ## @ts_versions
	.comm	_TS_VER_COUNT,4,2               ## @TS_VER_COUNT
	.comm	_ts_srv_version,4,2             ## @ts_srv_version
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TimeSync IC version %d.%d\n"

	.comm	_TS_VERSION_3,4,2               ## @TS_VERSION_3
	.comm	_hyperv_cs,8,3                  ## @hyperv_cs
	.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
	.no_dead_strip	_timesync_onchannelcallback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function timesync_onchannelcallback
_timesync_onchannelcallback:            ; @timesync_onchannelcallback
	.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	x19, x0
Lloh0:
	adrp	x8, _util_timesynch@GOTPAGE
Lloh1:
	ldr	x8, [x8, _util_timesynch@GOTPAGEOFF]
Lloh2:
	ldr	x20, [x8]
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x1, x20
	bl	_vmbus_recvpacket
	ldr	x8, [sp, #8]
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x0, x20
	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, _ts_versions@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ts_versions@GOTPAGEOFF]
Lloh17:
	ldr	w4, [x8]
Lloh18:
	adrp	x8, _TS_VER_COUNT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TS_VER_COUNT@GOTPAGEOFF]
Lloh20:
	ldr	w5, [x8]
Lloh21:
	adrp	x21, _ts_srv_version@GOTPAGE
Lloh22:
	ldr	x21, [x21, _ts_srv_version@GOTPAGEOFF]
	mov	x1, x20
	mov	x6, #0
	mov	x7, x21
	bl	_vmbus_prep_negotiate_resp
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w8, [x21]
	asr	w1, w8, #16
	and	w2, w8, #0xffff
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
	b	LBB0_8
LBB0_4:
Lloh25:
	adrp	x8, _ts_srv_version@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ts_srv_version@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _TS_VERSION_3@GOTPAGE
Lloh29:
	ldr	x9, [x9, _TS_VERSION_3@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_6
; %bb.5:
	ldp	w1, w0, [x20, #84]
	ldr	w2, [x20, #80]
	b	LBB0_7
LBB0_6:
	ldr	w21, [x20, #84]
Lloh31:
	adrp	x8, _hyperv_cs@GOTPAGE
Lloh32:
	ldr	x8, [x8, _hyperv_cs@GOTPAGEOFF]
Lloh33:
	ldr	x0, [x8]
	ldr	x8, [x0]
	blr	x8
	mov	x1, x0
	ldr	w2, [x20, #80]
	mov	x0, x21
LBB0_7:
	bl	_adj_guesttime
LBB0_8:
Lloh34:
	adrp	x8, _ICMSGHDRFLAG_TRANSACTION@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ICMSGHDRFLAG_TRANSACTION@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _ICMSGHDRFLAG_RESPONSE@GOTPAGE
Lloh38:
	ldr	x9, [x9, _ICMSGHDRFLAG_RESPONSE@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x20, #24]
	ldr	x2, [sp, #8]
	ldr	w3, [sp, #4]
Lloh40:
	adrp	x8, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh41:
	ldr	x8, [x8, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
Lloh42:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	w5, #0
	bl	_vmbus_sendpacket
LBB0_9:
	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
	.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 AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_util_timesynch,8,3             ; @util_timesynch
	.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	_ts_versions,4,2                ; @ts_versions
	.comm	_TS_VER_COUNT,4,2               ; @TS_VER_COUNT
	.comm	_ts_srv_version,4,2             ; @ts_srv_version
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TimeSync IC version %d.%d\n"

	.comm	_TS_VERSION_3,4,2               ; @TS_VERSION_3
	.comm	_hyperv_cs,8,3                  ; @hyperv_cs
	.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
	.no_dead_strip	_timesync_onchannelcallback
.subsections_via_symbols
