	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mousevsc_connect_to_vsp
_mousevsc_connect_to_vsp:               ## @mousevsc_connect_to_vsp
	.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, %r15
	callq	_hv_get_drvdata
	movq	%rax, %rbx
	leaq	32(%rax), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	_PIPE_MESSAGE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rbx)
	movl	$4, 32(%rbx)
	movq	_SYNTH_HID_PROTOCOL_REQUEST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movl	$4, 44(%rbx)
	movq	_SYNTHHID_INPUT_VERSION@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movl	%eax, 40(%rbx)
	movl	(%r15), %edi
	movq	_VM_PKT_DATA_INBAND@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r14, %rsi
	movl	$7, %edx
	movq	%r14, %rcx
	callq	_vmbus_sendpacket
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	leaq	4(%rbx), %r14
	movq	_HZ@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	leal	(%rax,%rax,4), %esi
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	cmpl	$0, 12(%rbx)
	je	LBB0_5
## %bb.6:
	movl	(%r15), %eax
	leal	(%rax,%rax,4), %esi
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	testq	%rax, %rax
	je	LBB0_2
## %bb.7:
	movl	(%rbx), %eax
	jmp	LBB0_8
LBB0_2:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_5:
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PIPE_MESSAGE_DATA,4,2          ## @PIPE_MESSAGE_DATA
	.comm	_SYNTH_HID_PROTOCOL_REQUEST,4,2 ## @SYNTH_HID_PROTOCOL_REQUEST
	.comm	_SYNTHHID_INPUT_VERSION,4,2     ## @SYNTHHID_INPUT_VERSION
	.comm	_VM_PKT_DATA_INBAND,4,2         ## @VM_PKT_DATA_INBAND
	.comm	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED,4,2 ## @VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED
	.comm	_HZ,4,2                         ## @HZ
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"synthhid protocol request failed (version %d)\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_mousevsc_connect_to_vsp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mousevsc_connect_to_vsp
_mousevsc_connect_to_vsp:               ; @mousevsc_connect_to_vsp
	.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	x20, x0
	bl	_hv_get_drvdata
	mov	x19, x0
	add	x21, x0, #32
	mov	x0, x21
	mov	w1, #0
	mov	w2, #24
	bl	_memset
Lloh0:
	adrp	x8, _PIPE_MESSAGE_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PIPE_MESSAGE_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w9, #4
	str	w9, [x19, #32]
Lloh3:
	adrp	x10, _SYNTH_HID_PROTOCOL_REQUEST@GOTPAGE
Lloh4:
	ldr	x10, [x10, _SYNTH_HID_PROTOCOL_REQUEST@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	stp	w10, w8, [x19, #48]
Lloh6:
	adrp	x22, _SYNTHHID_INPUT_VERSION@GOTPAGE
Lloh7:
	ldr	x22, [x22, _SYNTHHID_INPUT_VERSION@GOTPAGEOFF]
	ldr	w8, [x22]
	stp	w8, w9, [x19, #40]
	ldr	w0, [x20]
Lloh8:
	adrp	x8, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
Lloh10:
	ldr	w4, [x8]
Lloh11:
	adrp	x8, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGEOFF]
Lloh13:
	ldr	w5, [x8]
	mov	x1, x21
	mov	w2, #7
	mov	x3, x21
	bl	_vmbus_sendpacket
	cbnz	w0, LBB0_8
; %bb.1:
	add	x20, x19, #4
Lloh14:
	adrp	x21, _HZ@GOTPAGE
Lloh15:
	ldr	x21, [x21, _HZ@GOTPAGEOFF]
	ldr	w8, [x21]
	add	w1, w8, w8, lsl #2
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_5
; %bb.2:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_6
; %bb.3:
	ldr	w8, [x21]
	add	w1, w8, w8, lsl #2
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w0, [x19]
	b	LBB0_8
LBB0_5:
Lloh16:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
	ldr	w1, [x22]
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh20:
	adrp	x8, _ENODEV@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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 AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_PIPE_MESSAGE_DATA,4,2          ; @PIPE_MESSAGE_DATA
	.comm	_SYNTH_HID_PROTOCOL_REQUEST,4,2 ; @SYNTH_HID_PROTOCOL_REQUEST
	.comm	_SYNTHHID_INPUT_VERSION,4,2     ; @SYNTHHID_INPUT_VERSION
	.comm	_VM_PKT_DATA_INBAND,4,2         ; @VM_PKT_DATA_INBAND
	.comm	_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED,4,2 ; @VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED
	.comm	_HZ,4,2                         ; @HZ
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"synthhid protocol request failed (version %d)\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_mousevsc_connect_to_vsp
.subsections_via_symbols
