	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hv_kbd_connect_to_vsp
_hv_kbd_connect_to_vsp:                 ## @hv_kbd_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, %r14
	callq	_hv_get_drvdata
	movq	%rax, %r15
	leaq	8(%rax), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	_SYNTH_KBD_PROTOCOL_REQUEST@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___cpu_to_le32
	movq	%rax, 16(%r15)
	movq	_SYNTH_KBD_VERSION@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	___cpu_to_le32
	movq	%rax, 8(%r15)
	movl	4(%r14), %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	%rbx, %rsi
	movl	$16, %edx
	movq	%rbx, %rcx
	callq	_vmbus_sendpacket
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	leaq	4(%r15), %rdi
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	(%r15), %edi
	callq	___le32_to_cpu
	movl	%eax, %ecx
	movq	_PROTOCOL_ACCEPTED@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	testl	%ecx, (%rdx)
	jne	LBB0_6
## %bb.4:
	movl	(%r12), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_2:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
LBB0_5:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYNTH_KBD_PROTOCOL_REQUEST,4,2 ## @SYNTH_KBD_PROTOCOL_REQUEST
	.comm	_SYNTH_KBD_VERSION,4,2          ## @SYNTH_KBD_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
	.comm	_PROTOCOL_ACCEPTED,4,2          ## @PROTOCOL_ACCEPTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"synth_kbd protocol request failed (version %d)\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_hv_kbd_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 hv_kbd_connect_to_vsp
_hv_kbd_connect_to_vsp:                 ; @hv_kbd_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	x19, x0
	bl	_hv_get_drvdata
	mov	x20, x0
	add	x21, x0, #8
	mov	x0, x21
	mov	w1, #0
	mov	w2, #16
	bl	_memset
Lloh0:
	adrp	x8, _SYNTH_KBD_PROTOCOL_REQUEST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYNTH_KBD_PROTOCOL_REQUEST@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	___cpu_to_le32
	str	x0, [x20, #16]
Lloh3:
	adrp	x22, _SYNTH_KBD_VERSION@GOTPAGE
Lloh4:
	ldr	x22, [x22, _SYNTH_KBD_VERSION@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	___cpu_to_le32
	str	x0, [x20, #8]
	ldr	w0, [x19, #4]
Lloh5:
	adrp	x8, _VM_PKT_DATA_INBAND@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VM_PKT_DATA_INBAND@GOTPAGEOFF]
Lloh7:
	ldr	w4, [x8]
Lloh8:
	adrp	x8, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED@GOTPAGEOFF]
Lloh10:
	ldr	w5, [x8]
	mov	x1, x21
	mov	w2, #16
	mov	x3, x21
	bl	_vmbus_sendpacket
	cbnz	w0, LBB0_7
; %bb.1:
	add	x0, x20, #4
Lloh11:
	adrp	x8, _HZ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #2
	lsl	w1, w8, #1
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_4
; %bb.2:
	ldr	w0, [x20]
	bl	___le32_to_cpu
Lloh14:
	adrp	x8, _PROTOCOL_ACCEPTED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PROTOCOL_ACCEPTED@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.3:
	mov	w0, #0
	b	LBB0_7
LBB0_4:
Lloh17:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
	ldr	w2, [x22]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh21:
	adrp	x8, _ENODEV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_SYNTH_KBD_PROTOCOL_REQUEST,4,2 ; @SYNTH_KBD_PROTOCOL_REQUEST
	.comm	_SYNTH_KBD_VERSION,4,2          ; @SYNTH_KBD_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
	.comm	_PROTOCOL_ACCEPTED,4,2          ; @PROTOCOL_ACCEPTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"synth_kbd protocol request failed (version %d)\n"

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