	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intellimouse_detect
_intellimouse_detect:                   ## @intellimouse_detect
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r12
	leaq	32(%rdi), %rbx
	movb	$-56, -42(%rbp)
	movq	_PSMOUSE_CMD_SETRATE@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	leaq	-42(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ps2_command
	movb	$100, -42(%rbp)
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ps2_command
	movb	$80, -42(%rbp)
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ps2_command
	movq	_PSMOUSE_CMD_GETID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ps2_command
	movl	$-1, %r14d
	cmpb	$3, -42(%rbp)
	jne	LBB0_7
## %bb.1:
	xorl	%r14d, %r14d
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.2:
	movq	_BTN_MIDDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r12), %rax
	movl	4(%rax), %esi
	callq	___set_bit
	movq	_REL_WHEEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r12), %rax
	movl	(%rax), %esi
	callq	___set_bit
	cmpq	$0, (%r12)
	je	LBB0_3
## %bb.4:
	cmpq	$0, 8(%r12)
	je	LBB0_5
LBB0_6:
	movl	$4, 16(%r12)
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	L_.str(%rip), %rax
	movq	%rax, (%r12)
	cmpq	$0, 8(%r12)
	jne	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 8(%r12)
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_PSMOUSE_CMD_SETRATE,4,2        ## @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_GETID,4,2          ## @PSMOUSE_CMD_GETID
	.comm	_BTN_MIDDLE,4,2                 ## @BTN_MIDDLE
	.comm	_REL_WHEEL,4,2                  ## @REL_WHEEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Generic"

L_.str.1:                               ## @.str.1
	.asciz	"Wheel Mouse"

	.no_dead_strip	_intellimouse_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intellimouse_detect
_intellimouse_detect:                   ; @intellimouse_detect
	.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	x20, x1
	mov	x19, x0
	add	x21, x0, #32
	mov	w8, #200
	strb	w8, [sp, #14]
Lloh0:
	adrp	x22, _PSMOUSE_CMD_SETRATE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PSMOUSE_CMD_SETRATE@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x1, sp, #14
	mov	x0, x21
	bl	_ps2_command
	mov	w8, #100
	strb	w8, [sp, #14]
	ldr	w2, [x22]
	add	x1, sp, #14
	mov	x0, x21
	bl	_ps2_command
	mov	w8, #80
	strb	w8, [sp, #14]
	ldr	w2, [x22]
	add	x1, sp, #14
	mov	x0, x21
	bl	_ps2_command
Lloh2:
	adrp	x8, _PSMOUSE_CMD_GETID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PSMOUSE_CMD_GETID@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	add	x1, sp, #14
	mov	x0, x21
	bl	_ps2_command
	ldrb	w8, [sp, #14]
	cmp	w8, #3
	b.ne	LBB0_5
; %bb.1:
	cbz	w20, LBB0_6
; %bb.2:
Lloh5:
	adrp	x8, _BTN_MIDDLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BTN_MIDDLE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8, #4]
	bl	___set_bit
Lloh8:
	adrp	x8, _REL_WHEEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _REL_WHEEL@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8]
	bl	___set_bit
	ldr	x8, [x19]
	cbz	x8, LBB0_8
; %bb.3:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_9
LBB0_4:
	mov	w0, #0
	mov	w8, #4
	str	w8, [x19, #16]
	b	LBB0_7
LBB0_5:
	mov	w0, #-1
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	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
LBB0_8:
Lloh11:
	adrp	x8, l_.str@PAGE
Lloh12:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x19]
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_4
LBB0_9:
Lloh13:
	adrp	x8, l_.str.1@PAGE
Lloh14:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x19, #8]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PSMOUSE_CMD_SETRATE,4,2        ; @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_GETID,4,2          ; @PSMOUSE_CMD_GETID
	.comm	_BTN_MIDDLE,4,2                 ; @BTN_MIDDLE
	.comm	_REL_WHEEL,4,2                  ; @REL_WHEEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Generic"

l_.str.1:                               ; @.str.1
	.asciz	"Wheel Mouse"

	.no_dead_strip	_intellimouse_detect
.subsections_via_symbols
