	.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
	subq	$24, %rsp
	.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, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	32(%rdi), %rbx
	movl	$200, -56(%rbp)
	movq	_PSMOUSE_CMD_SETRATE@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	leaq	-56(%rbp), %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ps2_command
	movl	$100, -56(%rbp)
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ps2_command
	movl	$80, -56(%rbp)
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ps2_command
	movq	_PSMOUSE_CMD_GETID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ps2_command
	cmpl	$3, -56(%rbp)
	jne	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.3:
	movq	_BTN_MIDDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r14), %rax
	movl	4(%rax), %esi
	callq	___set_bit
	movq	_REL_WHEEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r14), %rax
	movl	(%rax), %esi
	callq	___set_bit
	cmpq	$0, (%r14)
	je	LBB0_4
## %bb.5:
	cmpq	$0, 8(%r14)
	je	LBB0_6
LBB0_7:
	movl	$4, 16(%r14)
	jmp	LBB0_8
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	L_.str(%rip), %rax
	movq	%rax, (%r14)
	cmpq	$0, 8(%r14)
	jne	LBB0_7
LBB0_6:
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 8(%r14)
	jmp	LBB0_7
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PSMOUSE_CMD_SETRATE,4,2        ## @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_GETID,4,2          ## @PSMOUSE_CMD_GETID
	.comm	_ENODEV,4,2                     ## @ENODEV
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	add	x21, x0, #32
	mov	w8, #200
	str	w8, [sp]
Lloh3:
	adrp	x22, _PSMOUSE_CMD_SETRATE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PSMOUSE_CMD_SETRATE@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x1, sp
	mov	x0, x21
	bl	_ps2_command
	mov	w8, #100
	str	w8, [sp]
	ldr	w2, [x22]
	mov	x1, sp
	mov	x0, x21
	bl	_ps2_command
	mov	w8, #80
	str	w8, [sp]
	ldr	w2, [x22]
	mov	x1, sp
	mov	x0, x21
	bl	_ps2_command
Lloh5:
	adrp	x8, _PSMOUSE_CMD_GETID@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PSMOUSE_CMD_GETID@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x1, sp
	mov	x0, x21
	bl	_ps2_command
	ldr	w8, [sp]
	cmp	w8, #3
	b.ne	LBB0_5
; %bb.1:
	cbz	w20, LBB0_6
; %bb.2:
Lloh8:
	adrp	x8, _BTN_MIDDLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BTN_MIDDLE@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8, #4]
	bl	___set_bit
Lloh11:
	adrp	x8, _REL_WHEEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _REL_WHEEL@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8]
	bl	___set_bit
	ldr	x8, [x19]
	cbz	x8, LBB0_9
; %bb.3:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_10
LBB0_4:
	mov	w0, #0
	mov	w8, #4
	str	w8, [x19, #16]
	b	LBB0_7
LBB0_5:
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldr	x8, [sp, #8]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.8:
	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_9:
Lloh20:
	adrp	x8, l_.str@PAGE
Lloh21:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x19]
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_4
LBB0_10:
Lloh22:
	adrp	x8, l_.str.1@PAGE
Lloh23:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x19, #8]
	b	LBB0_4
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_PSMOUSE_CMD_SETRATE,4,2        ; @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_GETID,4,2          ; @PSMOUSE_CMD_GETID
	.comm	_ENODEV,4,2                     ; @ENODEV
	.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
