	.file	"extr_hdac.c_hdac_stream_start.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	hdac_stream_start, @function
hdac_stream_start:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, edx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, r8
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, r9d
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, ecx
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	DWORD PTR 8[rsp], ecx
	mov	DWORD PTR 4[rsp], edx
	call	device_get_softc@PLT
	mov	edx, ebx
	mov	esi, r15d
	mov	rdi, rax
	mov	r12, rax
	call	hdac_find_stream@PLT
	movsx	rsi, ebx
	mov	edi, eax
	mov	ebx, eax
	mov	DWORD PTR [rsp], eax
	not	edi
	shr	edi, 31
	call	KASSERT@PLT
	movsx	rax, ebx
	mov	edx, DWORD PTR 80[rsp]
	lea	r13, [rax+rax*4]
	mov	rax, QWORD PTR [r12]
	sal	r13, 3
	add	rax, r13
	mov	rbx, QWORD PTR 32[rax]
	test	edx, edx
	jle	.L11
	mov	eax, DWORD PTR 80[rsp]
	lea	r15d, -1[rax]
	mov	DWORD PTR 12[rsp], r15d
	add	r15, 1
	sal	r15, 5
	add	r15, rbx
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, r14d
	add	rbx, 32
	call	htole32@PLT
	mov	ecx, 32
	mov	edi, r14d
	add	r14d, ebp
	mov	QWORD PTR -8[rbx], rax
	sar	edi, cl
	call	htole32@PLT
	mov	edi, ebp
	mov	QWORD PTR -16[rbx], rax
	call	htole32@PLT
	mov	edi, 1
	mov	QWORD PTR -24[rbx], rax
	call	htole32@PLT
	mov	QWORD PTR -32[rbx], rax
	cmp	r15, rbx
	jne	.L3
	mov	rax, QWORD PTR [r12]
	add	rax, r13
.L2:
	mov	esi, DWORD PTR 20[rax]
	mov	edi, DWORD PTR 24[rax]
	lea	r15, 8[r12]
	mov	edx, DWORD PTR BUS_DMASYNC_PREWRITE[rip]
	call	bus_dmamap_sync@PLT
	mov	ebx, DWORD PTR [rsp]
	mov	edx, DWORD PTR 80[rsp]
	mov	rdi, r15
	mov	rsi, QWORD PTR HDAC_SDCBL[rip]
	imul	edx, ebp
	sal	ebx, 5
	movsx	rbx, ebx
	add	rsi, rbx
	call	HDAC_WRITE_4@PLT
	mov	rsi, QWORD PTR HDAC_SDLVI[rip]
	mov	edx, DWORD PTR 12[rsp]
	mov	rdi, r15
	add	rsi, rbx
	call	HDAC_WRITE_2@PLT
	mov	rax, QWORD PTR [r12]
	mov	rsi, QWORD PTR HDAC_SDBDPL[rip]
	mov	rdi, r15
	mov	edx, DWORD PTR 16[rax+r13]
	add	rsi, rbx
	mov	DWORD PTR 12[rsp], edx
	call	HDAC_WRITE_4@PLT
	mov	edx, DWORD PTR 12[rsp]
	mov	ecx, 32
	mov	rdi, r15
	mov	rsi, QWORD PTR HDAC_SDBDPU[rip]
	sar	edx, cl
	add	rsi, rbx
	call	HDAC_WRITE_4@PLT
	mov	rsi, QWORD PTR HDAC_SDCTL2[rip]
	mov	rdi, r15
	add	rsi, rbx
	call	HDAC_READ_1@PLT
	mov	edx, eax
	mov	eax, DWORD PTR 4[rsp]
	test	eax, eax
	je	.L4
	or	edx, DWORD PTR HDAC_SDCTL2_DIR[rip]
.L5:
	mov	ecx, DWORD PTR HDAC_SDCTL2_STRM_MASK[rip]
	mov	eax, DWORD PTR 8[rsp]
	mov	rdi, r15
	mov	rsi, QWORD PTR HDAC_SDCTL2[rip]
	not	ecx
	and	edx, ecx
	mov	ecx, DWORD PTR HDAC_SDCTL2_STRM_SHIFT[rip]
	add	rsi, rbx
	sal	eax, cl
	mov	ecx, eax
	mov	rax, QWORD PTR [r12]
	or	ecx, edx
	mov	edx, DWORD PTR HDAC_SDCTL2_STRIPE_MASK[rip]
	mov	eax, DWORD PTR [rax+r13]
	not	edx
	and	edx, ecx
	mov	ecx, DWORD PTR HDAC_SDCTL2_STRIPE_SHIFT[rip]
	sal	eax, cl
	or	edx, eax
	call	HDAC_WRITE_1@PLT
	mov	rax, QWORD PTR [r12]
	mov	rsi, QWORD PTR HDAC_SDFMT[rip]
	mov	rdi, r15
	mov	edx, DWORD PTR 4[rax+r13]
	add	rsi, rbx
	call	HDAC_WRITE_2@PLT
	mov	rsi, QWORD PTR HDAC_INTCTL[rip]
	mov	rdi, r15
	call	HDAC_READ_4@PLT
	movzx	ecx, BYTE PTR [rsp]
	mov	rsi, QWORD PTR HDAC_INTCTL[rip]
	mov	rdi, r15
	bts	eax, ecx
	mov	edx, eax
	call	HDAC_WRITE_4@PLT
	mov	rsi, QWORD PTR HDAC_SDSTS[rip]
	mov	rdi, r15
	mov	edx, DWORD PTR HDAC_SDSTS_DESE[rip]
	or	edx, DWORD PTR HDAC_SDSTS_FIFOE[rip]
	or	edx, DWORD PTR HDAC_SDSTS_BCIS[rip]
	add	rsi, rbx
	call	HDAC_WRITE_1@PLT
	mov	rsi, QWORD PTR HDAC_SDCTL0[rip]
	mov	rdi, r15
	add	rsi, rbx
	call	HDAC_READ_1@PLT
	mov	rsi, QWORD PTR HDAC_SDCTL0[rip]
	mov	edx, DWORD PTR HDAC_SDCTL_IOCE[rip]
	mov	rdi, r15
	or	edx, DWORD PTR HDAC_SDCTL_FEIE[rip]
	or	edx, DWORD PTR HDAC_SDCTL_DEIE[rip]
	or	edx, DWORD PTR HDAC_SDCTL_RUN[rip]
	add	rsi, rbx
	or	edx, eax
	call	HDAC_WRITE_1@PLT
	add	r13, QWORD PTR [r12]
	mov	rdi, r12
	mov	DWORD PTR 8[r13], ebp
	mov	DWORD PTR 12[r13], 1
	call	hdac_poll_reinit@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	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
.L4:
	.cfi_restore_state
	mov	ecx, DWORD PTR HDAC_SDCTL2_DIR[rip]
	not	ecx
	and	edx, ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L11:
	mov	ecx, DWORD PTR 80[rsp]
	sub	ecx, 1
	mov	DWORD PTR 12[rsp], ecx
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	hdac_stream_start, .-hdac_stream_start
	.comm	HDAC_SDSTS_FIFOE,4,4
	.comm	HDAC_SDSTS_DESE,4,4
	.comm	HDAC_SDSTS_BCIS,4,4
	.comm	HDAC_SDSTS,8,8
	.comm	HDAC_SDLVI,8,8
	.comm	HDAC_SDFMT,8,8
	.comm	HDAC_SDCTL_RUN,4,4
	.comm	HDAC_SDCTL_IOCE,4,4
	.comm	HDAC_SDCTL_FEIE,4,4
	.comm	HDAC_SDCTL_DEIE,4,4
	.comm	HDAC_SDCTL2_STRM_SHIFT,4,4
	.comm	HDAC_SDCTL2_STRM_MASK,4,4
	.comm	HDAC_SDCTL2_STRIPE_SHIFT,4,4
	.comm	HDAC_SDCTL2_STRIPE_MASK,4,4
	.comm	HDAC_SDCTL2_DIR,4,4
	.comm	HDAC_SDCTL2,8,8
	.comm	HDAC_SDCTL0,8,8
	.comm	HDAC_SDCBL,8,8
	.comm	HDAC_SDBDPU,8,8
	.comm	HDAC_SDBDPL,8,8
	.comm	HDAC_INTCTL,8,8
	.comm	BUS_DMASYNC_PREWRITE,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_hdac.c_hdac_stream_start.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	hdac_stream_start, %function
hdac_stream_start:
	@ args = 12, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r3
	sub	sp, sp, #20
	mov	r6, r2
	str	r3, [sp, #12]
	ldr	r7, [sp, #64]
	str	r2, [sp, #8]
	ldr	r10, [sp, #56]
	ldr	r5, [sp, #60]
	bl	device_get_softc
	mov	r2, r4
	mov	r1, r6
	mov	r8, r0
	bl	hdac_find_stream
	mov	r1, r4
	str	r0, [sp, #4]
	mov	r4, r0
	mvn	r0, r0
	lsr	r0, r0, #31
	bl	KASSERT
	mov	r3, r4
	ldr	r0, [r8]
	cmp	r7, #0
	add	r0, r0, r4, lsl #5
	ldr	r4, [r0, #28]
	lsl	r6, r3, #5
	ble	.L2
	mov	fp, #0
	mov	r9, #32
.L3:
	mov	r0, r10
	bl	htole32
	mov	r1, r0
	asr	r0, r10, r9
	str	r1, [r4, #12]
	bl	htole32
	mov	r1, r0
	mov	r0, r5
	str	r1, [r4, #8]
	bl	htole32
	mov	r1, r0
	mov	r0, #1
	str	r1, [r4, #4]
	bl	htole32
	add	fp, fp, #1
	cmp	r7, fp
	add	r10, r10, r5
	str	r0, [r4], #16
	bne	.L3
	ldr	r0, [r8]
	add	r0, r0, r6
.L2:
	ldr	r3, .L9
	ldr	r1, [r0, #20]
	ldr	r2, [r3]
	ldr	r0, [r0, #24]
	bl	bus_dmamap_sync
	ldr	r3, .L9+4
	add	r4, r8, #4
	ldr	r1, [r3]
	mul	r2, r5, r7
	add	r1, r6, r1
	mov	r0, r4
	bl	HDAC_WRITE_4
	ldr	r3, .L9+8
	sub	r2, r7, #1
	ldr	r1, [r3]
	mov	r0, r4
	add	r1, r6, r1
	bl	HDAC_WRITE_2
	ldr	r3, [r8]
	ldr	r2, .L9+12
	add	r3, r3, r6
	ldr	r9, [r3, #16]
	ldr	r1, [r2]
	mov	r0, r4
	mov	r2, r9
	add	r1, r6, r1
	bl	HDAC_WRITE_4
	mov	r2, #32
	ldr	r3, .L9+16
	ldr	r7, .L9+20
	ldr	r1, [r3]
	asr	r2, r9, r2
	add	r1, r6, r1
	mov	r0, r4
	bl	HDAC_WRITE_4
	ldr	r1, [r7]
	mov	r0, r4
	add	r1, r6, r1
	bl	HDAC_READ_1
	ldr	r3, [sp, #8]
	ldr	r1, .L9+24
	cmp	r3, #0
	ldr	r3, .L9+28
	ldr	r1, [r1]
	ldr	r2, [r3]
	ldr	r3, .L9+32
	orrne	r2, r0, r2
	biceq	r2, r0, r2
	ldr	ip, [sp, #12]
	ldr	r3, [r3]
	bic	r2, r2, r1
	ldr	r0, .L9+36
	orr	fp, r2, ip, lsl r3
	ldr	r10, [sp, #4]
	ldr	r2, [r8]
	ldr	r3, .L9+40
	ldr	r0, [r0]
	ldr	r1, [r7]
	ldr	r2, [r2, r10, lsl #5]
	ldr	r3, [r3]
	bic	fp, fp, r0
	orr	r2, fp, r2, lsl r3
	add	r1, r6, r1
	mov	r0, r4
	bl	HDAC_WRITE_1
	ldr	r2, .L9+44
	ldr	r3, [r8]
	ldr	r1, [r2]
	add	r3, r3, r6
	ldr	r9, .L9+48
	ldr	r2, [r3, #4]
	add	r1, r6, r1
	mov	r0, r4
	bl	HDAC_WRITE_2
	ldr	r1, [r9]
	mov	r0, r4
	bl	HDAC_READ_4
	mov	r7, #1
	ldr	r1, [r9]
	orr	r2, r0, r7, lsl r10
	mov	r0, r4
	bl	HDAC_WRITE_4
	ldr	r3, .L9+52
	ldr	r0, .L9+56
	ldr	r2, .L9+60
	ldr	r1, .L9+64
	ldr	r0, [r0]
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	orr	r3, r3, r0
	ldr	r9, .L9+68
	orr	r2, r3, r2
	add	r1, r6, r1
	mov	r0, r4
	bl	HDAC_WRITE_1
	ldr	r1, [r9]
	mov	r0, r4
	add	r1, r6, r1
	bl	HDAC_READ_1
	mov	r2, r0
	ldr	r3, .L9+72
	ldr	r0, .L9+76
	ldr	r1, .L9+80
	ldr	ip, [r0]
	ldr	r1, [r1]
	ldr	r3, [r3]
	ldr	r0, .L9+84
	orr	r3, r3, r1
	ldr	r0, [r0]
	orr	r3, r3, ip
	ldr	r1, [r9]
	orr	r3, r3, r0
	add	r1, r6, r1
	orr	r2, r3, r2
	mov	r0, r4
	bl	HDAC_WRITE_1
	ldr	r3, [r8]
	mov	r0, r8
	add	r6, r3, r6
	str	r7, [r6, #12]
	str	r5, [r6, #8]
	bl	hdac_poll_reinit
	mov	r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L10:
	.align	2
.L9:
	.word	BUS_DMASYNC_PREWRITE
	.word	HDAC_SDCBL
	.word	HDAC_SDLVI
	.word	HDAC_SDBDPL
	.word	HDAC_SDBDPU
	.word	HDAC_SDCTL2
	.word	HDAC_SDCTL2_STRM_MASK
	.word	HDAC_SDCTL2_DIR
	.word	HDAC_SDCTL2_STRM_SHIFT
	.word	HDAC_SDCTL2_STRIPE_MASK
	.word	HDAC_SDCTL2_STRIPE_SHIFT
	.word	HDAC_SDFMT
	.word	HDAC_INTCTL
	.word	HDAC_SDSTS_DESE
	.word	HDAC_SDSTS_FIFOE
	.word	HDAC_SDSTS_BCIS
	.word	HDAC_SDSTS
	.word	HDAC_SDCTL0
	.word	HDAC_SDCTL_IOCE
	.word	HDAC_SDCTL_DEIE
	.word	HDAC_SDCTL_FEIE
	.word	HDAC_SDCTL_RUN
	.size	hdac_stream_start, .-hdac_stream_start
	.comm	HDAC_SDSTS_FIFOE,4,4
	.comm	HDAC_SDSTS_DESE,4,4
	.comm	HDAC_SDSTS_BCIS,4,4
	.comm	HDAC_SDSTS,4,4
	.comm	HDAC_SDLVI,4,4
	.comm	HDAC_SDFMT,4,4
	.comm	HDAC_SDCTL_RUN,4,4
	.comm	HDAC_SDCTL_IOCE,4,4
	.comm	HDAC_SDCTL_FEIE,4,4
	.comm	HDAC_SDCTL_DEIE,4,4
	.comm	HDAC_SDCTL2_STRM_SHIFT,4,4
	.comm	HDAC_SDCTL2_STRM_MASK,4,4
	.comm	HDAC_SDCTL2_STRIPE_SHIFT,4,4
	.comm	HDAC_SDCTL2_STRIPE_MASK,4,4
	.comm	HDAC_SDCTL2_DIR,4,4
	.comm	HDAC_SDCTL2,4,4
	.comm	HDAC_SDCTL0,4,4
	.comm	HDAC_SDCBL,4,4
	.comm	HDAC_SDBDPU,4,4
	.comm	HDAC_SDBDPL,4,4
	.comm	HDAC_INTCTL,4,4
	.comm	BUS_DMASYNC_PREWRITE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
