	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_UI_MouseEvent                  ## -- Begin function UI_MouseEvent
	.p2align	4, 0x90
_UI_MouseEvent:                         ## @UI_MouseEvent
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %r9d
	movq	_uis@GOTPCREL(%rip), %r14
	movq	24(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.1:
	movl	(%r14), %eax
	cltd
	idivl	4(%r14)
	addl	8(%r14), %r9d
	movl	%r9d, 8(%r14)
	movl	%eax, %ecx
	negl	%ecx
	cmpl	%ecx, %r9d
	jl	LBB0_3
## %bb.2:
	movq	_SCREEN_WIDTH@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movl	%eax, %ecx
	cmpl	%eax, %r9d
	jle	LBB0_4
LBB0_3:
	movl	%ecx, 8(%r14)
	movl	%ecx, %r9d
LBB0_4:
	movslq	%esi, %r8
	addq	16(%r14), %r8
	movq	%r8, 16(%r14)
	js	LBB0_5
## %bb.6:
	movq	_SCREEN_HEIGHT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %r8
	jg	LBB0_7
	jmp	LBB0_8
LBB0_5:
	xorl	%eax, %eax
LBB0_7:
	movq	%rax, 16(%r14)
	movq	%rax, %r8
LBB0_8:
	movl	(%rdi), %ebx
	testl	%ebx, %ebx
	jle	LBB0_21
## %bb.9:
	movq	16(%rdi), %rax
	movq	_QMF_GRAYED@GOTPCREL(%rip), %rcx
	movq	_QMF_INACTIVE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	xorl	%esi, %esi
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_10 Depth=1
	incq	%rsi
	cmpq	%rsi, %rbx
	je	LBB0_20
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rax,%rsi,8), %rcx
	testl	%edx, (%rcx)
	jne	LBB0_19
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	4(%rcx), %r9d
	jl	LBB0_19
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	8(%rcx), %r9d
	jg	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpq	16(%rcx), %r8
	jl	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpq	24(%rcx), %r8
	jg	LBB0_19
## %bb.15:
	cmpl	%esi, 4(%rdi)
	je	LBB0_18
## %bb.16:
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_Menu_SetCursor
	movq	_QMF_HASMOUSEFOCUS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	notl	%ecx
	movq	24(%r14), %rdx
	movq	8(%rdx), %rsi
	movq	16(%rdx), %rax
	movq	(%rax,%rsi,8), %rsi
	andl	%ecx, (%rsi)
	movslq	4(%rdx), %rsi
	movq	(%rax,%rsi,8), %rcx
	movq	_QMF_SILENT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rcx)
	jne	LBB0_18
## %bb.17:
	movq	_menu_move_sound@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CHAN_LOCAL_SOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_trap_S_StartLocalSound
	movq	24(%r14), %rcx
	movq	16(%rcx), %rax
	movl	4(%rcx), %esi
LBB0_18:
	movq	_QMF_HASMOUSEFOCUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movslq	%esi, %rdx
	movq	(%rax,%rdx,8), %rax
	orl	%ecx, (%rax)
	jmp	LBB0_21
LBB0_20:
	movq	_QMF_HASMOUSEFOCUS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	16(%rdi), %rcx
	movslq	4(%rdi), %rdx
	movq	(%rcx,%rdx,8), %rcx
	andl	%eax, (%rcx)
LBB0_21:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_uis,32,3                       ## @uis
	.comm	_SCREEN_WIDTH,4,2               ## @SCREEN_WIDTH
	.comm	_SCREEN_HEIGHT,8,3              ## @SCREEN_HEIGHT
	.comm	_QMF_GRAYED,4,2                 ## @QMF_GRAYED
	.comm	_QMF_INACTIVE,4,2               ## @QMF_INACTIVE
	.comm	_QMF_HASMOUSEFOCUS,4,2          ## @QMF_HASMOUSEFOCUS
	.comm	_QMF_SILENT,4,2                 ## @QMF_SILENT
	.comm	_menu_move_sound,4,2            ## @menu_move_sound
	.comm	_CHAN_LOCAL_SOUND,4,2           ## @CHAN_LOCAL_SOUND
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_UI_MouseEvent                  ; -- Begin function UI_MouseEvent
	.p2align	2
_UI_MouseEvent:                         ; @UI_MouseEvent
	.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
	mov	x8, x0
Lloh0:
	adrp	x19, _uis@GOTPAGE
Lloh1:
	ldr	x19, [x19, _uis@GOTPAGEOFF]
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_21
; %bb.1:
	ldp	w9, w10, [x19]
	sdiv	w10, w9, w10
	ldr	w9, [x19, #8]
	add	w8, w9, w8
	str	w8, [x19, #8]
	neg	w9, w10
	cmp	w8, w9
	b.lt	LBB0_3
; %bb.2:
Lloh2:
	adrp	x9, _SCREEN_WIDTH@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SCREEN_WIDTH@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	add	w9, w9, w10
	cmp	w8, w9
	b.le	LBB0_4
LBB0_3:
	str	w9, [x19, #8]
	mov	x8, x9
LBB0_4:
	ldr	x9, [x19, #16]
	adds	x10, x9, w1, sxtw
	str	x10, [x19, #16]
	b.mi	LBB0_6
; %bb.5:
Lloh5:
	adrp	x9, _SCREEN_HEIGHT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SCREEN_HEIGHT@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x10, x9
	b.gt	LBB0_7
	b	LBB0_8
LBB0_6:
	mov	x9, #0
LBB0_7:
	str	x9, [x19, #16]
	mov	x10, x9
LBB0_8:
	ldr	w11, [x0]
	cmp	w11, #1
	b.lt	LBB0_21
; %bb.9:
	mov	x1, #0
Lloh8:
	adrp	x12, _QMF_GRAYED@GOTPAGE
Lloh9:
	ldr	x12, [x12, _QMF_GRAYED@GOTPAGEOFF]
	ldr	x9, [x0, #16]
Lloh10:
	ldr	w12, [x12]
Lloh11:
	adrp	x13, _QMF_INACTIVE@GOTPAGE
Lloh12:
	ldr	x13, [x13, _QMF_INACTIVE@GOTPAGEOFF]
Lloh13:
	ldr	w13, [x13]
	orr	w12, w13, w12
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x1, x1, #1
	cmp	x11, x1
	b.eq	LBB0_19
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x9, x1, lsl #3]
	ldr	w14, [x13]
	tst	w12, w14
	b.ne	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w14, [x13, #4]
	cmp	w8, w14
	b.lt	LBB0_10
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	w14, [x13, #8]
	cmp	w8, w14
	b.gt	LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x14, [x13, #16]
	cmp	x10, x14
	b.lt	LBB0_10
; %bb.15:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x13, [x13, #24]
	cmp	x10, x13
	b.gt	LBB0_10
; %bb.16:
	ldr	w8, [x0, #4]
	cmp	w8, w1
	b.eq	LBB0_23
; %bb.17:
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_Menu_SetCursor
Lloh14:
	adrp	x8, _QMF_HASMOUSEFOCUS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _QMF_HASMOUSEFOCUS@GOTPAGEOFF]
	ldr	x10, [x19, #24]
	ldp	x11, x9, [x10, #8]
	ldr	x11, [x9, x11, lsl #3]
Lloh16:
	ldr	w8, [x8]
	ldr	w12, [x11]
	bic	w8, w12, w8
	ldrsw	x1, [x10, #4]
	ldr	x10, [x9, x1, lsl #3]
	str	w8, [x11]
	ldr	w8, [x10]
Lloh17:
	adrp	x10, _QMF_SILENT@GOTPAGE
Lloh18:
	ldr	x10, [x10, _QMF_SILENT@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_22
; %bb.18:
                                        ; kill: def $w1 killed $w1 killed $x1 def $x1
	b	LBB0_23
LBB0_19:
Lloh20:
	adrp	x8, _QMF_HASMOUSEFOCUS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _QMF_HASMOUSEFOCUS@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	ldr	x9, [x0, #16]
	ldrsw	x10, [x0, #4]
	ldr	x9, [x9, x10, lsl #3]
	ldr	w10, [x9]
	bic	w8, w10, w8
LBB0_20:
	str	w8, [x9]
LBB0_21:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_22:
Lloh23:
	adrp	x8, _menu_move_sound@GOTPAGE
Lloh24:
	ldr	x8, [x8, _menu_move_sound@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
Lloh26:
	adrp	x8, _CHAN_LOCAL_SOUND@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CHAN_LOCAL_SOUND@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	bl	_trap_S_StartLocalSound
	ldr	x8, [x19, #24]
	ldr	x9, [x8, #16]
	ldr	w1, [x8, #4]
LBB0_23:
Lloh29:
	adrp	x8, _QMF_HASMOUSEFOCUS@GOTPAGE
Lloh30:
	ldr	x8, [x8, _QMF_HASMOUSEFOCUS@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	ldr	x9, [x9, w1, sxtw #3]
	ldr	w10, [x9]
	orr	w8, w10, w8
	b	LBB0_20
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_uis,32,3                       ; @uis
	.comm	_SCREEN_WIDTH,4,2               ; @SCREEN_WIDTH
	.comm	_SCREEN_HEIGHT,8,3              ; @SCREEN_HEIGHT
	.comm	_QMF_GRAYED,4,2                 ; @QMF_GRAYED
	.comm	_QMF_INACTIVE,4,2               ; @QMF_INACTIVE
	.comm	_QMF_HASMOUSEFOCUS,4,2          ; @QMF_HASMOUSEFOCUS
	.comm	_QMF_SILENT,4,2                 ; @QMF_SILENT
	.comm	_menu_move_sound,4,2            ; @menu_move_sound
	.comm	_CHAN_LOCAL_SOUND,4,2           ; @CHAN_LOCAL_SOUND
.subsections_via_symbols
