	.file	"extr_riptide.c_snd_riptide_prepare.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"prepare id %d ch: %d f:0x%x r:%d\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"use sgdlist at 0x%p\n"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"create sgd size: 0x%x pages %d of size 0x%x for period 0x%x\n"
	.text
	.p2align 4
	.type	snd_riptide_prepare, @function
snd_riptide_prepare:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 88
	.cfi_def_cfa_offset 144
	call	snd_pcm_substream_chip@PLT
	mov	rdi, r12
	mov	rbp, QWORD PTR [r12]
	mov	rbx, rax
	mov	QWORD PTR 16[rsp], rax
	call	get_pcmhwdev@PLT
	mov	r14, rax
	mov	rax, QWORD PTR 8[rbx]
	test	rax, rax
	mov	QWORD PTR 24[rsp], rax
	sete	dil
	test	r14, r14
	sete	al
	or	edi, eax
	movzx	edi, dil
	call	snd_BUG_ON@PLT
	test	rax, rax
	je	.L2
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	add	rsp, 88
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	ecx, DWORD PTR 4[rbp]
	mov	r8d, DWORD PTR 8[rbp]
	lea	rdi, .LC0[rip]
	xor	eax, eax
	mov	edx, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR [r14]
	call	snd_printdd@PLT
	mov	rdi, QWORD PTR 16[rsp]
	call	spin_lock_irq@PLT
	mov	ecx, DWORD PTR 4[rbp]
	mov	eax, DWORD PTR 0[rbp]
	mov	QWORD PTR 56[rsp], rcx
	mov	ecx, DWORD PTR 8[rbp]
	mov	DWORD PTR 68[rsp], eax
	mov	DWORD PTR 64[rsp], ecx
	cmp	eax, 1
	je	.L4
	cmp	eax, 2
	je	.L5
	mov	esi, DWORD PTR 72[r14]
	xor	eax, eax
	lea	rdi, .LC1[rip]
	call	snd_printdd@PLT
	cmp	QWORD PTR 72[r14], 0
	jne	.L27
.L34:
	mov	eax, DWORD PTR 24[r14]
.L7:
	cmp	DWORD PTR 64[rsp], eax
	jne	.L21
	mov	rax, QWORD PTR 56[rsp]
	cmp	QWORD PTR 32[r14], rax
	je	.L36
.L21:
	mov	eax, DWORD PTR 64[rsp]
	mov	r8, QWORD PTR 56[rsp]
	mov	ecx, DWORD PTR 68[rsp]
	mov	esi, DWORD PTR 48[r14]
	mov	edx, DWORD PTR [r14]
	mov	rdi, QWORD PTR 24[rsp]
	mov	DWORD PTR 24[r14], eax
	mov	QWORD PTR 32[r14], r8
	mov	DWORD PTR 40[r14], ecx
	call	setsampleformat@PLT
	test	rax, rax
	je	.L23
.L24:
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
.L22:
	mov	rdi, QWORD PTR 16[rsp]
	call	spin_unlock_irq@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L36:
	mov	eax, DWORD PTR 68[rsp]
	cmp	DWORD PTR 40[r14], eax
	jne	.L21
.L25:
	xor	r12d, r12d
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L27:
	mov	QWORD PTR 48[rsp], 0
.L6:
	mov	esi, DWORD PTR 16[rbp]
	mov	rdi, rbp
	call	frames_to_bytes@PLT
	mov	esi, DWORD PTR 12[rbp]
	mov	rdi, rbp
	mov	r15d, eax
	mov	DWORD PTR 72[rsp], eax
	call	frames_to_bytes@PLT
	lea	esi, -1[r15]
	mov	ebx, eax
	mov	eax, DWORD PTR PAGE_SIZE[rip]
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L37:
	lea	edx, [r13+r13]
	cmp	edx, ebx
	jbe	.L12
.L13:
	mov	r13d, eax
	shr	eax
	mov	edx, r13d
	lea	ecx, [rax+rsi]
	sal	edx, 7
	cmp	ecx, edx
	jbe	.L37
.L12:
	mov	ebp, DWORD PTR 72[rsp]
	mov	esi, r13d
	mov	edi, ebp
	call	DIV_ROUND_UP@PLT
	mov	DWORD PTR 4[r14], ebp
	mov	r8d, ebx
	mov	ecx, r13d
	mov	DWORD PTR 8[r14], eax
	mov	r15d, eax
	mov	edx, eax
	mov	esi, ebp
	xor	eax, eax
	lea	rdi, .LC2[rip]
	call	snd_printdd@PLT
	test	r15d, r15d
	je	.L38
	lea	eax, -1[r15]
	mov	QWORD PTR 40[rsp], r12
	mov	rbp, QWORD PTR 56[r14]
	xor	ebx, ebx
	mov	DWORD PTR 76[rsp], eax
	add	rax, 1
	mov	edi, DWORD PTR 64[r14]
	mov	r15d, 32
	sal	rax, 5
	mov	QWORD PTR 32[rsp], rax
	xor	eax, eax
	mov	r12d, eax
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rax, QWORD PTR 56[r14]
	mov	edi, DWORD PTR 64[r14]
	add	rax, r15
	add	edi, r15d
	add	r15, 32
	mov	QWORD PTR 8[rsp], rax
	call	cpu_to_le32@PLT
	mov	edi, DWORD PTR 64[r14]
	mov	QWORD PTR 24[rbp], rax
	mov	rbp, QWORD PTR 8[rsp]
.L26:
	call	cpu_to_le32@PLT
	mov	ecx, DWORD PTR PAGE_SHIFT[rip]
	mov	rdi, QWORD PTR 40[rsp]
	mov	esi, r12d
	mov	QWORD PTR 24[rbp], rax
	sal	esi, cl
	call	snd_pcm_sgbuf_get_addr@PLT
	lea	edi, [rax+rbx]
	call	cpu_to_le32@PLT
	xor	edx, edx
	mov	edi, r13d
	mov	QWORD PTR 16[rbp], rax
	lea	eax, 0[r13+rbx]
	div	DWORD PTR PAGE_SIZE[rip]
	cmp	edx, 1
	mov	ebx, edx
	adc	r12d, 0
	call	cpu_to_le32@PLT
	mov	edi, DWORD PTR IEOB_ENABLE[rip]
	or	edi, DWORD PTR IEOS_ENABLE[rip]
	mov	QWORD PTR 0[rbp], rax
	or	edi, DWORD PTR IEOC_ENABLE[rip]
	call	cpu_to_le32@PLT
	mov	QWORD PTR 8[rbp], rax
	cmp	r15, QWORD PTR 32[rsp]
	jne	.L17
	mov	r10d, DWORD PTR 76[rsp]
	mov	eax, DWORD PTR 72[rsp]
	imul	r10d, r13d
	sub	eax, r13d
	sub	eax, r10d
	mov	DWORD PTR 72[rsp], eax
.L15:
	mov	edi, DWORD PTR 72[rsp]
	add	r15, QWORD PTR 56[r14]
	call	cpu_to_le32@PLT
	mov	QWORD PTR [r15], rax
.L11:
	cmp	QWORD PTR 48[rsp], 0
	je	.L34
	mov	rdx, QWORD PTR 16[r14]
	cmp	rdx, QWORD PTR 48[rsp]
	je	.L34
	mov	esi, DWORD PTR 52[r14]
	test	rdx, rdx
	je	.L20
	mov	rdi, QWORD PTR 24[rsp]
	call	freelbuspath@PLT
	mov	esi, DWORD PTR 52[r14]
.L20:
	mov	rbx, QWORD PTR 48[rsp]
	mov	r8d, DWORD PTR 44[r14]
	lea	rcx, 48[r14]
	mov	rdi, QWORD PTR 24[rsp]
	mov	rdx, rbx
	call	alloclbuspath@PLT
	mov	QWORD PTR 16[r14], rbx
	xor	eax, eax
	mov	DWORD PTR 24[r14], 0
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	DWORD PTR 64[rsp], 48000
	je	.L39
.L8:
	mov	rax, QWORD PTR 88[r14]
	mov	QWORD PTR 48[rsp], rax
.L9:
	mov	esi, DWORD PTR 72[r14]
	xor	eax, eax
	lea	rdi, .LC1[rip]
	call	snd_printdd@PLT
	cmp	QWORD PTR 72[r14], 0
	je	.L11
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	DWORD PTR 64[rsp], 48000
	je	.L40
.L10:
	mov	rax, QWORD PTR 96[r14]
	mov	QWORD PTR 48[rsp], rax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L23:
	mov	esi, DWORD PTR 44[r14]
	mov	edx, DWORD PTR 64[rsp]
	mov	rdi, QWORD PTR 24[rsp]
	call	setsamplerate@PLT
	test	rax, rax
	jne	.L24
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L39:
	mov	rax, QWORD PTR 56[rsp]
	cmp	QWORD PTR SNDRV_PCM_FORMAT_S16_LE[rip], rax
	jne	.L8
.L33:
	mov	rax, QWORD PTR 80[r14]
	mov	QWORD PTR 48[rsp], rax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L40:
	mov	rax, QWORD PTR 56[rsp]
	cmp	QWORD PTR SNDRV_PCM_FORMAT_S16_LE[rip], rax
	jne	.L10
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L38:
	xor	r15d, r15d
	jmp	.L15
	.cfi_endproc
.LFE0:
	.size	snd_riptide_prepare, .-snd_riptide_prepare
	.comm	SNDRV_PCM_FORMAT_S16_LE,8,8
	.comm	PAGE_SIZE,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	IEOS_ENABLE,4,4
	.comm	IEOC_ENABLE,4,4
	.comm	IEOB_ENABLE,4,4
	.comm	EIO,4,4
	.comm	EINVAL,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_riptide.c_snd_riptide_prepare.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"prepare id %d ch: %d f:0x%x r:%d\012\000"
	.align	2
.LC1:
	.ascii	"use sgdlist at 0x%p\012\000"
	.align	2
.LC2:
	.ascii	"create sgd size: 0x%x pages %d of size 0x%x for per"
	.ascii	"iod 0x%x\012\000"
	.global	__aeabi_uidivmod
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	snd_riptide_prepare, %function
snd_riptide_prepare:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #52
	mov	r9, r0
	bl	snd_pcm_substream_chip
	mov	r10, r0
	mov	r0, r9
	ldr	r5, [r9]
	bl	get_pcmhwdev
	mov	r4, r0
	clz	r0, r0
	ldr	r3, [r10, #4]
	lsr	r0, r0, #5
	cmp	r3, #0
	moveq	r0, #1
	str	r3, [sp, #12]
	bl	snd_BUG_ON
	subs	r7, r0, #0
	beq	.L2
	ldr	r3, .L43
	ldr	r7, [r3]
	rsb	r7, r7, #0
	mov	r0, r7
	add	sp, sp, #52
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r0, [r5, #8]
	ldm	r5, {r2, r3}
	ldr	r1, [r4]
	str	r0, [sp]
	ldr	r0, .L43+4
	bl	snd_printdd
	mov	r0, r10
	bl	spin_lock_irq
	ldr	r2, [r5, #4]
	ldr	r3, [r5]
	str	r2, [sp, #28]
	ldr	r2, [r5, #8]
	cmp	r3, #1
	str	r3, [sp, #32]
	str	r2, [sp, #16]
	beq	.L4
	cmp	r3, #2
	beq	.L5
	ldr	r1, [r4, #48]
	ldr	r0, .L43+8
	bl	snd_printdd
	ldr	r3, [r4, #48]
	cmp	r3, #0
	bne	.L27
.L37:
	ldr	r3, [r4, #16]
.L7:
	ldr	r2, [sp, #16]
	cmp	r2, r3
	bne	.L21
	ldr	r3, [r4, #20]
	ldr	r2, [sp, #28]
	cmp	r3, r2
	beq	.L39
.L21:
	ldr	r3, [sp, #16]
	ldr	r0, [sp, #28]
	str	r3, [r4, #16]
	ldr	r3, [sp, #32]
	str	r0, [r4, #20]
	ldr	r2, [r4]
	ldr	r1, [r4, #32]
	str	r3, [r4, #24]
	str	r0, [sp]
	ldr	r0, [sp, #12]
	bl	setsampleformat
	cmp	r0, #0
	beq	.L23
.L24:
	ldr	r3, .L43+12
	ldr	r7, [r3]
	rsb	r7, r7, #0
.L22:
	mov	r0, r10
	bl	spin_unlock_irq
	mov	r0, r7
	add	sp, sp, #52
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L39:
	ldr	r3, [r4, #24]
	ldr	r2, [sp, #32]
	cmp	r3, r2
	bne	.L21
	b	.L22
.L27:
	str	r7, [sp, #24]
.L6:
	ldr	r1, [r5, #16]
	mov	r0, r5
	bl	frames_to_bytes
	mov	r6, r0
	ldr	r1, [r5, #12]
	mov	r0, r5
	str	r6, [sp, #36]
	bl	frames_to_bytes
	ldr	r3, .L43+16
	mov	r5, r0
	ldr	r3, [r3]
	sub	r1, r6, #1
	b	.L13
.L40:
	cmp	r5, r6, lsl #1
	bcs	.L12
.L13:
	mov	r6, r3
	lsr	r3, r3, #1
	add	r2, r3, r1
	cmp	r2, r6, lsl #7
	bls	.L40
.L12:
	ldr	r8, [sp, #36]
	mov	r1, r6
	mov	r0, r8
	bl	DIV_ROUND_UP
	mov	r1, r8
	mov	r3, r0
	mov	r8, r0
	stmib	r4, {r1, r3}
	mov	r2, r0
	mov	r3, r6
	str	r0, [sp, #20]
	str	r5, [sp]
	ldr	r0, .L43+20
	bl	snd_printdd
	cmp	r8, #0
	mov	r3, r8
	ldreq	r3, [sp, #20]
	beq	.L15
	mov	r3, #0
	str	r7, [sp, #44]
	mov	r5, r3
	mov	r7, r3
	ldr	r8, [r4, #40]
	ldr	r0, [r4, #44]
	str	r3, [sp, #8]
	str	r10, [sp, #40]
	b	.L26
.L17:
	ldr	r0, [r4, #44]
	ldr	r1, [r4, #40]
	add	r0, r3, r0
	add	r10, r1, r3
	bl	cpu_to_le32
	str	r0, [r8, #12]
	mov	r8, r10
	ldr	r0, [r4, #44]
	str	fp, [sp, #8]
.L26:
	bl	cpu_to_le32
	ldr	r3, .L43+24
	str	r0, [r8, #12]
	ldr	r1, [r3]
	mov	r0, r9
	lsl	r1, r7, r1
	bl	snd_pcm_sgbuf_get_addr
	add	r0, r0, r5
	bl	cpu_to_le32
	ldr	r3, .L43+16
	str	r0, [r8, #8]
	ldr	r1, [r3]
	add	r0, r6, r5
	bl	__aeabi_uidivmod
	ldr	r3, [sp, #8]
	subs	r5, r1, #0
	mov	r0, r6
	add	fp, r3, #1
	addeq	r7, r7, #1
	bl	cpu_to_le32
	ldr	r2, .L43+28
	ldr	r3, .L43+32
	ldr	r1, [r2]
	ldr	r2, .L43+36
	ldr	r3, [r3]
	str	r0, [r8]
	ldr	r0, [r2]
	orr	r3, r3, r1
	orr	r0, r3, r0
	bl	cpu_to_le32
	ldr	r3, [sp, #20]
	str	r0, [r8, #4]
	cmp	r3, fp
	lsl	r3, fp, #4
	bne	.L17
	ldr	r2, [sp, #8]
	ldr	r1, [sp, #36]
	mul	r2, r6, r2
	sub	r6, r1, r6
	sub	r2, r6, r2
	ldr	r10, [sp, #40]
	ldr	r7, [sp, #44]
	str	r2, [sp, #36]
.L15:
	ldr	r0, [sp, #36]
	ldr	r5, [r4, #40]
	str	r3, [sp, #8]
	bl	cpu_to_le32
	ldr	r3, [sp, #8]
	str	r0, [r5, r3]
.L11:
	ldr	r3, [sp, #24]
	cmp	r3, #0
	beq	.L37
	ldr	r2, [r4, #12]
	ldr	r3, [sp, #24]
	cmp	r2, r3
	beq	.L37
	cmp	r2, #0
	ldr	r1, [r4, #36]
	beq	.L20
	ldr	r0, [sp, #12]
	bl	freelbuspath
	ldr	r1, [r4, #36]
.L20:
	ldr	r3, [r4, #28]
	ldr	r5, [sp, #24]
	str	r3, [sp]
	mov	r2, r5
	add	r3, r4, #32
	ldr	r0, [sp, #12]
	bl	alloclbuspath
	mov	r2, #0
	str	r5, [r4, #12]
	mov	r3, r2
	str	r2, [r4, #16]
	b	.L7
.L4:
	ldr	r3, .L43+40
	ldr	r2, [sp, #16]
	cmp	r2, r3
	beq	.L41
.L8:
	ldr	r3, [r4, #56]
	str	r3, [sp, #24]
.L9:
	ldr	r1, [r4, #48]
	ldr	r0, .L43+8
	bl	snd_printdd
	ldr	r3, [r4, #48]
	cmp	r3, #0
	beq	.L11
	b	.L6
.L5:
	ldr	r3, .L43+40
	ldr	r2, [sp, #16]
	cmp	r2, r3
	beq	.L42
.L10:
	ldr	r3, [r4, #60]
	str	r3, [sp, #24]
	b	.L9
.L23:
	ldr	r2, [sp, #16]
	ldr	r1, [r4, #28]
	ldr	r0, [sp, #12]
	bl	setsamplerate
	cmp	r0, #0
	bne	.L24
	b	.L22
.L41:
	ldr	r3, .L43+44
	ldr	r2, [sp, #28]
	ldr	r3, [r3]
	cmp	r3, r2
	bne	.L8
.L36:
	ldr	r3, [r4, #52]
	str	r3, [sp, #24]
	b	.L9
.L42:
	ldr	r3, .L43+44
	ldr	r2, [sp, #28]
	ldr	r3, [r3]
	cmp	r3, r2
	bne	.L10
	b	.L36
.L44:
	.align	2
.L43:
	.word	EINVAL
	.word	.LC0
	.word	.LC1
	.word	EIO
	.word	PAGE_SIZE
	.word	.LC2
	.word	PAGE_SHIFT
	.word	IEOS_ENABLE
	.word	IEOB_ENABLE
	.word	IEOC_ENABLE
	.word	48000
	.word	SNDRV_PCM_FORMAT_S16_LE
	.size	snd_riptide_prepare, .-snd_riptide_prepare
	.comm	SNDRV_PCM_FORMAT_S16_LE,4,4
	.comm	PAGE_SIZE,4,4
	.comm	PAGE_SHIFT,4,4
	.comm	IEOS_ENABLE,4,4
	.comm	IEOC_ENABLE,4,4
	.comm	IEOB_ENABLE,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
