	.file	"extr_emu8000_callback.c_start_voice.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	start_voice, @function
start_voice:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	edx, 128
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbp, QWORD PTR 72[rdi]
	mov	rbx, rdi
	mov	r12d, DWORD PTR [rdi]
	mov	r13, QWORD PTR 64[rdi]
	mov	rdi, rbp
	mov	esi, r12d
	call	EMU8000_DCYSUSV_WRITE@PLT
	mov	esi, r12d
	mov	rdi, rbp
	mov	edx, 65535
	call	EMU8000_VTFT_WRITE@PLT
	mov	esi, r12d
	mov	rdi, rbp
	mov	edx, 65535
	call	EMU8000_CVCF_WRITE@PLT
	xor	edx, edx
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_PTRX_WRITE@PLT
	xor	edx, edx
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_CPF_WRITE@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	call	set_pitch@PLT
	mov	edx, DWORD PTR 56[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_ENVVAL_WRITE@PLT
	mov	edx, DWORD PTR 52[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_ATKHLD_WRITE@PLT
	mov	edx, DWORD PTR 48[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_DCYSUS_WRITE@PLT
	mov	edx, DWORD PTR 44[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_ENVVOL_WRITE@PLT
	mov	edx, DWORD PTR 40[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_ATKHLDV_WRITE@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	call	set_volume@PLT
	mov	edx, DWORD PTR 36[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_PEFE_WRITE@PLT
	mov	edx, DWORD PTR 32[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_LFO1VAL_WRITE@PLT
	mov	edx, DWORD PTR 28[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	call	EMU8000_LFO2VAL_WRITE@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	call	set_fmmod@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	call	set_tremfreq@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	call	set_fm2frq2@PLT
	mov	rsi, rbx
	mov	rdi, rbp
	call	set_pan@PLT
	mov	eax, DWORD PTR 12[rbx]
	mov	esi, 255
	mov	rdx, QWORD PTR MIDI_CTL_E3_CHORUS_DEPTH[rip]
	lea	r14d, -1[rax]
	mov	rax, QWORD PTR 0[r13]
	mov	rax, QWORD PTR [rax+rdx*8]
	lea	eax, [rax+rax*8]
	movsx	r13, eax
	sar	eax, 31
	imul	r13, r13, 1717986919
	sar	r13, 34
	sub	r13d, eax
	add	r13d, DWORD PTR 20[rbx]
	mov	edi, r13d
	sal	r13d, 24
	call	LIMITMAX@PLT
	mov	edx, r14d
	mov	esi, r12d
	mov	rdi, rbp
	or	edx, r13d
	call	EMU8000_CSL_WRITE@PLT
	mov	ecx, DWORD PTR 16[rbx]
	mov	eax, DWORD PTR 24[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	lea	edx, -1[rcx]
	sal	eax, 28
	or	edx, eax
	call	EMU8000_CCCA_WRITE@PLT
	mov	esi, r12d
	mov	rdi, rbp
	xor	edx, edx
	call	EMU8000_00A0_WRITE@PLT
	mov	esi, r12d
	mov	rdi, rbp
	xor	edx, edx
	call	EMU8000_0080_WRITE@PLT
	mov	r13d, DWORD PTR 4[rbx]
	mov	edx, DWORD PTR 8[rbx]
	mov	esi, r12d
	mov	rdi, rbp
	sal	r13d, 16
	or	edx, r13d
	call	EMU8000_VTFT_WRITE@PLT
	mov	edx, r13d
	mov	esi, r12d
	mov	rdi, rbp
	or	dh, -1
	call	EMU8000_CVCF_WRITE@PLT
	pop	rbx
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	start_voice, .-start_voice
	.comm	MIDI_CTL_E3_CHORUS_DEPTH,8,8
	.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_emu8000_callback.c_start_voice.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	start_voice, %function
start_voice:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r5, r0
	ldr	r4, [r0, #64]
	ldr	r6, [r0]
	ldr	r7, .L4
	mov	r1, r6
	mov	r0, r4
	mov	r2, #128
	ldr	r8, [r5, #60]
	bl	EMU8000_DCYSUSV_WRITE
	mov	r1, r6
	mov	r2, r7
	mov	r0, r4
	bl	EMU8000_VTFT_WRITE
	mov	r2, r7
	mov	r1, r6
	mov	r0, r4
	bl	EMU8000_CVCF_WRITE
	mov	r1, r6
	mov	r0, r4
	mov	r2, #0
	bl	EMU8000_PTRX_WRITE
	mov	r1, r6
	mov	r2, #0
	mov	r0, r4
	bl	EMU8000_CPF_WRITE
	mov	r1, r5
	mov	r0, r4
	bl	set_pitch
	mov	r1, r6
	ldr	r2, [r5, #56]
	mov	r0, r4
	bl	EMU8000_ENVVAL_WRITE
	mov	r1, r6
	ldr	r2, [r5, #52]
	mov	r0, r4
	bl	EMU8000_ATKHLD_WRITE
	mov	r1, r6
	ldr	r2, [r5, #48]
	mov	r0, r4
	bl	EMU8000_DCYSUS_WRITE
	mov	r1, r6
	ldr	r2, [r5, #44]
	mov	r0, r4
	bl	EMU8000_ENVVOL_WRITE
	ldr	r2, [r5, #40]
	mov	r1, r6
	mov	r0, r4
	bl	EMU8000_ATKHLDV_WRITE
	mov	r1, r5
	mov	r0, r4
	bl	set_volume
	mov	r1, r6
	ldr	r2, [r5, #36]
	mov	r0, r4
	bl	EMU8000_PEFE_WRITE
	mov	r1, r6
	ldr	r2, [r5, #32]
	mov	r0, r4
	bl	EMU8000_LFO1VAL_WRITE
	ldr	r2, [r5, #28]
	mov	r1, r6
	mov	r0, r4
	bl	EMU8000_LFO2VAL_WRITE
	mov	r1, r5
	mov	r0, r4
	bl	set_fmmod
	mov	r1, r5
	mov	r0, r4
	bl	set_tremfreq
	mov	r1, r5
	mov	r0, r4
	bl	set_fm2frq2
	mov	r1, r5
	mov	r0, r4
	bl	set_pan
	ldr	r2, .L4+4
	ldr	r3, [r8]
	ldr	r2, [r2]
	ldr	r7, .L4+8
	ldr	r3, [r3, r2, lsl #2]
	ldr	r1, [r5, #20]
	add	r3, r3, r3, lsl #3
	smull	r0, r2, r7, r3
	asr	r7, r3, #31
	ldr	r8, [r5, #12]
	rsb	r7, r7, r2, asr #2
	add	r7, r7, r1
	mov	r0, r7
	mov	r1, #255
	sub	r8, r8, #1
	bl	LIMITMAX
	mov	r1, r6
	orr	r2, r8, r7, lsl #24
	mov	r0, r4
	bl	EMU8000_CSL_WRITE
	ldr	r3, [r5, #16]
	ldr	r2, [r5, #24]
	sub	r3, r3, #1
	orr	r2, r3, r2, lsl #28
	mov	r1, r6
	mov	r0, r4
	bl	EMU8000_CCCA_WRITE
	mov	r1, r6
	mov	r0, r4
	mov	r2, #0
	bl	EMU8000_00A0_WRITE
	mov	r1, r6
	mov	r0, r4
	mov	r2, #0
	bl	EMU8000_0080_WRITE
	ldr	r3, [r5, #4]
	ldr	r2, [r5, #8]
	mov	r1, r6
	orr	r2, r2, r3, lsl #16
	lsl	r5, r3, #16
	mov	r0, r4
	bl	EMU8000_VTFT_WRITE
	mov	r1, r6
	mov	r0, r4
	orr	r2, r5, #65280
	bl	EMU8000_CVCF_WRITE
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	.align	2
.L4:
	.word	65535
	.word	MIDI_CTL_E3_CHORUS_DEPTH
	.word	1717986919
	.size	start_voice, .-start_voice
	.comm	MIDI_CTL_E3_CHORUS_DEPTH,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
