	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nes_interrupt
_nes_interrupt:                         ## @nes_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	cmpq	$0, 40(%rsi)
	je	LBB0_1
LBB0_12:
	movq	%rbx, %rdi
	callq	_nes_napi_isr
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %r12
	testq	%rax, %rax
	jne	LBB0_16
## %bb.13:
	addq	$20, %rbx
	movq	%rbx, %rdi
	callq	_tasklet_schedule
	jmp	LBB0_16
LBB0_1:
	movq	32(%rbx), %rax
	movq	(%rax), %rax
	movq	_NE020_REV@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_unlikely
	movq	24(%rbx), %rdi
	testq	%rax, %rax
	je	LBB0_14
## %bb.2:
	movq	_NES_INT_MASK@GOTPCREL(%rip), %r13
	addq	(%r13), %rdi
	callq	_nes_read32
	movq	_IRQ_NONE@GOTPCREL(%rip), %r12
	testl	%eax, %eax
	jns	LBB0_16
## %bb.3:
	movl	%eax, %r14d
	movq	_NES_INT_STAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%rbx), %rdi
	callq	_nes_read32
	movl	(%rbx), %r15d
	andl	%eax, %r15d
	je	LBB0_16
## %bb.4:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_NES_INT_TIMER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_NES_INT_INTF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edx
	orl	%ecx, %edx
	notl	%edx
	testl	%edx, %r15d
	je	LBB0_5
LBB0_11:
	movq	(%r13), %rdi
	addq	24(%rbx), %rdi
	andl	$2147483647, %r14d              ## imm = 0x7FFFFFFF
	movl	%r14d, %esi
	callq	_nes_write32
	movq	(%r13), %rdi
	addq	24(%rbx), %rdi
	callq	_nes_read32
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 12(%rbx)
	movl	$1, 16(%rbx)
	jmp	LBB0_12
LBB0_14:
	movq	_NES_INT_PENDING@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	callq	_nes_read32
	testl	%eax, %eax
	jne	LBB0_12
## %bb.15:
	movq	_IRQ_NONE@GOTPCREL(%rip), %r12
LBB0_16:
	movl	(%r12), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%r15d, %edx
	notl	%edx
	testl	%edx, %ecx
	jne	LBB0_9
## %bb.6:
	movq	_NES_TIMER_STAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%rbx), %rdi
	callq	_nes_read32
	andl	4(%rbx), %eax
	jne	LBB0_8
## %bb.7:
	movq	_NES_INT_INTF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%ecx, %r15d
	cmpl	%ecx, %r15d
	je	LBB0_10
LBB0_8:
	testl	%eax, %eax
	jne	LBB0_11
	jmp	LBB0_16
LBB0_9:
	testl	%edx, %eax
	jne	LBB0_16
LBB0_10:
	movq	_NES_INTF_INT_STAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%rbx), %rdi
	callq	_nes_read32
	testl	%eax, 8(%rbx)
	jne	LBB0_11
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_NE020_REV,8,3                  ## @NE020_REV
	.comm	_NES_INT_MASK,8,3               ## @NES_INT_MASK
	.comm	_NES_INT_STAT,8,3               ## @NES_INT_STAT
	.comm	_NES_INT_TIMER,4,2              ## @NES_INT_TIMER
	.comm	_NES_INT_INTF,4,2               ## @NES_INT_INTF
	.comm	_NES_TIMER_STAT,8,3             ## @NES_TIMER_STAT
	.comm	_NES_INTF_INT_STAT,8,3          ## @NES_INTF_INT_STAT
	.comm	_NES_INT_PENDING,8,3            ## @NES_INT_PENDING
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.comm	_IRQ_NONE,4,2                   ## @IRQ_NONE
	.no_dead_strip	_nes_interrupt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nes_interrupt
_nes_interrupt:                         ; @nes_interrupt
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	ldr	x8, [x1, #40]
	cbz	x8, LBB0_4
LBB0_1:
	mov	x0, x19
	bl	_nes_napi_isr
	cbnz	x0, LBB0_3
; %bb.2:
	add	x0, x19, #20
	bl	_tasklet_schedule
LBB0_3:
Lloh0:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
	ldr	x8, [x19, #32]
	ldr	x8, [x8]
Lloh2:
	adrp	x9, _NE020_REV@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NE020_REV@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_unlikely
	ldr	x8, [x19, #24]
	cbz	x0, LBB0_9
; %bb.5:
Lloh5:
	adrp	x22, _NES_INT_MASK@GOTPAGE
Lloh6:
	ldr	x22, [x22, _NES_INT_MASK@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_nes_read32
	tbz	w0, #31, LBB0_10
; %bb.6:
	mov	x21, x0
	ldr	x8, [x19, #24]
Lloh7:
	adrp	x9, _NES_INT_STAT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _NES_INT_STAT@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_nes_read32
	ldr	w8, [x19]
	ands	w23, w8, w0
	b.eq	LBB0_10
; %bb.7:
	mov	x20, x0
Lloh10:
	adrp	x8, _NES_INT_TIMER@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NES_INT_TIMER@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x8]
Lloh13:
	adrp	x24, _NES_INT_INTF@GOTPAGE
Lloh14:
	ldr	x24, [x24, _NES_INT_INTF@GOTPAGEOFF]
	ldr	w8, [x24]
	orr	w10, w8, w9
	bics	wzr, w23, w10
	b.eq	LBB0_12
LBB0_8:
	ldr	x8, [x19, #24]
	ldr	x9, [x22]
	add	x0, x9, x8
	and	w1, w21, #0x7fffffff
	bl	_nes_write32
	ldr	x8, [x19, #24]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_nes_read32
	mov	w8, #1
	stp	w20, w8, [x19, #12]
	b	LBB0_1
LBB0_9:
Lloh15:
	adrp	x9, _NES_INT_PENDING@GOTPAGE
Lloh16:
	ldr	x9, [x9, _NES_INT_PENDING@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_nes_read32
	cbnz	w0, LBB0_1
LBB0_10:
Lloh18:
	adrp	x8, _IRQ_NONE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IRQ_NONE@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	bics	wzr, w9, w23
	b.ne	LBB0_15
; %bb.13:
	ldr	x8, [x19, #24]
Lloh20:
	adrp	x9, _NES_TIMER_STAT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _NES_TIMER_STAT@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_nes_read32
	ldr	w8, [x19, #4]
	and	w8, w8, w0
	ldr	w9, [x24]
	and	w10, w9, w23
	cmp	w8, #0
	ccmp	w10, w9, #0, eq
	b.eq	LBB0_16
; %bb.14:
	cbnz	w8, LBB0_8
	b	LBB0_10
LBB0_15:
	bics	wzr, w8, w23
	b.ne	LBB0_10
LBB0_16:
	ldr	x8, [x19, #24]
Lloh23:
	adrp	x9, _NES_INTF_INT_STAT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _NES_INTF_INT_STAT@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_nes_read32
	ldr	w8, [x19, #8]
	tst	w8, w0
	b.ne	LBB0_8
	b	LBB0_10
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_NE020_REV,8,3                  ; @NE020_REV
	.comm	_NES_INT_MASK,8,3               ; @NES_INT_MASK
	.comm	_NES_INT_STAT,8,3               ; @NES_INT_STAT
	.comm	_NES_INT_TIMER,4,2              ; @NES_INT_TIMER
	.comm	_NES_INT_INTF,4,2               ; @NES_INT_INTF
	.comm	_NES_TIMER_STAT,8,3             ; @NES_TIMER_STAT
	.comm	_NES_INTF_INT_STAT,8,3          ; @NES_INTF_INT_STAT
	.comm	_NES_INT_PENDING,8,3            ; @NES_INT_PENDING
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.comm	_IRQ_NONE,4,2                   ; @IRQ_NONE
	.no_dead_strip	_nes_interrupt
.subsections_via_symbols
