	.file	"extr_ens1370.c_snd_ensoniq_midi_interrupt.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	snd_ensoniq_midi_interrupt, @function
snd_ensoniq_midi_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
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	cmp	QWORD PTR 24[rdi], 0
	je	.L1
	lea	rbp, 8[rdi]
	mov	rbx, rdi
	mov	rdi, rbp
	call	spin_lock@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR ES_MODE_INPUT[rip], eax
	je	.L4
	movzx	r12d, BYTE PTR ES_RXRDY[rip]
	test	r12b, r12b
	je	.L4
	lea	r13, 7[rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L31:
	mov	esi, DWORD PTR UART_DATA[rip]
	mov	rdi, rbx
	call	ES_REG@PLT
	mov	edi, eax
	call	inb@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	edx, 1
	mov	rsi, r13
	mov	BYTE PTR 7[rsp], al
	call	snd_rawmidi_receive@PLT
.L5:
	mov	esi, DWORD PTR UART_STATUS[rip]
	mov	rdi, rbx
	call	ES_REG@PLT
	mov	edi, eax
	call	inb@PLT
	test	r12b, al
	jne	.L31
.L4:
	mov	rdi, rbp
	call	spin_unlock@PLT
	mov	rdi, rbp
	call	spin_lock@PLT
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR ES_MODE_OUTPUT[rip], eax
	je	.L6
	movzx	r12d, BYTE PTR ES_TXRDY[rip]
	test	r12b, r12b
	je	.L6
	lea	r13, 7[rsp]
	.p2align 4,,10
	.p2align 3
.L9:
	mov	esi, DWORD PTR UART_STATUS[rip]
	mov	rdi, rbx
	call	ES_REG@PLT
	mov	edi, eax
	call	inb@PLT
	test	al, r12b
	je	.L6
	mov	edi, DWORD PTR 12[rbx]
	mov	edx, 1
	mov	rsi, r13
	call	snd_rawmidi_transmit@PLT
	cmp	eax, 1
	je	.L7
	movzx	eax, BYTE PTR ES_TXINTENM[rip]
	mov	esi, DWORD PTR UART_CONTROL[rip]
	mov	rdi, rbx
	not	eax
	and	BYTE PTR 4[rbx], al
	call	ES_REG@PLT
	movzx	edi, BYTE PTR 4[rbx]
	mov	esi, eax
	call	outb@PLT
	movzx	eax, BYTE PTR ES_TXRDY[rip]
	not	eax
	and	r12b, al
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, rbp
	call	spin_unlock@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L32
	add	rsp, 24
	.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
.L7:
	.cfi_restore_state
	mov	esi, DWORD PTR UART_DATA[rip]
	mov	rdi, rbx
	call	ES_REG@PLT
	movzx	edi, BYTE PTR 7[rsp]
	mov	esi, eax
	call	outb@PLT
	jmp	.L9
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	snd_ensoniq_midi_interrupt, .-snd_ensoniq_midi_interrupt
	.comm	UART_STATUS,4,4
	.comm	UART_DATA,4,4
	.comm	UART_CONTROL,4,4
	.comm	ES_TXRDY,1,1
	.comm	ES_TXINTENM,1,1
	.comm	ES_RXRDY,1,1
	.comm	ES_MODE_OUTPUT,4,4
	.comm	ES_MODE_INPUT,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_ens1370.c_snd_ensoniq_midi_interrupt.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	snd_ensoniq_midi_interrupt, %function
snd_ensoniq_midi_interrupt:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, [r0, #20]
	ldr	r2, .L33
	sub	sp, sp, #12
	cmp	r3, #0
	ldr	r2, [r2]
	str	r2, [sp, #4]
	mov	r2,#0
	beq	.L1
	mov	r4, r0
	add	r10, r0, #8
	mov	r0, r10
	bl	spin_lock
	ldr	r3, .L33+4
	ldr	r2, [r4]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L4
	ldr	r3, .L33+8
	ldrb	r5, [r3]	@ zero_extendqisi2
	cmp	r5, #0
	beq	.L4
	ldr	r6, .L33+12
	ldr	r7, .L33+16
	b	.L5
.L31:
	ldr	r1, [r7]
	mov	r0, r4
	bl	ES_REG
	bl	inb
	mov	r3, r0
	mov	r2, #1
	ldr	r0, [r4, #16]
	add	r1, sp, #3
	strb	r3, [sp, #3]
	bl	snd_rawmidi_receive
.L5:
	ldr	r1, [r6]
	mov	r0, r4
	bl	ES_REG
	bl	inb
	tst	r5, r0
	bne	.L31
.L4:
	mov	r0, r10
	bl	spin_unlock
	mov	r0, r10
	bl	spin_lock
	ldr	r3, .L33+20
	ldr	r2, [r4]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L6
	ldr	r7, .L33+24
	ldrb	r5, [r7]	@ zero_extendqisi2
	cmp	r5, #0
	beq	.L6
	ldr	r6, .L33+12
	ldr	r9, .L33+28
	ldr	r8, .L33+32
.L9:
	ldr	r1, [r6]
	mov	r0, r4
	bl	ES_REG
	bl	inb
	tst	r0, r5
	beq	.L6
	mov	r2, #1
	ldr	r0, [r4, #12]
	add	r1, sp, #3
	bl	snd_rawmidi_transmit
	cmp	r0, #1
	beq	.L7
	ldrb	r3, [r4, #4]	@ zero_extendqisi2
	ldrb	r2, [r9]	@ zero_extendqisi2
	ldr	r1, [r8]
	bic	fp, r3, r2
	mov	r0, r4
	strb	fp, [r4, #4]
	bl	ES_REG
	mov	r1, r0
	mov	r0, fp
	bl	outb
	ldrb	r3, [r7]	@ zero_extendqisi2
	bics	r5, r5, r3
	bne	.L9
.L6:
	mov	r0, r10
	bl	spin_unlock
.L1:
	ldr	r3, .L33
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L32
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r3, .L33+16
	mov	r0, r4
	ldr	r1, [r3]
	ldrb	fp, [sp, #3]	@ zero_extendqisi2
	bl	ES_REG
	mov	r1, r0
	mov	r0, fp
	bl	outb
	b	.L9
.L32:
	bl	__stack_chk_fail
.L34:
	.align	2
.L33:
	.word	.LC0
	.word	ES_MODE_INPUT
	.word	ES_RXRDY
	.word	UART_STATUS
	.word	UART_DATA
	.word	ES_MODE_OUTPUT
	.word	ES_TXRDY
	.word	ES_TXINTENM
	.word	UART_CONTROL
	.size	snd_ensoniq_midi_interrupt, .-snd_ensoniq_midi_interrupt
	.comm	UART_STATUS,4,4
	.comm	UART_DATA,4,4
	.comm	UART_CONTROL,4,4
	.comm	ES_TXRDY,1,1
	.comm	ES_TXINTENM,1,1
	.comm	ES_RXRDY,1,1
	.comm	ES_MODE_OUTPUT,4,4
	.comm	ES_MODE_INPUT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
