	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psmouse_switch_protocol
_psmouse_switch_protocol:               ## @psmouse_switch_protocol
	.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
	movq	64(%rdi), %rax
	movq	72(%rdi), %r15
	movq	%rax, 24(%r15)
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.1:
	movq	%rsi, %r14
	cmpq	$0, (%rsi)
	jne	LBB0_3
## %bb.2:
	cmpq	$0, 8(%r14)
	je	LBB0_8
LBB0_3:
	movq	%rbx, %rdi
	callq	_psmouse_apply_defaults
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	*%rax
	testq	%rax, %rax
	js	LBB0_15
LBB0_5:
	movq	8(%r14), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.6:
	movq	%rbx, %rdi
	callq	*%rcx
	testq	%rax, %rax
	jns	LBB0_9
LBB0_15:
	movl	$-1, %eax
	jmp	LBB0_14
LBB0_8:
	movq	_psmouse_max_proto@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_psmouse_extensions
	movl	%eax, %edi
	callq	_psmouse_protocol_by_type
	movq	%rax, %r14
LBB0_9:
	movq	%r14, 32(%rbx)
	cmpl	$3, (%rbx)
	je	LBB0_12
## %bb.10:
	cmpq	$0, 48(%rbx)
	je	LBB0_13
## %bb.11:
	movq	%rbx, %rdi
	callq	*56(%rbx)
	testq	%rax, %rax
	je	LBB0_13
LBB0_12:
	movq	$0, 48(%rbx)
LBB0_13:
	movl	44(%rbx), %edi
	movq	16(%r14), %rcx
	movq	8(%rbx), %r8
	movq	16(%rbx), %r9
	leaq	L_.str(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movl	44(%rbx), %eax
	movl	%eax, 20(%r15)
	movl	40(%rbx), %eax
	movl	%eax, 16(%r15)
	movq	_BUS_I8042@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movl	$2, (%r15)
	movq	32(%rbx), %rax
	movl	24(%rax), %eax
	movl	%eax, 8(%r15)
	movl	24(%rbx), %eax
	movl	%eax, 4(%r15)
	xorl	%eax, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_psmouse_max_proto,4,2          ## @psmouse_max_proto
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s %s %s"

	.comm	_BUS_I8042,4,2                  ## @BUS_I8042
	.no_dead_strip	_psmouse_switch_protocol
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psmouse_switch_protocol
_psmouse_switch_protocol:               ; @psmouse_switch_protocol
	.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
	ldp	x8, x21, [x0, #64]
	str	x8, [x21, #24]
	cbz	x1, LBB0_8
; %bb.1:
	mov	x20, x1
	ldr	x8, [x1]
	cbnz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_8
LBB0_3:
	mov	x0, x19
	bl	_psmouse_apply_defaults
	ldr	x8, [x20]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x19
	mov	w1, #1
	blr	x8
	tbnz	x0, #63, LBB0_7
LBB0_5:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_9
; %bb.6:
	mov	x0, x19
	blr	x8
	tbz	x0, #63, LBB0_9
LBB0_7:
	mov	w0, #-1
	b	LBB0_14
LBB0_8:
Lloh0:
	adrp	x8, _psmouse_max_proto@GOTPAGE
Lloh1:
	ldr	x8, [x8, _psmouse_max_proto@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_psmouse_extensions
	bl	_psmouse_protocol_by_type
	mov	x20, x0
LBB0_9:
	str	x20, [x19, #32]
	ldr	w8, [x19]
	cmp	w8, #3
	b.eq	LBB0_12
; %bb.10:
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_13
; %bb.11:
	ldr	x8, [x19, #56]
	mov	x0, x19
	blr	x8
	cbz	x0, LBB0_13
LBB0_12:
	str	xzr, [x19, #48]
LBB0_13:
	ldr	w0, [x19, #44]
	ldr	x3, [x20, #16]
	ldp	x4, x5, [x19, #8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #4
	bl	_snprintf
	mov	w0, #0
	ldr	d0, [x19, #40]
	str	d0, [x21, #16]
Lloh5:
	adrp	x8, _BUS_I8042@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BUS_I8042@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	mov	w9, #2
	ldr	x10, [x19, #32]
	ldr	w10, [x10, #24]
	stp	w10, w8, [x21, #8]
	ldr	w8, [x19, #24]
	stp	w9, w8, [x21]
LBB0_14:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_psmouse_max_proto,4,2          ; @psmouse_max_proto
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s %s %s"

	.comm	_BUS_I8042,4,2                  ; @BUS_I8042
	.no_dead_strip	_psmouse_switch_protocol
.subsections_via_symbols
