	.file	"extr_nes.c_nes_interrupt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	nes_interrupt, @function
nes_interrupt:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	cmp	QWORD PTR 40[rsi], 0
	jne	.L3
	mov	rax, QWORD PTR 32[rsi]
	xor	edi, edi
	mov	rcx, QWORD PTR NE020_REV[rip]
	cmp	QWORD PTR [rax], rcx
	sete	dil
	call	unlikely@PLT
	test	rax, rax
	je	.L4
	mov	rdi, QWORD PTR NES_INT_MASK[rip]
	add	rdi, QWORD PTR 24[rbx]
	call	nes_read32@PLT
	mov	ebp, eax
	test	eax, eax
	js	.L19
.L5:
	mov	eax, DWORD PTR IRQ_NONE[rip]
.L21:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	rdi, QWORD PTR NES_INT_STAT[rip]
	add	rdi, QWORD PTR 24[rbx]
	call	nes_read32@PLT
	mov	r12d, eax
	mov	r13d, eax
	and	r13d, DWORD PTR [rbx]
	je	.L5
	mov	edx, DWORD PTR NES_INT_TIMER[rip]
	mov	ecx, DWORD PTR NES_INT_INTF[rip]
	mov	eax, edx
	or	eax, ecx
	not	eax
	test	eax, r13d
	jne	.L8
	mov	eax, r13d
	and	eax, edx
	cmp	edx, eax
	je	.L7
	and	r13d, ecx
	cmp	ecx, r13d
	jne	.L5
.L9:
	mov	rdi, QWORD PTR NES_INTF_INT_STAT[rip]
	add	rdi, QWORD PTR 24[rbx]
	call	nes_read32@PLT
	test	DWORD PTR 8[rbx], eax
	je	.L5
.L8:
	mov	esi, ebp
	mov	rdi, QWORD PTR NES_INT_MASK[rip]
	add	rdi, QWORD PTR 24[rbx]
	and	esi, 2147483647
	call	nes_write32@PLT
	mov	rdi, QWORD PTR NES_INT_MASK[rip]
	add	rdi, QWORD PTR 24[rbx]
	call	nes_read32@PLT
	mov	DWORD PTR 12[rbx], r12d
	mov	DWORD PTR 16[rbx], 1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdi, rbx
	call	nes_napi_isr@PLT
	test	rax, rax
	je	.L20
.L11:
	mov	eax, DWORD PTR IRQ_HANDLED[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	rdi, QWORD PTR NES_INT_PENDING[rip]
	add	rdi, QWORD PTR 24[rbx]
	call	nes_read32@PLT
	test	eax, eax
	jne	.L3
	mov	eax, DWORD PTR IRQ_NONE[rip]
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L20:
	lea	rdi, 20[rbx]
	call	tasklet_schedule@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, QWORD PTR NES_TIMER_STAT[rip]
	add	rdi, QWORD PTR 24[rbx]
	call	nes_read32@PLT
	test	DWORD PTR 4[rbx], eax
	jne	.L8
	mov	eax, DWORD PTR NES_INT_INTF[rip]
	and	r13d, eax
	cmp	eax, r13d
	jne	.L5
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	nes_interrupt, .-nes_interrupt
	.comm	NES_TIMER_STAT,8,8
	.comm	NES_INT_TIMER,4,4
	.comm	NES_INT_STAT,8,8
	.comm	NES_INT_PENDING,8,8
	.comm	NES_INT_MASK,8,8
	.comm	NES_INT_INTF,4,4
	.comm	NES_INTF_INT_STAT,8,8
	.comm	NE020_REV,8,8
	.comm	IRQ_NONE,4,4
	.comm	IRQ_HANDLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_nes.c_nes_interrupt.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	nes_interrupt, %function
nes_interrupt:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r1, #32]
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	cmp	r3, #0
	mov	r4, r1
	bne	.L3
	ldr	r2, [r1, #28]
	ldr	r3, .L20
	ldr	r0, [r2]
	ldr	r3, [r3]
	sub	r0, r0, r3
	clz	r0, r0
	lsr	r0, r0, #5
	bl	unlikely
	cmp	r0, #0
	beq	.L4
	ldr	r6, .L20+4
	ldr	r0, [r4, #24]
	ldr	r3, [r6]
	add	r0, r0, r3
	bl	nes_read32
	subs	r5, r0, #0
	blt	.L18
.L5:
	ldr	r3, .L20+8
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L18:
	ldr	r3, .L20+12
	ldr	r0, [r4, #24]
	ldr	r3, [r3]
	add	r0, r0, r3
	bl	nes_read32
	ldr	r3, [r4]
	mov	r8, r0
	ands	r7, r0, r3
	beq	.L5
	ldr	r3, .L20+16
	ldr	r9, .L20+20
	ldr	r3, [r3]
	ldr	r2, [r9]
	orr	r1, r3, r2
	bics	r1, r7, r1
	bne	.L8
	bics	r3, r3, r7
	beq	.L7
	bics	r3, r2, r7
	bne	.L5
.L9:
	ldr	r3, .L20+24
	ldr	r0, [r4, #24]
	ldr	r3, [r3]
	add	r0, r0, r3
	bl	nes_read32
	ldr	r3, [r4, #8]
	tst	r0, r3
	beq	.L5
.L8:
	ldr	r3, [r6]
	ldr	r0, [r4, #24]
	bic	r1, r5, #-2147483648
	add	r0, r0, r3
	bl	nes_write32
	ldr	r3, [r6]
	ldr	r0, [r4, #24]
	add	r0, r0, r3
	bl	nes_read32
	mov	r3, #1
	str	r8, [r4, #12]
	str	r3, [r4, #16]
.L3:
	mov	r0, r4
	bl	nes_napi_isr
	cmp	r0, #0
	beq	.L19
.L11:
	ldr	r3, .L20+28
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L4:
	ldr	r3, .L20+32
	ldr	r0, [r4, #24]
	ldr	r3, [r3]
	add	r0, r0, r3
	bl	nes_read32
	cmp	r0, #0
	beq	.L5
	b	.L3
.L19:
	add	r0, r4, #20
	bl	tasklet_schedule
	b	.L11
.L7:
	ldr	r3, .L20+36
	ldr	r0, [r4, #24]
	ldr	r3, [r3]
	add	r0, r0, r3
	bl	nes_read32
	ldr	r3, [r4, #4]
	tst	r0, r3
	bne	.L8
	ldr	r3, [r9]
	bics	r3, r3, r7
	bne	.L5
	b	.L9
.L21:
	.align	2
.L20:
	.word	NE020_REV
	.word	NES_INT_MASK
	.word	IRQ_NONE
	.word	NES_INT_STAT
	.word	NES_INT_TIMER
	.word	NES_INT_INTF
	.word	NES_INTF_INT_STAT
	.word	IRQ_HANDLED
	.word	NES_INT_PENDING
	.word	NES_TIMER_STAT
	.size	nes_interrupt, .-nes_interrupt
	.comm	NES_TIMER_STAT,4,4
	.comm	NES_INT_TIMER,4,4
	.comm	NES_INT_STAT,4,4
	.comm	NES_INT_PENDING,4,4
	.comm	NES_INT_MASK,4,4
	.comm	NES_INT_INTF,4,4
	.comm	NES_INTF_INT_STAT,4,4
	.comm	NE020_REV,4,4
	.comm	IRQ_NONE,4,4
	.comm	IRQ_HANDLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
