	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amimouse_interrupt
_amimouse_interrupt:                    ## @amimouse_interrupt
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	_amiga_custom@GOTPCREL(%rip), %r8
	movzwl	(%r8), %edx
	movzbl	%dl, %edi
	movl	%edx, %r11d
	shrl	$8, %r11d
	movq	_amimouse_lastx@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r10d
	movl	%edi, (%rbx)
                                        ## kill: def $edi killed $edi def $rdi
	subl	%r10d, %edi
	movq	_amimouse_lasty@GOTPCREL(%rip), %r9
	movl	(%r9), %r15d
	leal	256(%r11), %esi
	leal	-256(%r11), %ebx
	movl	%r11d, %ecx
	subl	%r15d, %ecx
	leal	256(%rdi), %eax
	cmpl	$-127, %edi
	cmovgel	%edi, %eax
	orl	$-256, %edx
	subl	%r10d, %edx
	cmpl	$127, %eax
	cmovlel	%eax, %edx
	subl	%r15d, %esi
	cmpl	$-127, %ecx
	cmovgel	%ecx, %esi
	subl	%r15d, %ebx
	cmpl	$127, %esi
	cmovlel	%esi, %ebx
	movl	%r11d, (%r9)
	movzwl	2(%r8), %r15d
	movq	_REL_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_input_report_rel
	movq	_REL_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_input_report_rel
	movq	_BTN_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ciaa@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	$64, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	_BTN_MIDDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r15d, %edx
	andl	$256, %edx                      ## imm = 0x100
	movq	%r14, %rdi
	callq	_input_report_key
	movq	_BTN_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	$1024, %r15d                    ## imm = 0x400
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_input_report_key
	movq	%r14, %rdi
	callq	_input_sync
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_amiga_custom,4,1               ## @amiga_custom
	.comm	_amimouse_lastx,4,2             ## @amimouse_lastx
	.comm	_amimouse_lasty,4,2             ## @amimouse_lasty
	.comm	_REL_X,4,2                      ## @REL_X
	.comm	_REL_Y,4,2                      ## @REL_Y
	.comm	_BTN_LEFT,4,2                   ## @BTN_LEFT
	.comm	_ciaa,4,2                       ## @ciaa
	.comm	_BTN_MIDDLE,4,2                 ## @BTN_MIDDLE
	.comm	_BTN_RIGHT,4,2                  ## @BTN_RIGHT
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_amimouse_interrupt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amimouse_interrupt
_amimouse_interrupt:                    ; @amimouse_interrupt
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
Lloh0:
	adrp	x8, _amiga_custom@GOTPAGE
Lloh1:
	ldr	x8, [x8, _amiga_custom@GOTPAGEOFF]
	ldrh	w9, [x8]
	and	w10, w9, #0xff
	lsr	w11, w9, #8
Lloh2:
	adrp	x12, _amimouse_lastx@GOTPAGE
Lloh3:
	ldr	x12, [x12, _amimouse_lastx@GOTPAGEOFF]
	ldr	w13, [x12]
Lloh4:
	adrp	x14, _amimouse_lasty@GOTPAGE
Lloh5:
	ldr	x14, [x14, _amimouse_lasty@GOTPAGEOFF]
	sub	w15, w10, w13
	ldr	w16, [x14]
	sub	w17, w11, w16
	add	w0, w15, #256
	cmn	w15, #127
	csel	w15, w0, w15, lt
	orr	w9, w9, #0xffffff00
	sub	w9, w9, w13
	cmp	w15, #127
	csel	w2, w9, w15, gt
	orr	w9, w11, #0x100
	sub	w9, w9, w16
	cmn	w17, #127
	csel	w9, w9, w17, lt
	orr	w13, w11, #0xffffff00
	sub	w13, w13, w16
	cmp	w9, #127
	csel	w20, w13, w9, gt
	str	w10, [x12]
	str	w11, [x14]
	ldrh	w21, [x8, #2]
Lloh6:
	adrp	x8, _REL_X@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REL_X@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_input_report_rel
Lloh9:
	adrp	x8, _REL_Y@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REL_Y@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_input_report_rel
Lloh12:
	adrp	x8, _BTN_LEFT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BTN_LEFT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _ciaa@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ciaa@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	and	w2, w8, #0x40
	mov	x0, x19
	bl	_input_report_key
Lloh18:
	adrp	x8, _BTN_MIDDLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BTN_MIDDLE@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	and	w2, w21, #0x100
	mov	x0, x19
	bl	_input_report_key
Lloh21:
	adrp	x8, _BTN_RIGHT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BTN_RIGHT@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	and	w2, w21, #0x400
	mov	x0, x19
	bl	_input_report_key
	mov	x0, x19
	bl	_input_sync
Lloh24:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_amiga_custom,4,1               ; @amiga_custom
	.comm	_amimouse_lastx,4,2             ; @amimouse_lastx
	.comm	_amimouse_lasty,4,2             ; @amimouse_lasty
	.comm	_REL_X,4,2                      ; @REL_X
	.comm	_REL_Y,4,2                      ; @REL_Y
	.comm	_BTN_LEFT,4,2                   ; @BTN_LEFT
	.comm	_ciaa,4,2                       ; @ciaa
	.comm	_BTN_MIDDLE,4,2                 ; @BTN_MIDDLE
	.comm	_BTN_RIGHT,4,2                  ; @BTN_RIGHT
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_amimouse_interrupt
.subsections_via_symbols
