	.file	"extr_alsa_midi.c_alsa_midi_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	alsa_midi_write, @function
alsa_midi_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	rbx, rdi
	sub	rsp, 96
	.cfi_def_cfa_offset 112
	mov	rcx, QWORD PTR [rsi]
	mov	rdx, QWORD PTR alsa_midi_ev_map[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 88[rsp], rax
	xor	eax, eax
	mov	r8d, DWORD PTR SND_SEQ_TIME_STAMP_REAL[rip]
	or	r8d, DWORD PTR SND_SEQ_TIME_MODE_ABS[rip]
	mov	eax, DWORD PTR [rcx]
	sar	eax, 4
	and	eax, 7
	mov	rdi, QWORD PTR [rdx+rax*8]
	mov	eax, DWORD PTR 24[rbx]
	mov	DWORD PTR 8[rsp], r8d
	movsx	rdx, DWORD PTR 8[rsi]
	mov	DWORD PTR 80[rsp], eax
	mov	rax, rdx
	imul	rdx, rdx, 1125899907
	mov	QWORD PTR [rsp], rdi
	mov	r9d, eax
	sar	r9d, 31
	sar	rdx, 50
	sub	edx, r9d
	movsx	r9, edx
	imul	edx, edx, 1000000
	add	r9, QWORD PTR 8[rbx]
	mov	QWORD PTR 24[rsp], r9
	sub	eax, edx
	imul	eax, eax, 1000
	add	eax, DWORD PTR [rbx]
	mov	DWORD PTR 16[rsp], eax
	cmp	eax, 999999999
	jle	.L2
	add	r9, 1
	sub	eax, 1000000000
	mov	QWORD PTR 24[rsp], r9
	mov	DWORD PTR 16[rsp], eax
.L2:
	mov	eax, DWORD PTR 20[rbx]
	cmp	rdi, QWORD PTR SND_SEQ_EVENT_NOTEOFF[rip]
	mov	DWORD PTR 76[rsp], eax
	mov	eax, DWORD PTR SND_SEQ_ADDRESS_SUBSCRIBERS[rip]
	mov	DWORD PTR 72[rsp], eax
	je	.L3
	cmp	rdi, QWORD PTR SND_SEQ_EVENT_NOTEON[rip]
	je	.L3
	cmp	rdi, QWORD PTR SND_SEQ_EVENT_KEYPRESS[rip]
	je	.L3
	cmp	rdi, QWORD PTR SND_SEQ_EVENT_CONTROLLER[rip]
	je	.L13
	cmp	rdi, QWORD PTR SND_SEQ_EVENT_PGMCHANGE[rip]
	je	.L7
	cmp	rdi, QWORD PTR SND_SEQ_EVENT_CHANPRESS[rip]
	je	.L7
	cmp	rdi, QWORD PTR SND_SEQ_EVENT_PITCHBEND[rip]
	je	.L14
	cmp	rdi, QWORD PTR SND_SEQ_EVENT_SYSEX[rip]
	jne	.L5
	mov	eax, DWORD PTR 12[rsi]
	or	r8d, DWORD PTR SND_SEQ_EVENT_LENGTH_VARIABLE[rip]
	mov	QWORD PTR 32[rsp], rcx
	mov	DWORD PTR 8[rsp], r8d
	mov	DWORD PTR 40[rsp], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	mov	eax, DWORD PTR [rcx]
	and	eax, 15
	mov	DWORD PTR 60[rsp], eax
	mov	eax, DWORD PTR 4[rcx]
	mov	DWORD PTR 64[rsp], eax
	mov	eax, DWORD PTR 8[rcx]
	mov	DWORD PTR 68[rsp], eax
.L5:
	mov	edi, DWORD PTR 16[rbx]
	mov	rsi, rsp
	call	snd_seq_event_output@PLT
	mov	rdx, QWORD PTR 24[rsp]
	not	eax
	mov	QWORD PTR 8[rbx], rdx
	mov	edx, DWORD PTR 16[rsp]
	shr	eax, 31
	mov	DWORD PTR [rbx], edx
	mov	rcx, QWORD PTR 88[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L15
	add	rsp, 96
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	pop	rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	eax, DWORD PTR [rcx]
	and	eax, 15
	mov	DWORD PTR 48[rsp], eax
	mov	eax, DWORD PTR 4[rcx]
	mov	DWORD PTR 52[rsp], eax
	mov	eax, DWORD PTR 8[rcx]
	mov	DWORD PTR 56[rsp], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	mov	eax, DWORD PTR [rcx]
	and	eax, 15
	mov	DWORD PTR 48[rsp], eax
	mov	eax, DWORD PTR 4[rcx]
	mov	DWORD PTR 56[rsp], eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	mov	eax, DWORD PTR [rcx]
	and	eax, 15
	mov	DWORD PTR 48[rsp], eax
	mov	eax, DWORD PTR 8[rcx]
	sal	eax, 7
	or	eax, DWORD PTR 4[rcx]
	sub	eax, 8192
	mov	DWORD PTR 56[rsp], eax
	jmp	.L5
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	alsa_midi_write, .-alsa_midi_write
	.comm	alsa_midi_ev_map,8,8
	.comm	SND_SEQ_TIME_STAMP_REAL,4,4
	.comm	SND_SEQ_TIME_MODE_ABS,4,4
	.comm	SND_SEQ_EVENT_SYSEX,8,8
	.comm	SND_SEQ_EVENT_PITCHBEND,8,8
	.comm	SND_SEQ_EVENT_PGMCHANGE,8,8
	.comm	SND_SEQ_EVENT_NOTEON,8,8
	.comm	SND_SEQ_EVENT_NOTEOFF,8,8
	.comm	SND_SEQ_EVENT_LENGTH_VARIABLE,4,4
	.comm	SND_SEQ_EVENT_KEYPRESS,8,8
	.comm	SND_SEQ_EVENT_CONTROLLER,8,8
	.comm	SND_SEQ_EVENT_CHANPRESS,8,8
	.comm	SND_SEQ_ADDRESS_SUBSCRIBERS,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_alsa_midi.c_alsa_midi_write.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	alsa_midi_write, %function
alsa_midi_write:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r0
	ldr	r2, [r1, #4]
	ldr	r3, .L16
	asr	r0, r2, #31
	smull	ip, r3, r2, r3
	ldr	lr, [r1]
	rsb	r3, r0, r3, asr #18
	rsb	r0, r3, r3, lsl #5
	ldr	ip, [lr]
	ldr	r5, .L16+4
	rsb	r0, r0, r0, lsl #6
	add	r0, r3, r0, lsl #3
	sub	r2, r2, r0, lsl #6
	asr	r0, ip, #4
	ldr	ip, [r5]
	and	r0, r0, #7
	ldr	ip, [ip, r0, lsl #2]
	ldr	r6, [r4, #4]
	rsb	r0, r2, r2, lsl #5
	add	r2, r2, r0, lsl #2
	ldr	r7, .L16+8
	ldr	r0, [r4]
	ldr	r5, .L16+12
	add	r3, r3, r6
	ldr	r6, .L16+16
	add	r2, r0, r2, lsl #3
	ldr	r5, [r5]
	ldr	r7, [r7]
	cmp	r2, r6
	ldr	r6, .L16+20
	sub	sp, sp, #68
	orr	r0, r7, r5
	ldr	r5, [r4, #16]
	ldr	r6, [r6]
	str	r6, [sp, #60]
	mov	r6,#0
	str	r3, [sp, #12]
	addgt	r3, r3, #1
	str	r5, [sp, #56]
	strgt	r3, [sp, #12]
	ldrgt	r5, .L16+24
	ldr	r3, .L16+28
	addgt	r5, r2, r5
	ldr	r3, [r3]
	str	r2, [sp, #8]
	ldr	r2, .L16+32
	strgt	r5, [sp, #8]
	ldr	r2, [r2]
	cmp	ip, r3
	ldr	r3, [r4, #12]
	str	ip, [sp]
	str	r0, [sp, #4]
	str	r2, [sp, #48]
	str	r3, [sp, #52]
	beq	.L3
	ldr	r3, .L16+36
	ldr	r3, [r3]
	cmp	ip, r3
	beq	.L3
	ldr	r3, .L16+40
	ldr	r3, [r3]
	cmp	ip, r3
	beq	.L3
	ldr	r3, .L16+44
	ldr	r3, [r3]
	cmp	ip, r3
	beq	.L13
	ldr	r3, .L16+48
	ldr	r3, [r3]
	cmp	ip, r3
	beq	.L7
	ldr	r3, .L16+52
	ldr	r3, [r3]
	cmp	ip, r3
	beq	.L7
	ldr	r3, .L16+56
	ldr	r3, [r3]
	cmp	ip, r3
	beq	.L14
	ldr	r3, .L16+60
	ldr	r3, [r3]
	cmp	ip, r3
	bne	.L5
	ldr	r3, .L16+64
	ldr	r2, [r1, #8]
	ldr	r3, [r3]
	str	r2, [sp, #20]
	orr	r0, r3, r0
	str	lr, [sp, #16]
	str	r0, [sp, #4]
	b	.L5
.L3:
	ldr	r3, [lr]
	and	r3, r3, #15
	str	r3, [sp, #36]
	ldr	r3, [lr, #4]
	str	r3, [sp, #40]
	ldr	r3, [lr, #8]
	str	r3, [sp, #44]
.L5:
	mov	r1, sp
	ldr	r0, [r4, #8]
	bl	snd_seq_event_output
	ldr	r3, [sp, #8]
	ldr	r2, [sp, #12]
	str	r3, [r4]
	ldr	r3, .L16+20
	str	r2, [r4, #4]
	mvn	r0, r0
	ldr	r2, [r3]
	ldr	r3, [sp, #60]
	eors	r2, r3, r2
	mov	r3, #0
	lsr	r0, r0, #31
	bne	.L15
	add	sp, sp, #68
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L13:
	ldr	r3, [lr]
	and	r3, r3, #15
	str	r3, [sp, #24]
	ldr	r3, [lr, #4]
	str	r3, [sp, #28]
	ldr	r3, [lr, #8]
	str	r3, [sp, #32]
	b	.L5
.L7:
	ldr	r3, [lr]
	and	r3, r3, #15
	str	r3, [sp, #24]
	ldr	r3, [lr, #4]
	str	r3, [sp, #32]
	b	.L5
.L14:
	ldr	r3, [lr]
	and	r3, r3, #15
	str	r3, [sp, #24]
	ldr	r2, [lr, #8]
	ldr	r3, [lr, #4]
	orr	r3, r3, r2, lsl #7
	sub	r3, r3, #8192
	str	r3, [sp, #32]
	b	.L5
.L15:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	1125899907
	.word	alsa_midi_ev_map
	.word	SND_SEQ_TIME_STAMP_REAL
	.word	SND_SEQ_TIME_MODE_ABS
	.word	999999999
	.word	.LC0
	.word	-1000000000
	.word	SND_SEQ_EVENT_NOTEOFF
	.word	SND_SEQ_ADDRESS_SUBSCRIBERS
	.word	SND_SEQ_EVENT_NOTEON
	.word	SND_SEQ_EVENT_KEYPRESS
	.word	SND_SEQ_EVENT_CONTROLLER
	.word	SND_SEQ_EVENT_PGMCHANGE
	.word	SND_SEQ_EVENT_CHANPRESS
	.word	SND_SEQ_EVENT_PITCHBEND
	.word	SND_SEQ_EVENT_SYSEX
	.word	SND_SEQ_EVENT_LENGTH_VARIABLE
	.size	alsa_midi_write, .-alsa_midi_write
	.comm	alsa_midi_ev_map,4,4
	.comm	SND_SEQ_TIME_STAMP_REAL,4,4
	.comm	SND_SEQ_TIME_MODE_ABS,4,4
	.comm	SND_SEQ_EVENT_SYSEX,4,4
	.comm	SND_SEQ_EVENT_PITCHBEND,4,4
	.comm	SND_SEQ_EVENT_PGMCHANGE,4,4
	.comm	SND_SEQ_EVENT_NOTEON,4,4
	.comm	SND_SEQ_EVENT_NOTEOFF,4,4
	.comm	SND_SEQ_EVENT_LENGTH_VARIABLE,4,4
	.comm	SND_SEQ_EVENT_KEYPRESS,4,4
	.comm	SND_SEQ_EVENT_CONTROLLER,4,4
	.comm	SND_SEQ_EVENT_CHANPRESS,4,4
	.comm	SND_SEQ_ADDRESS_SUBSCRIBERS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
