	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps2mouse_event
_ps2mouse_event:                        ## @ps2mouse_event
	.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
	movq	%rcx, %rbx
	movl	%edx, %r12d
	movl	%esi, %r13d
	movl	%edi, %r15d
	leaq	16(%rcx), %r14
	movq	%r14, %rdi
	callq	_pthread_mutex_lock
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%r12d, %edx
	callq	_movement_update
	movq	_PS2M_STS_LEFT_BUTTON@GOTPCREL(%rip), %rsi
	movq	_PS2M_STS_RIGHT_BUTTON@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	orl	(%rsi), %eax
	movq	_PS2M_STS_MID_BUTTON@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	notl	%eax
	andl	(%rbx), %eax
	movl	%eax, (%rbx)
	testb	$1, %r15b
	jne	LBB0_1
## %bb.2:
	testb	$2, %r15b
	jne	LBB0_3
LBB0_4:
	testb	$4, %r15b
	je	LBB0_6
LBB0_5:
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
LBB0_6:
	movq	_PS2M_STS_ENABLE_DEV@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.7:
	cmpl	$0, 20(%rbx)
	je	LBB0_10
## %bb.8:
	movq	%rbx, %rdi
	callq	_movement_get
	movq	%r14, %rdi
	callq	_pthread_mutex_unlock
	cmpq	$0, 8(%rbx)
	jle	LBB0_9
## %bb.11:
	movl	4(%rbx), %edi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_atkbdc_event                   ## TAILCALL
LBB0_10:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_mutex_unlock           ## TAILCALL
LBB0_1:
	orl	(%rsi), %eax
	movl	%eax, (%rbx)
	testb	$2, %r15b
	je	LBB0_4
LBB0_3:
	orl	(%rdx), %eax
	movl	%eax, (%rbx)
	testb	$4, %r15b
	jne	LBB0_5
	jmp	LBB0_6
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PS2M_STS_LEFT_BUTTON,4,2       ## @PS2M_STS_LEFT_BUTTON
	.comm	_PS2M_STS_RIGHT_BUTTON,4,2      ## @PS2M_STS_RIGHT_BUTTON
	.comm	_PS2M_STS_MID_BUTTON,4,2        ## @PS2M_STS_MID_BUTTON
	.comm	_PS2M_STS_ENABLE_DEV,4,2        ## @PS2M_STS_ENABLE_DEV
	.no_dead_strip	_ps2mouse_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps2mouse_event
_ps2mouse_event:                        ; @ps2mouse_event
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x3
	mov	x22, x2
	mov	x23, x1
	mov	x21, x0
	add	x20, x3, #16
	mov	x0, x20
	bl	_pthread_mutex_lock
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	bl	_movement_update
Lloh0:
	adrp	x11, _PS2M_STS_LEFT_BUTTON@GOTPAGE
Lloh1:
	ldr	x11, [x11, _PS2M_STS_LEFT_BUTTON@GOTPAGEOFF]
	ldr	w8, [x11]
Lloh2:
	adrp	x9, _PS2M_STS_RIGHT_BUTTON@GOTPAGE
Lloh3:
	ldr	x9, [x9, _PS2M_STS_RIGHT_BUTTON@GOTPAGEOFF]
	ldr	w12, [x9]
Lloh4:
	adrp	x10, _PS2M_STS_MID_BUTTON@GOTPAGE
Lloh5:
	ldr	x10, [x10, _PS2M_STS_MID_BUTTON@GOTPAGEOFF]
	orr	w8, w12, w8
	ldr	w12, [x10]
	orr	w8, w8, w12
	ldr	w12, [x19]
	bic	w8, w12, w8
	str	w8, [x19]
	tbnz	w21, #0, LBB0_9
; %bb.1:
	tbnz	w21, #1, LBB0_10
LBB0_2:
	tbz	w21, #2, LBB0_4
LBB0_3:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19]
LBB0_4:
Lloh6:
	adrp	x9, _PS2M_STS_ENABLE_DEV@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PS2M_STS_ENABLE_DEV@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.5:
	ldr	w8, [x19, #20]
	cbz	w8, LBB0_8
; %bb.6:
	mov	x0, x19
	bl	_movement_get
	mov	x0, x20
	bl	_pthread_mutex_unlock
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_11
; %bb.7:
	ldr	w0, [x19, #4]
	mov	w1, #0
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_atkbdc_event
LBB0_8:
	mov	x0, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_pthread_mutex_unlock
LBB0_9:
	ldr	w11, [x11]
	orr	w8, w11, w8
	str	w8, [x19]
	tbz	w21, #1, LBB0_2
LBB0_10:
	ldr	w10, [x10]
	orr	w8, w8, w10
	str	w8, [x19]
	tbnz	w21, #2, LBB0_3
	b	LBB0_4
LBB0_11:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PS2M_STS_LEFT_BUTTON,4,2       ; @PS2M_STS_LEFT_BUTTON
	.comm	_PS2M_STS_RIGHT_BUTTON,4,2      ; @PS2M_STS_RIGHT_BUTTON
	.comm	_PS2M_STS_MID_BUTTON,4,2        ; @PS2M_STS_MID_BUTTON
	.comm	_PS2M_STS_ENABLE_DEV,4,2        ; @PS2M_STS_ENABLE_DEV
	.no_dead_strip	_ps2mouse_event
.subsections_via_symbols
