	.file	"extr_via82xx.c_build_via_table.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"too much table size!\n"
	.text
	.p2align 4
	.type	build_via_table, @function
build_via_table:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	mov	rdi, rsi
	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, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 24[rsp], rdx
	mov	DWORD PTR 16[rsp], ecx
	mov	DWORD PTR 20[rsp], r8d
	call	snd_pcm_substream_chip@PLT
	cmp	QWORD PTR 24[r15], 0
	je	.L20
.L2:
	cmp	QWORD PTR 16[r15], 0
	je	.L4
.L7:
	mov	eax, DWORD PTR 16[rsp]
	mov	DWORD PTR 8[rsp], 0
	xor	r14d, r14d
	xor	ebx, ebx
	lea	ecx, -1[rax]
	mov	DWORD PTR 12[rsp], ecx
	test	eax, eax
	je	.L21
.L5:
	mov	ebp, DWORD PTR 20[rsp]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rax, QWORD PTR 24[r15]
	lea	esi, 1[r8]
	lea	rsi, [rax+rsi*4]
	mov	QWORD PTR [rsp], rsi
	call	cpu_to_le32@PLT
	mov	rsi, QWORD PTR [rsp]
	mov	DWORD PTR [rsi], eax
	mov	rax, QWORD PTR 16[r15]
	mov	esi, ebx
	add	ebx, 1
	lea	rax, [rax+rsi*8]
	mov	DWORD PTR [rax], r14d
	add	r14d, r13d
	mov	DWORD PTR 4[rax], r13d
	test	ebp, ebp
	je	.L22
.L11:
	cmp	DWORD PTR VIA_TABLE_SIZE[rip], ebx
	jbe	.L23
	mov	esi, r14d
	mov	rdi, r12
	call	snd_pcm_sgbuf_get_addr@PLT
	lea	edx, [rbx+rbx]
	mov	edi, eax
	mov	rax, QWORD PTR 24[r15]
	mov	DWORD PTR [rsp], edx
	lea	r13, [rax+rdx*4]
	call	cpu_to_le32@PLT
	mov	edx, ebp
	mov	rdi, r12
	mov	esi, r14d
	mov	DWORD PTR 0[r13], eax
	call	snd_pcm_sgbuf_get_chunk_size@PLT
	mov	r8d, DWORD PTR [rsp]
	sub	ebp, eax
	mov	r13d, eax
	mov	edi, eax
	jne	.L9
	mov	ecx, DWORD PTR 8[rsp]
	or	edi, DWORD PTR VIA_TBL_BIT_FLAG[rip]
	cmp	DWORD PTR 12[rsp], ecx
	jne	.L9
	mov	edi, DWORD PTR VIA_TBL_BIT_EOL[rip]
	or	edi, eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L23:
	mov	rdi, QWORD PTR 24[rsp]
	lea	rsi, .LC0[rip]
	call	dev_err@PLT
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L22:
	.cfi_restore_state
	add	DWORD PTR 8[rsp], 1
	mov	eax, DWORD PTR 8[rsp]
	cmp	DWORD PTR 16[rsp], eax
	jne	.L5
.L6:
	mov	ecx, DWORD PTR 20[rsp]
	mov	eax, DWORD PTR 16[rsp]
	mov	DWORD PTR [r15], ebx
	imul	eax, ecx
	mov	DWORD PTR 12[r15], ecx
	mov	DWORD PTR 4[r15], eax
	shr	eax
	mov	DWORD PTR 8[r15], eax
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	edi, DWORD PTR VIA_TABLE_SIZE[rip]
	mov	rbx, rax
	sal	edi, 4
	call	PAGE_ALIGN@PLT
	mov	edi, DWORD PTR [rbx]
	mov	r13d, eax
	call	snd_dma_pci_data@PLT
	mov	edi, DWORD PTR SNDRV_DMA_TYPE_DEV[rip]
	lea	rcx, 24[r15]
	mov	edx, r13d
	mov	esi, eax
	call	snd_dma_alloc_pages@PLT
	test	rax, rax
	jns	.L2
.L18:
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	edi, DWORD PTR VIA_TABLE_SIZE[rip]
	mov	esi, 8
	call	kmalloc_array@PLT
	mov	QWORD PTR 16[r15], rax
	test	rax, rax
	jne	.L7
	jmp	.L18
.L21:
	mov	ebx, eax
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	build_via_table, .-build_via_table
	.comm	VIA_TBL_BIT_FLAG,4,4
	.comm	VIA_TBL_BIT_EOL,4,4
	.comm	VIA_TABLE_SIZE,4,4
	.comm	SNDRV_DMA_TYPE_DEV,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,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_via82xx.c_build_via_table.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"too much table size!\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	build_via_table, %function
build_via_table:
	@ args = 4, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r8, r0
	sub	sp, sp, #28
	mov	r0, r1
	str	r3, [sp, #16]
	mov	r9, r1
	str	r2, [sp, #20]
	bl	snd_pcm_substream_chip
	ldr	r3, [r8, #20]
	cmp	r3, #0
	beq	.L18
.L2:
	ldr	r3, [r8, #16]
	cmp	r3, #0
	beq	.L4
.L7:
	ldr	r3, [sp, #16]
	cmp	r3, #0
	moveq	r6, r3
	beq	.L6
	mov	r5, #0
	ldr	r3, [sp, #16]
	mov	r6, r5
	sub	r3, r3, #1
	ldr	r10, .L20
	str	r5, [sp, #8]
	str	r3, [sp, #12]
	b	.L5
.L19:
	ldr	r3, [sp, #12]
	ldr	r1, [sp, #8]
	ldr	r7, [r8, #20]
	cmp	r3, r1
	ldreq	r3, .L20+4
	ldrne	r3, .L20+8
	ldr	r0, [r3]
	str	r2, [sp]
	orr	r0, r4, r0
	bl	cpu_to_le32
	ldr	r3, [sp, #8]
	ldr	r2, [sp, #16]
	add	r3, r3, #1
	ldr	r1, [r8, #16]
	cmp	r2, r3
	ldr	r2, [sp]
	str	r3, [sp, #8]
	str	r0, [r7, r2]
	add	r2, r1, fp
	str	r5, [r1, fp]
	str	r4, [r2, #4]
	add	r5, r5, r4
	beq	.L6
.L5:
	ldr	r3, [r10]
	cmp	r6, r3
	bcs	.L11
	ldr	r7, [sp, #64]
.L12:
	mov	r1, r5
	mov	r0, r9
	bl	snd_pcm_sgbuf_get_addr
	ldr	r4, [r8, #20]
	bl	cpu_to_le32
	mov	r2, r7
	str	r0, [r4, r6, lsl #3]
	mov	r1, r5
	mov	r0, r9
	bl	snd_pcm_sgbuf_get_chunk_size
	lsl	fp, r6, #3
	subs	r7, r7, r0
	mov	r4, r0
	add	r6, r6, #1
	add	r2, fp, #4
	beq	.L19
	ldr	r3, [r8, #20]
	str	r2, [sp, #4]
	str	r3, [sp]
	bl	cpu_to_le32
	ldr	r3, [sp]
	ldr	r2, [sp, #4]
	str	r0, [r3, r2]
	ldr	r2, [r10]
	ldr	r3, [r8, #16]
	cmp	r2, r6
	add	r2, r3, fp
	str	r5, [r3, fp]
	str	r4, [r2, #4]
	add	r5, r5, r4
	bhi	.L12
.L11:
	ldr	r0, [sp, #20]
	ldr	r1, .L20+12
	bl	dev_err
	ldr	r3, .L20+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	ldr	r3, .L20+20
	ldr	r0, [r0]
	ldr	r5, [r3]
	bl	snd_dma_pci_data
	ldr	r10, .L20
	mov	r4, r0
	ldr	r0, [r10]
	lsl	r0, r0, #4
	bl	PAGE_ALIGN
	mov	r1, r4
	mov	r2, r0
	add	r3, r8, #20
	mov	r0, r5
	bl	snd_dma_alloc_pages
	cmp	r0, #0
	bge	.L2
.L16:
	ldr	r3, .L20+24
	ldr	r0, [r3]
	rsb	r0, r0, #0
	b	.L1
.L4:
	ldr	r3, .L20+28
	ldr	r10, .L20
	mov	r1, #8
	ldr	r2, [r3]
	ldr	r0, [r10]
	bl	kmalloc_array
	cmp	r0, #0
	str	r0, [r8, #16]
	bne	.L7
	b	.L16
.L6:
	ldr	r2, [sp, #64]
	ldr	r3, [sp, #16]
	mov	r0, #0
	mul	r3, r2, r3
	lsr	r2, r3, #1
	str	r3, [r8, #4]
	ldr	r3, [sp, #64]
	str	r2, [r8, #8]
	str	r6, [r8]
	str	r3, [r8, #12]
	b	.L1
.L21:
	.align	2
.L20:
	.word	VIA_TABLE_SIZE
	.word	VIA_TBL_BIT_EOL
	.word	VIA_TBL_BIT_FLAG
	.word	.LC0
	.word	EINVAL
	.word	SNDRV_DMA_TYPE_DEV
	.word	ENOMEM
	.word	GFP_KERNEL
	.size	build_via_table, .-build_via_table
	.comm	VIA_TBL_BIT_FLAG,4,4
	.comm	VIA_TBL_BIT_EOL,4,4
	.comm	VIA_TABLE_SIZE,4,4
	.comm	SNDRV_DMA_TYPE_DEV,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
