	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps2_mouse_scroll_button_task
_ps2_mouse_scroll_button_task:          ## @ps2_mouse_scroll_button_task
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_PS2_MOUSE_SCROLL_BTN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	(%rdi), %eax
	andl	%ecx, %eax
	cmpl	%eax, %ecx
	jne	LBB0_5
## %bb.1:
	movq	%rdi, %rbx
	cmpl	$0, _ps2_mouse_scroll_button_task.scroll_state(%rip)
	jne	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_timer_read
	movl	$1, _ps2_mouse_scroll_button_task.scroll_state(%rip)
LBB0_3:
	movl	4(%rbx), %ecx
	movl	8(%rbx), %eax
	movl	%ecx, %edx
	orl	%eax, %edx
	je	LBB0_8
## %bb.4:
	leaq	8(%rbx), %rsi
	movl	$2, _ps2_mouse_scroll_button_task.scroll_state(%rip)
	movq	_PS2_MOUSE_SCROLL_DIVISOR_V@GOTPCREL(%rip), %rdi
	cltd
	idivl	(%rdi)
	negl	%eax
	movl	%eax, 12(%rbx)
	movq	_PS2_MOUSE_SCROLL_DIVISOR_H@GOTPCREL(%rip), %rdi
	movl	%ecx, %eax
	cltd
	idivl	(%rdi)
	movl	%eax, 16(%rbx)
	movl	$0, 4(%rbx)
	jmp	LBB0_7
LBB0_5:
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:
	leaq	_ps2_mouse_scroll_button_task.scroll_state(%rip), %rsi
LBB0_7:
	movl	$0, (%rsi)
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_ps2_mouse_scroll_button_task.scroll_state,4,2 ## @ps2_mouse_scroll_button_task.scroll_state
	.comm	_PS2_MOUSE_SCROLL_BTN_MASK,4,2  ## @PS2_MOUSE_SCROLL_BTN_MASK
	.comm	_PS2_MOUSE_SCROLL_DIVISOR_V,4,2 ## @PS2_MOUSE_SCROLL_DIVISOR_V
	.comm	_PS2_MOUSE_SCROLL_DIVISOR_H,4,2 ## @PS2_MOUSE_SCROLL_DIVISOR_H
	.comm	_RELEASE_SCROLL_BUTTONS,4,2     ## @RELEASE_SCROLL_BUTTONS
	.comm	_PRESS_SCROLL_BUTTONS,4,2       ## @PRESS_SCROLL_BUTTONS
	.comm	_PS2_MOUSE_SCROLL_BTN_SEND,8,3  ## @PS2_MOUSE_SCROLL_BTN_SEND
	.no_dead_strip	_ps2_mouse_scroll_button_task
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps2_mouse_scroll_button_task
_ps2_mouse_scroll_button_task:          ; @ps2_mouse_scroll_button_task
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _PS2_MOUSE_SCROLL_BTN_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PS2_MOUSE_SCROLL_BTN_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	ldr	w8, [x0]
	and	w8, w8, w9
	cmp	w9, w8
	b.ne	LBB0_5
; %bb.1:
	mov	x19, x0
	adrp	x20, _ps2_mouse_scroll_button_task.scroll_state@PAGE
	ldr	w8, [x20, _ps2_mouse_scroll_button_task.scroll_state@PAGEOFF]
	cbnz	w8, LBB0_3
; %bb.2:
	bl	_timer_read
	mov	w8, #1
	str	w8, [x20, _ps2_mouse_scroll_button_task.scroll_state@PAGEOFF]
LBB0_3:
	mov	x8, x19
	ldr	w10, [x8, #8]!
	ldur	w9, [x8, #-4]
	orr	w11, w9, w10
	cbz	w11, LBB0_8
; %bb.4:
	mov	w11, #2
	str	w11, [x20, _ps2_mouse_scroll_button_task.scroll_state@PAGEOFF]
Lloh3:
	adrp	x11, _PS2_MOUSE_SCROLL_DIVISOR_V@GOTPAGE
Lloh4:
	ldr	x11, [x11, _PS2_MOUSE_SCROLL_DIVISOR_V@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	sdiv	w10, w10, w11
Lloh6:
	adrp	x11, _PS2_MOUSE_SCROLL_DIVISOR_H@GOTPAGE
Lloh7:
	ldr	x11, [x11, _PS2_MOUSE_SCROLL_DIVISOR_H@GOTPAGEOFF]
	neg	w10, w10
Lloh8:
	ldr	w11, [x11]
	sdiv	w9, w9, w11
	stp	w10, w9, [x19, #12]
	str	wzr, [x19, #4]
	b	LBB0_7
LBB0_5:
	cbnz	w8, LBB0_8
; %bb.6:
Lloh9:
	adrp	x8, _ps2_mouse_scroll_button_task.scroll_state@PAGE
Lloh10:
	add	x8, x8, _ps2_mouse_scroll_button_task.scroll_state@PAGEOFF
LBB0_7:
	str	wzr, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_ps2_mouse_scroll_button_task.scroll_state,4,2 ; @ps2_mouse_scroll_button_task.scroll_state
	.comm	_PS2_MOUSE_SCROLL_BTN_MASK,4,2  ; @PS2_MOUSE_SCROLL_BTN_MASK
	.comm	_PS2_MOUSE_SCROLL_DIVISOR_V,4,2 ; @PS2_MOUSE_SCROLL_DIVISOR_V
	.comm	_PS2_MOUSE_SCROLL_DIVISOR_H,4,2 ; @PS2_MOUSE_SCROLL_DIVISOR_H
	.comm	_RELEASE_SCROLL_BUTTONS,4,2     ; @RELEASE_SCROLL_BUTTONS
	.comm	_PRESS_SCROLL_BUTTONS,4,2       ; @PRESS_SCROLL_BUTTONS
	.comm	_PS2_MOUSE_SCROLL_BTN_SEND,8,3  ; @PS2_MOUSE_SCROLL_BTN_SEND
	.no_dead_strip	_ps2_mouse_scroll_button_task
.subsections_via_symbols
