	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amimouse_open
_amimouse_open:                         ## @amimouse_open
	.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	%rdi, %r14
	movq	_amiga_custom@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
	movzbl	%al, %ecx
	movq	_amimouse_lastx@GOTPCREL(%rip), %rdx
	movw	%cx, (%rdx)
	shrl	$8, %eax
	movq	_amimouse_lasty@GOTPCREL(%rip), %rcx
	movw	%ax, (%rcx)
	movq	_IRQ_AMIGA_VERTB@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_amimouse_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	xorl	%edx, %edx
	movq	%r14, %r8
	callq	_request_irq
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%r15), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
LBB0_2:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_amiga_custom,2,1               ## @amiga_custom
	.comm	_amimouse_lastx,2,1             ## @amimouse_lastx
	.comm	_amimouse_lasty,2,1             ## @amimouse_lasty
	.comm	_IRQ_AMIGA_VERTB,4,2            ## @IRQ_AMIGA_VERTB
	.comm	_amimouse_interrupt,4,2         ## @amimouse_interrupt
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"amimouse"

L_.str.1:                               ## @.str.1
	.asciz	"Can't allocate irq %d\n"

	.no_dead_strip	_amimouse_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amimouse_open
_amimouse_open:                         ; @amimouse_open
	.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, x0
Lloh0:
	adrp	x8, _amiga_custom@GOTPAGE
Lloh1:
	ldr	x8, [x8, _amiga_custom@GOTPAGEOFF]
	ldrh	w8, [x8]
Lloh2:
	adrp	x9, _amimouse_lastx@GOTPAGE
Lloh3:
	ldr	x9, [x9, _amimouse_lastx@GOTPAGEOFF]
	and	w10, w8, #0xff
Lloh4:
	strh	w10, [x9]
	lsr	w8, w8, #8
Lloh5:
	adrp	x9, _amimouse_lasty@GOTPAGE
Lloh6:
	ldr	x9, [x9, _amimouse_lasty@GOTPAGEOFF]
Lloh7:
	strh	w8, [x9]
Lloh8:
	adrp	x21, _IRQ_AMIGA_VERTB@GOTPAGE
Lloh9:
	ldr	x21, [x21, _IRQ_AMIGA_VERTB@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh10:
	adrp	x8, _amimouse_interrupt@GOTPAGE
Lloh11:
	ldr	x8, [x8, _amimouse_interrupt@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x3, l_.str@PAGE
Lloh14:
	add	x3, x3, l_.str@PAGEOFF
	mov	w2, #0
	mov	x4, x19
	bl	_request_irq
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w2, [x21]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_2:
	mov	x0, x20
	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 AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_amiga_custom,2,1               ; @amiga_custom
	.comm	_amimouse_lastx,2,1             ; @amimouse_lastx
	.comm	_amimouse_lasty,2,1             ; @amimouse_lasty
	.comm	_IRQ_AMIGA_VERTB,4,2            ; @IRQ_AMIGA_VERTB
	.comm	_amimouse_interrupt,4,2         ; @amimouse_interrupt
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"amimouse"

l_.str.1:                               ; @.str.1
	.asciz	"Can't allocate irq %d\n"

	.no_dead_strip	_amimouse_open
.subsections_via_symbols
