	.file	"extr_au88x0_core.c_vortex_wtdma_setbuffers.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	vortex_wtdma_setbuffers, @function
vortex_wtdma_setbuffers:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movsx	rax, esi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, edx
	lea	rdx, [rax+rax*4]
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	lea	r8d, -1[r14]
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rax
	mov	r15d, r8d
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	r13d, r12d
	mov	rbp, rdi
	sal	r15d, 12
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sal	r13d, 4
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR 8[rdi]
	lea	rbx, [rax+rdx*4]
	mov	DWORD PTR [rbx], r14d
	mov	edi, DWORD PTR 16[rbx]
	mov	DWORD PTR 4[rbx], ecx
	mov	QWORD PTR 8[rbx], 0
	cmp	ecx, 2
	je	.L7
	cmp	ecx, 3
	je	.L3
	cmp	ecx, 1
	je	.L4
	mov	eax, r8d
	lea	esi, [r14+r14*2]
	mov	DWORD PTR 12[rsp], r8d
	or	eax, -67108864
	mov	DWORD PTR 12[rbx], eax
	call	snd_pcm_sgbuf_get_addr@PLT
	mov	esi, DWORD PTR VORTEX_WTDMA_BUFBASE[rip]
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, eax
	add	esi, r13d
	add	esi, 12
	movsx	rsi, esi
	call	hwwrite@PLT
	mov	edx, DWORD PTR 8[rbx]
	mov	eax, DWORD PTR 12[rbx]
	mov	edi, DWORD PTR 16[rbx]
	mov	r8d, DWORD PTR 12[rsp]
	or	edx, 301989888
	or	eax, r15d
.L6:
	or	eax, -1073741824
	mov	DWORD PTR 8[rbx], edx
	lea	esi, [r14+r14]
	mov	DWORD PTR 12[rbx], eax
	mov	DWORD PTR 12[rsp], r8d
	call	snd_pcm_sgbuf_get_addr@PLT
	mov	esi, DWORD PTR VORTEX_WTDMA_BUFBASE[rip]
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, eax
	add	esi, r13d
	add	esi, 8
	movsx	rsi, esi
	call	hwwrite@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	r8d, DWORD PTR 12[rsp]
	or	r8d, DWORD PTR 8[rbx]
.L7:
	or	r8d, -603979776
	mov	esi, r14d
	mov	DWORD PTR 8[rbx], r8d
	call	snd_pcm_sgbuf_get_addr@PLT
	mov	esi, DWORD PTR VORTEX_WTDMA_BUFBASE[rip]
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, eax
	add	esi, r13d
	add	esi, 4
	movsx	rsi, esi
	call	hwwrite@PLT
	mov	edi, DWORD PTR 16[rbx]
	or	r15d, DWORD PTR 8[rbx]
.L4:
	or	r15d, -1073741824
	xor	esi, esi
	mov	DWORD PTR 8[rbx], r15d
	call	snd_pcm_sgbuf_get_addr@PLT
	mov	esi, DWORD PTR VORTEX_WTDMA_BUFBASE[rip]
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, eax
	add	esi, r13d
	lea	r13d, 0[0+r12*8]
	movsx	rsi, esi
	movsx	r13, r13d
	call	hwwrite@PLT
	mov	rsi, QWORD PTR VORTEX_WTDMA_BUFCFG0[rip]
	mov	edx, DWORD PTR 8[rbx]
	mov	edi, DWORD PTR 0[rbp]
	add	rsi, r13
	call	hwwrite@PLT
	mov	rsi, QWORD PTR VORTEX_WTDMA_BUFCFG1[rip]
	mov	edx, DWORD PTR 12[rbx]
	mov	edi, DWORD PTR 0[rbp]
	add	rsi, r13
	call	hwwrite@PLT
	mov	esi, r12d
	mov	rdi, rbp
	call	vortex_wtdma_setfirstbuffer@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	esi, r12d
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 48
	xor	edx, edx
	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
	jmp	vortex_wtdma_setstartbuffer@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	eax, r15d
	mov	edx, 301989888
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	vortex_wtdma_setbuffers, .-vortex_wtdma_setbuffers
	.comm	VORTEX_WTDMA_BUFCFG1,8,8
	.comm	VORTEX_WTDMA_BUFCFG0,8,8
	.comm	VORTEX_WTDMA_BUFBASE,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_au88x0_core.c_vortex_wtdma_setbuffers.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vortex_wtdma_setbuffers, %function
vortex_wtdma_setbuffers:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r1
	mov	r8, r2
	mov	r1, #0
	mov	r2, r3
	mov	r6, r0
	ldr	r3, .L14
	ldr	r0, [r0, #4]
	add	ip, r5, r5, lsl #2
	add	r4, r0, ip, lsl #2
	ldr	r7, [r3]
	sub	sp, sp, #12
	str	r8, [r0, ip, lsl #2]
	sub	r10, r8, #1
	str	r1, [r4, #8]
	str	r1, [r4, #12]
	cmp	r2, #2
	lsl	r1, r5, #4
	ldr	r0, [r4, #16]
	ldr	fp, [r6]
	str	r2, [r4, #4]
	lsl	r9, r10, #12
	str	r1, [sp, #4]
	add	r7, r7, r5, lsl #4
	beq	.L7
	cmp	r2, #3
	beq	.L3
	cmp	r2, #1
	beq	.L4
	orr	r2, r10, #-67108864
	str	r2, [r4, #12]
	add	r1, r8, r8, lsl #1
	bl	snd_pcm_sgbuf_get_addr
	add	r1, r7, #12
	mov	r2, r0
	mov	r0, fp
	bl	hwwrite
	ldr	r3, .L14
	ldr	ip, [r4, #8]
	ldr	r7, [r3]
	ldr	r2, [r4, #12]
	lsl	r1, r5, #4
	ldr	fp, [r6]
	ldr	r0, [r4, #16]
	add	r7, r1, r7
	orr	ip, ip, #301989888
	orr	r2, r9, r2
	lsl	r1, r8, #1
.L6:
	orr	r2, r2, #-1073741824
	str	r2, [r4, #12]
	str	ip, [r4, #8]
	bl	snd_pcm_sgbuf_get_addr
	add	r1, r7, #8
	mov	r2, r0
	mov	r0, fp
	bl	hwwrite
	ldr	r3, .L14
	ldr	r2, [r4, #8]
	ldr	r7, [r3]
	lsl	r1, r5, #4
	ldr	fp, [r6]
	ldr	r0, [r4, #16]
	add	r7, r1, r7
	orr	r10, r10, r2
.L7:
	orr	r10, r10, #-603979776
	mov	r1, r8
	str	r10, [r4, #8]
	bl	snd_pcm_sgbuf_get_addr
	add	r1, r7, #4
	mov	r2, r0
	mov	r0, fp
	bl	hwwrite
	ldr	r3, .L14
	lsl	r2, r5, #4
	ldr	r7, [r3]
	ldr	r3, [r4, #8]
	ldr	fp, [r6]
	ldr	r0, [r4, #16]
	add	r7, r2, r7
	orr	r9, r9, r3
.L4:
	orr	r9, r9, #-1073741824
	mov	r1, #0
	str	r9, [r4, #8]
	bl	snd_pcm_sgbuf_get_addr
	mov	r1, r7
	mov	r2, r0
	mov	r0, fp
	bl	hwwrite
	ldr	r3, .L14+4
	ldr	r2, [r4, #8]
	ldr	r1, [r3]
	ldr	r0, [r6]
	add	r1, r1, r5, lsl #3
	bl	hwwrite
	ldr	r3, .L14+8
	lsl	r1, r5, #3
	ldr	r3, [r3]
	ldr	r2, [r4, #12]
	add	r1, r1, r3
	ldr	r0, [r6]
	bl	hwwrite
	mov	r1, r5
	mov	r0, r6
	bl	vortex_wtdma_setfirstbuffer
	mov	r1, r5
	mov	r0, r6
	mov	r2, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	vortex_wtdma_setstartbuffer
.L3:
	mov	r2, r9
	mov	ip, #301989888
	lsl	r1, r8, #1
	b	.L6
.L15:
	.align	2
.L14:
	.word	VORTEX_WTDMA_BUFBASE
	.word	VORTEX_WTDMA_BUFCFG0
	.word	VORTEX_WTDMA_BUFCFG1
	.size	vortex_wtdma_setbuffers, .-vortex_wtdma_setbuffers
	.comm	VORTEX_WTDMA_BUFCFG1,4,4
	.comm	VORTEX_WTDMA_BUFCFG0,4,4
	.comm	VORTEX_WTDMA_BUFBASE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
