	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function thinking_detect
_thinking_detect:                       ## @thinking_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, -60(%rbp)                 ## 4-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	leaq	24(%rdi), %rbx
	movl	$10, -56(%rbp)
	movq	_PSMOUSE_CMD_SETRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ps2_command
	movl	$0, -56(%rbp)
	movq	_PSMOUSE_CMD_SETRES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_ps2_command
	leaq	_thinking_detect.seq(%rip), %r14
	movq	%r14, %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_3
## %bb.1:
	xorl	%r15d, %r15d
	leaq	-56(%rbp), %r13
	movq	%r14, %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %eax
	movl	%eax, -56(%rbp)
	movq	_PSMOUSE_CMD_SETRATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_ps2_command
	incq	%r15
	movq	%r14, %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %r12
	cmpq	%rax, %r15
	jl	LBB0_2
LBB0_3:
	movq	_PSMOUSE_CMD_GETID@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_ps2_command
	cmpl	$2, -56(%rbp)
	jne	LBB0_4
## %bb.5:
	xorl	%ebx, %ebx
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_7
## %bb.6:
	movq	_BTN_MIDDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	16(%r14), %rax
	movl	(%rax), %esi
	callq	___set_bit
	movq	_BTN_EXTRA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	16(%r14), %rax
	movl	(%rax), %esi
	callq	___set_bit
	leaq	L_.str(%rip), %rax
	movq	%rax, (%r14)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 8(%r14)
	jmp	LBB0_7
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @thinking_detect.seq
_thinking_detect.seq:
	.long	20                              ## 0x14
	.long	60                              ## 0x3c
	.long	40                              ## 0x28
	.long	20                              ## 0x14
	.long	20                              ## 0x14
	.long	60                              ## 0x3c
	.long	40                              ## 0x28
	.long	20                              ## 0x14
	.long	20                              ## 0x14

	.comm	_PSMOUSE_CMD_SETRATE,4,2        ## @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_SETRES,4,2         ## @PSMOUSE_CMD_SETRES
	.comm	_PSMOUSE_CMD_GETID,4,2          ## @PSMOUSE_CMD_GETID
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_BTN_MIDDLE,4,2                 ## @BTN_MIDDLE
	.comm	_BTN_EXTRA,4,2                  ## @BTN_EXTRA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Kensington"

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

	.no_dead_strip	_thinking_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function thinking_detect
_thinking_detect:                       ; @thinking_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	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, #24
	mov	w8, #10
	str	w8, [sp]
Lloh3:
	adrp	x23, _PSMOUSE_CMD_SETRATE@GOTPAGE
Lloh4:
	ldr	x23, [x23, _PSMOUSE_CMD_SETRATE@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x1, sp
	mov	x0, x21
	bl	_ps2_command
	str	wzr, [sp]
Lloh5:
	adrp	x8, _PSMOUSE_CMD_SETRES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PSMOUSE_CMD_SETRES@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x1, sp
	mov	x0, x21
	bl	_ps2_command
Lloh8:
	adrp	x22, _thinking_detect.seq@PAGE
Lloh9:
	add	x22, x22, _thinking_detect.seq@PAGEOFF
	mov	x0, x22
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x24, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x22, x24, lsl #2]
	str	w8, [sp]
	ldr	w2, [x23]
	mov	x1, sp
	mov	x0, x21
	bl	_ps2_command
	add	x24, x24, #1
	mov	x0, x22
	bl	_ARRAY_SIZE
	cmp	x24, w0, sxtw
	b.lt	LBB0_2
LBB0_3:
Lloh10:
	adrp	x8, _PSMOUSE_CMD_GETID@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PSMOUSE_CMD_GETID@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x1, sp
	mov	x0, x21
	bl	_ps2_command
	ldr	w8, [sp]
	cmp	w8, #2
	b.ne	LBB0_6
; %bb.4:
	cbz	w20, LBB0_7
; %bb.5:
Lloh13:
	adrp	x8, _BTN_MIDDLE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BTN_MIDDLE@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	bl	___set_bit
Lloh16:
	adrp	x8, _BTN_EXTRA@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BTN_EXTRA@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	ldr	x8, [x19, #16]
	ldr	w1, [x8]
	bl	___set_bit
	mov	w0, #0
Lloh19:
	adrp	x8, l_.str@PAGE
Lloh20:
	add	x8, x8, l_.str@PAGEOFF
Lloh21:
	adrp	x9, l_.str.1@PAGE
Lloh22:
	add	x9, x9, l_.str.1@PAGEOFF
	stp	x8, x9, [x19]
	b	LBB0_8
LBB0_6:
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	ldr	x8, [sp, #8]
Lloh26:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh27:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @thinking_detect.seq
_thinking_detect.seq:
	.long	20                              ; 0x14
	.long	60                              ; 0x3c
	.long	40                              ; 0x28
	.long	20                              ; 0x14
	.long	20                              ; 0x14
	.long	60                              ; 0x3c
	.long	40                              ; 0x28
	.long	20                              ; 0x14
	.long	20                              ; 0x14

	.comm	_PSMOUSE_CMD_SETRATE,4,2        ; @PSMOUSE_CMD_SETRATE
	.comm	_PSMOUSE_CMD_SETRES,4,2         ; @PSMOUSE_CMD_SETRES
	.comm	_PSMOUSE_CMD_GETID,4,2          ; @PSMOUSE_CMD_GETID
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_BTN_MIDDLE,4,2                 ; @BTN_MIDDLE
	.comm	_BTN_EXTRA,4,2                  ; @BTN_EXTRA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Kensington"

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

	.no_dead_strip	_thinking_detect
.subsections_via_symbols
