	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function genius_detect
_genius_detect:                         ## @genius_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -68(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	32(%rdi), %rbx
	movl	$3, -64(%rbp)
	movq	_PSMOUSE_CMD_SETRES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-64(%rbp), %r13
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_ps2_command
	movq	_PSMOUSE_CMD_SETSCALE11@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	movl	(%r15), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	movl	(%r15), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	movq	_PSMOUSE_CMD_GETINFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_ps2_command
	cmpl	$0, -64(%rbp)
	jne	LBB0_3
## %bb.1:
	cmpl	$51, -60(%rbp)
	jne	LBB0_3
## %bb.2:
	cmpl	$85, -56(%rbp)
	jne	LBB0_3
## %bb.4:
	xorl	%r14d, %r14d
	cmpl	$0, -68(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_6
## %bb.5:
	movq	_BTN_MIDDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r12), %rax
	movl	4(%rax), %esi
	callq	___set_bit
	movq	_BTN_EXTRA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r12), %rax
	movl	4(%rax), %esi
	callq	___set_bit
	movq	_BTN_SIDE@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
	leaq	L_.str(%rip), %rax
	movq	%rax, (%r12)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 8(%r12)
	movl	$4, 16(%r12)
	jmp	LBB0_6
LBB0_3:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PSMOUSE_CMD_SETRES,4,2         ## @PSMOUSE_CMD_SETRES
	.comm	_PSMOUSE_CMD_SETSCALE11,4,2     ## @PSMOUSE_CMD_SETSCALE11
	.comm	_PSMOUSE_CMD_GETINFO,4,2        ## @PSMOUSE_CMD_GETINFO
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_BTN_MIDDLE,4,2                 ## @BTN_MIDDLE
	.comm	_BTN_EXTRA,4,2                  ## @BTN_EXTRA
	.comm	_BTN_SIDE,4,2                   ## @BTN_SIDE
	.comm	_REL_WHEEL,4,2                  ## @REL_WHEEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Genius"

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

	.no_dead_strip	_genius_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function genius_detect
_genius_detect:                         ; @genius_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, #24]
	add	x21, x0, #32
	mov	w8, #3
	str	w8, [sp, #8]
Lloh3:
	adrp	x8, _PSMOUSE_CMD_SETRES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PSMOUSE_CMD_SETRES@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x21
	bl	_ps2_command
Lloh6:
	adrp	x22, _PSMOUSE_CMD_SETSCALE11@GOTPAGE
Lloh7:
	ldr	x22, [x22, _PSMOUSE_CMD_SETSCALE11@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_ps2_command
	ldr	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_ps2_command
	ldr	w2, [x22]
	mov	x0, x21
	mov	x1, #0
	bl	_ps2_command
Lloh8:
	adrp	x8, _PSMOUSE_CMD_GETINFO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PSMOUSE_CMD_GETINFO@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x21
	bl	_ps2_command
	ldr	w8, [sp, #8]
	cbnz	w8, LBB0_5
; %bb.1:
	ldr	w8, [sp, #12]
	cmp	w8, #51
	b.ne	LBB0_5
; %bb.2:
	ldr	w8, [sp, #16]
	cmp	w8, #85
	b.ne	LBB0_5
; %bb.3:
	cbz	w20, LBB0_6
; %bb.4:
Lloh11:
	adrp	x8, _BTN_MIDDLE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BTN_MIDDLE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8, #4]
	bl	___set_bit
Lloh14:
	adrp	x8, _BTN_EXTRA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BTN_EXTRA@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8, #4]
	bl	___set_bit
Lloh17:
	adrp	x8, _BTN_SIDE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BTN_SIDE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8, #4]
	bl	___set_bit
Lloh20:
	adrp	x8, _REL_WHEEL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _REL_WHEEL@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8]
	bl	___set_bit
	mov	w0, #0
Lloh23:
	adrp	x8, l_.str@PAGE
Lloh24:
	add	x8, x8, l_.str@PAGEOFF
Lloh25:
	adrp	x9, l_.str.1@PAGE
Lloh26:
	add	x9, x9, l_.str.1@PAGEOFF
	stp	x8, x9, [x19]
	mov	w8, #4
	str	w8, [x19, #16]
	b	LBB0_7
LBB0_5:
Lloh27:
	adrp	x8, _ENODEV@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldr	x8, [sp, #24]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_PSMOUSE_CMD_SETRES,4,2         ; @PSMOUSE_CMD_SETRES
	.comm	_PSMOUSE_CMD_SETSCALE11,4,2     ; @PSMOUSE_CMD_SETSCALE11
	.comm	_PSMOUSE_CMD_GETINFO,4,2        ; @PSMOUSE_CMD_GETINFO
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_BTN_MIDDLE,4,2                 ; @BTN_MIDDLE
	.comm	_BTN_EXTRA,4,2                  ; @BTN_EXTRA
	.comm	_BTN_SIDE,4,2                   ; @BTN_SIDE
	.comm	_REL_WHEEL,4,2                  ; @REL_WHEEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Genius"

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

	.no_dead_strip	_genius_detect
.subsections_via_symbols
