	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mouse_joystick
_mouse_joystick:                        ## @mouse_joystick
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %ebx
	movq	_mouse_stick@GOTPCREL(%rip), %r14
	movl	$15, (%r14)
	movq	_display@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_window@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	subq	$8, %rsp
	leaq	-20(%rbp), %rax
	leaq	-24(%rbp), %r10
	leaq	-28(%rbp), %r11
	leaq	-44(%rbp), %rdx
	leaq	-40(%rbp), %rcx
	leaq	-36(%rbp), %r8
	leaq	-32(%rbp), %r9
	pushq	%rax
	pushq	%r10
	pushq	%r11
	callq	_XQueryPointer
	addq	$32, %rsp
	cmpl	$4, %ebx
	jg	LBB0_13
## %bb.1:
	movq	_windowsize@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_Small@GOTPCREL(%rip), %rcx
	movq	_Large@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	cmpq	(%rdx), %rax
	setne	%sil
	shll	$5, %esi
	orl	$64, %esi
	cmpq	(%rcx), %rax
	movl	$32, %eax
	cmovnel	%esi, %eax
	movl	-28(%rbp), %edx
	movl	$15, %ecx
	testl	%edx, %edx
	js	LBB0_16
## %bb.2:
	movq	_window_width@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, %edi
	shrl	$31, %edi
	addl	%esi, %edi
	sarl	%edi
	leal	(%rdi,%rdi), %esi
	cmpl	%esi, %edx
	jg	LBB0_16
## %bb.3:
	movl	-24(%rbp), %r8d
	testl	%r8d, %r8d
	js	LBB0_16
## %bb.4:
	movq	_window_height@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	%esi, %ebx
	shrl	$31, %ebx
	addl	%esi, %ebx
	sarl	%ebx
	leal	(%rbx,%rbx), %esi
	cmpl	%esi, %r8d
	jg	LBB0_16
## %bb.5:
	movl	%edi, %ecx
	subl	%eax, %ecx
	cmpl	%ecx, %edx
	jge	LBB0_7
## %bb.6:
	andl	$251, (%r14)
LBB0_7:
	addl	%eax, %edi
	cmpl	%edi, %edx
	jle	LBB0_9
## %bb.8:
	andl	$247, (%r14)
LBB0_9:
	movl	%ebx, %ecx
	subl	%eax, %ecx
	cmpl	%ecx, %r8d
	jge	LBB0_11
## %bb.10:
	andl	$254, (%r14)
LBB0_11:
	addl	%ebx, %eax
	cmpl	%eax, %r8d
	jle	LBB0_17
## %bb.12:
	movl	$253, %ecx
	jmp	LBB0_15
LBB0_13:
	cmpl	$0, -20(%rbp)
	je	LBB0_17
## %bb.14:
	movl	$251, %ecx
LBB0_15:
	andl	(%r14), %ecx
LBB0_16:
	movl	%ecx, (%r14)
LBB0_17:
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mouse_stick,4,2                ## @mouse_stick
	.comm	_display,4,2                    ## @display
	.comm	_window,4,2                     ## @window
	.comm	_windowsize,8,3                 ## @windowsize
	.comm	_Small,8,3                      ## @Small
	.comm	_window_width,4,2               ## @window_width
	.comm	_window_height,4,2              ## @window_height
	.comm	_Large,8,3                      ## @Large
	.no_dead_strip	_mouse_joystick
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mouse_joystick
_mouse_joystick:                        ; @mouse_joystick
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
Lloh0:
	adrp	x20, _mouse_stick@GOTPAGE
Lloh1:
	ldr	x20, [x20, _mouse_stick@GOTPAGEOFF]
	mov	w8, #15
	str	w8, [x20]
Lloh2:
	adrp	x8, _display@GOTPAGE
Lloh3:
	ldr	x8, [x8, _display@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _window@GOTPAGE
Lloh6:
	ldr	x8, [x8, _window@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x8, sp, #20
	str	x8, [sp]
	sub	x2, x29, #20
	sub	x3, x29, #24
	sub	x4, x29, #28
	add	x5, sp, #32
	add	x6, sp, #28
	add	x7, sp, #24
	bl	_XQueryPointer
	cmp	w19, #4
	b.gt	LBB0_13
; %bb.1:
Lloh8:
	adrp	x8, _windowsize@GOTPAGE
Lloh9:
	ldr	x8, [x8, _windowsize@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _Small@GOTPAGE
Lloh12:
	ldr	x9, [x9, _Small@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
Lloh14:
	adrp	x10, _Large@GOTPAGE
Lloh15:
	ldr	x10, [x10, _Large@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
	cmp	x8, x10
	mov	w10, #96
	mov	w11, #64
	csel	w10, w11, w10, eq
	cmp	x8, x9
	mov	w8, #32
	csel	w8, w8, w10, eq
Lloh17:
	adrp	x9, _window_height@GOTPAGE
Lloh18:
	ldr	x9, [x9, _window_height@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	w9, #0
	cinc	w10, w9, lt
Lloh20:
	adrp	x9, _window_width@GOTPAGE
Lloh21:
	ldr	x9, [x9, _window_width@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	w9, #0
	cinc	w9, w9, lt
	ldr	w12, [sp, #28]
	tbnz	w12, #31, LBB0_16
; %bb.2:
	asr	w13, w9, #1
	mov	w11, #15
	cmp	w12, w13, lsl #1
	b.gt	LBB0_17
; %bb.3:
	ldr	w9, [sp, #24]
	tbnz	w9, #31, LBB0_17
; %bb.4:
	asr	w10, w10, #1
	lsl	w14, w10, #1
	cmp	w9, w14
	b.gt	LBB0_17
; %bb.5:
	sub	w11, w13, w8
	cmp	w12, w11
	b.ge	LBB0_7
; %bb.6:
	ldr	w11, [x20]
	mov	w14, #251
	and	w11, w11, w14
	str	w11, [x20]
LBB0_7:
	add	w11, w13, w8
	cmp	w12, w11
	b.le	LBB0_9
; %bb.8:
	ldr	w11, [x20]
	mov	w12, #247
	and	w11, w11, w12
	str	w11, [x20]
LBB0_9:
	sub	w11, w10, w8
	cmp	w9, w11
	b.ge	LBB0_11
; %bb.10:
	ldr	w11, [x20]
	and	w11, w11, #0xfe
	str	w11, [x20]
LBB0_11:
	add	w8, w8, w10
	cmp	w9, w8
	b.le	LBB0_18
; %bb.12:
	ldr	w8, [x20]
	mov	w9, #253
	b	LBB0_15
LBB0_13:
	ldr	w8, [sp, #20]
	cbz	w8, LBB0_18
; %bb.14:
	ldr	w8, [x20]
	mov	w9, #251
LBB0_15:
	and	w11, w8, w9
	b	LBB0_17
LBB0_16:
	mov	w11, #15
LBB0_17:
	str	w11, [x20]
LBB0_18:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_mouse_stick,4,2                ; @mouse_stick
	.comm	_display,4,2                    ; @display
	.comm	_window,4,2                     ; @window
	.comm	_windowsize,8,3                 ; @windowsize
	.comm	_Small,8,3                      ; @Small
	.comm	_window_width,4,2               ; @window_width
	.comm	_window_height,4,2              ; @window_height
	.comm	_Large,8,3                      ; @Large
	.no_dead_strip	_mouse_joystick
.subsections_via_symbols
