	.file	"extr_adau1977.c_adau1977_set_tdm_slot.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	adau1977_set_tdm_slot, @function
adau1977_set_tdm_slot:
.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
	mov	r14d, edx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, ecx
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	edi, DWORD PTR [rdi]
	mov	DWORD PTR 12[rsp], r8d
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	snd_soc_component_get_drvdata@PLT
	mov	QWORD PTR [rsp], rax
	test	ebx, ebx
	je	.L29
	test	r14d, r14d
	je	.L16
	test	r12d, r12d
	jne	.L16
	xor	ebp, ebp
	xor	r12d, r12d
	lea	r15, 16[rsp]
.L9:
	mov	edi, r14d
	call	__ffs@PLT
	mov	edi, ebp
	mov	DWORD PTR [r15+rbp*4], eax
	mov	r13d, eax
	call	ADAU1977_SAI_OVERTEMP_DRV_C@PLT
	mov	ecx, r13d
	or	r12d, eax
	mov	eax, 1
	sal	eax, cl
	not	eax
	and	r14d, eax
	cmp	r13d, ebx
	jnb	.L16
	test	r14d, r14d
	je	.L8
	add	rbp, 1
	cmp	rbp, 4
	jne	.L9
.L16:
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L27
	add	rsp, 56
	.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
.L8:
	.cfi_restore_state
	mov	eax, DWORD PTR 12[rsp]
	cmp	eax, 24
	je	.L19
	cmp	eax, 32
	je	.L20
	cmp	eax, 16
	jne	.L16
	mov	eax, DWORD PTR ADAU1977_SAI_CTRL1_SLOT_WIDTH_16[rip]
	mov	ebp, eax
.L11:
	cmp	ebx, 8
	je	.L12
	jg	.L13
	cmp	ebx, 2
	je	.L14
	cmp	ebx, 4
	jne	.L16
	mov	r15d, DWORD PTR ADAU1977_SAI_CTRL0_SAI_TDM_4[rip]
	.p2align 4,,10
	.p2align 3
.L18:
	xor	edi, edi
	call	ADAU1977_SAI_OVERTEMP_DRV_C@PLT
	mov	edi, 1
	mov	r14d, eax
	call	ADAU1977_SAI_OVERTEMP_DRV_C@PLT
	mov	edi, 2
	or	r14d, eax
	call	ADAU1977_SAI_OVERTEMP_DRV_C@PLT
	mov	edi, 3
	or	r14d, eax
	call	ADAU1977_SAI_OVERTEMP_DRV_C@PLT
	mov	edx, r14d
	mov	r14, QWORD PTR [rsp]
	mov	ecx, r12d
	mov	esi, DWORD PTR ADAU1977_REG_SAI_OVERTEMP[rip]
	or	edx, eax
	mov	edi, DWORD PTR 8[r14]
	call	regmap_update_bits@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	ecx, DWORD PTR ADAU1977_CHAN_MAP_SECOND_SLOT_OFFSET[rip]
	mov	edx, DWORD PTR 20[rsp]
	mov	eax, DWORD PTR 16[rsp]
	mov	edi, DWORD PTR 8[r14]
	sal	edx, cl
	mov	ecx, DWORD PTR ADAU1977_CHAN_MAP_FIRST_SLOT_OFFSET[rip]
	mov	esi, DWORD PTR ADAU1977_REG_CMAP12[rip]
	sal	eax, cl
	or	edx, eax
	call	regmap_write@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	ecx, DWORD PTR ADAU1977_CHAN_MAP_SECOND_SLOT_OFFSET[rip]
	mov	edx, DWORD PTR 28[rsp]
	mov	eax, DWORD PTR 24[rsp]
	mov	edi, DWORD PTR 8[r14]
	sal	edx, cl
	mov	ecx, DWORD PTR ADAU1977_CHAN_MAP_FIRST_SLOT_OFFSET[rip]
	mov	esi, DWORD PTR ADAU1977_REG_CMAP34[rip]
	sal	eax, cl
	or	edx, eax
	call	regmap_write@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	edi, DWORD PTR 8[r14]
	mov	edx, DWORD PTR ADAU1977_SAI_CTRL0_SAI_MASK[rip]
	mov	ecx, r15d
	mov	esi, DWORD PTR ADAU1977_REG_SAI_CTRL0[rip]
	call	regmap_update_bits@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	edi, DWORD PTR 8[r14]
	mov	edx, DWORD PTR ADAU1977_SAI_CTRL1_SLOT_WIDTH_MASK[rip]
	mov	ecx, ebp
	mov	esi, DWORD PTR ADAU1977_REG_SAI_CTRL1[rip]
	call	regmap_update_bits@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	esi, DWORD PTR 12[rsp]
	mov	eax, 24576000
	mov	edi, 192000
	cdq
	idiv	esi
	mov	DWORD PTR [r14], esi
	cdq
	idiv	ebx
	mov	esi, eax
	call	min@PLT
	mov	DWORD PTR 4[r14], eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L29:
	movabs	rsi, 824633720832000
	mov	QWORD PTR [rax], rsi
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L27
	mov	rax, QWORD PTR [rsp]
	mov	ecx, DWORD PTR ADAU1977_SAI_CTRL0_SAI_I2S[rip]
	mov	edx, DWORD PTR ADAU1977_SAI_CTRL0_SAI_MASK[rip]
	mov	esi, DWORD PTR ADAU1977_REG_SAI_CTRL0[rip]
	mov	edi, DWORD PTR 8[rax]
	add	rsp, 56
	.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
	jmp	regmap_update_bits@PLT
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	r15d, DWORD PTR ADAU1977_SAI_CTRL0_SAI_TDM_16[rip]
	cmp	ebx, 16
	je	.L18
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L20:
	mov	eax, DWORD PTR ADAU1977_SAI_CTRL1_SLOT_WIDTH_32[rip]
	mov	ebp, eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rax, QWORD PTR [rsp]
	mov	eax, DWORD PTR 12[rax]
	test	eax, eax
	jne	.L16
	mov	eax, DWORD PTR ADAU1977_SAI_CTRL1_SLOT_WIDTH_24[rip]
	mov	ebp, eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	mov	r15d, DWORD PTR ADAU1977_SAI_CTRL0_SAI_TDM_8[rip]
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L14:
	mov	r15d, DWORD PTR ADAU1977_SAI_CTRL0_SAI_TDM_2[rip]
	jmp	.L18
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	adau1977_set_tdm_slot, .-adau1977_set_tdm_slot
	.comm	EINVAL,4,4
	.comm	ADAU1977_SAI_CTRL1_SLOT_WIDTH_MASK,4,4
	.comm	ADAU1977_SAI_CTRL1_SLOT_WIDTH_32,4,4
	.comm	ADAU1977_SAI_CTRL1_SLOT_WIDTH_24,4,4
	.comm	ADAU1977_SAI_CTRL1_SLOT_WIDTH_16,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_TDM_8,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_TDM_4,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_TDM_2,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_TDM_16,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_MASK,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_I2S,4,4
	.comm	ADAU1977_REG_SAI_OVERTEMP,4,4
	.comm	ADAU1977_REG_SAI_CTRL1,4,4
	.comm	ADAU1977_REG_SAI_CTRL0,4,4
	.comm	ADAU1977_REG_CMAP34,4,4
	.comm	ADAU1977_REG_CMAP12,4,4
	.comm	ADAU1977_CHAN_MAP_SECOND_SLOT_OFFSET,4,4
	.comm	ADAU1977_CHAN_MAP_FIRST_SLOT_OFFSET,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_adau1977.c_adau1977_set_tdm_slot.c"
	.text
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	adau1977_set_tdm_slot, %function
adau1977_set_tdm_slot:
	@ args = 4, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r3
	ldr	r3, .L27
	sub	sp, sp, #36
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	ldr	r3, [sp, #72]
	ldr	r0, [r0]
	mov	r4, r1
	mov	r5, r2
	str	r3, [sp, #4]
	bl	snd_soc_component_get_drvdata
	cmp	r6, #0
	mov	r7, r0
	beq	.L26
	subs	r4, r4, #0
	movne	r4, #1
	cmp	r5, #0
	moveq	r4, #1
	cmp	r4, #0
	moveq	fp, #1
	moveq	r8, r4
	addeq	r10, sp, #12
	bne	.L11
.L8:
	mov	r0, r5
	bl	__ffs
	mov	r9, r0
	mov	r0, r4
	str	r9, [r10], #4
	bl	ADAU1977_SAI_OVERTEMP_DRV_C
	cmp	r9, r6
	bic	r5, r5, fp, lsl r9
	orr	r8, r8, r0
	bcs	.L11
	cmp	r5, #0
	beq	.L7
	add	r4, r4, #1
	cmp	r4, #4
	bne	.L8
.L11:
	ldr	r3, .L27+4
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L1:
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	mov	r0, r4
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r3, [sp, #4]
	cmp	r3, #24
	beq	.L18
	cmp	r3, #32
	beq	.L19
	cmp	r3, #16
	bne	.L11
	ldr	r2, .L27+8
	ldr	r5, [r2]
.L10:
	sub	r2, r6, #2
	cmp	r2, #14
	ldrls	pc, [pc, r2, asl #2]
	b	.L11
.L13:
	.word	.L16
	.word	.L11
	.word	.L15
	.word	.L11
	.word	.L11
	.word	.L11
	.word	.L14
	.word	.L11
	.word	.L11
	.word	.L11
	.word	.L11
	.word	.L11
	.word	.L11
	.word	.L11
	.word	.L12
.L26:
	ldr	r3, .L27+12
	str	r6, [r0]
	str	r3, [r0, #4]
	ldr	r3, .L27
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L24
	ldr	r3, .L27+16
	ldr	r2, .L27+20
	ldr	r1, .L27+24
	ldr	r0, [r0, #8]
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r1, [r1]
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	regmap_update_bits
.L19:
	ldr	r2, .L27+28
	ldr	r5, [r2]
	b	.L10
.L18:
	ldr	r2, [r7, #12]
	cmp	r2, #0
	bne	.L11
	ldr	r2, .L27+32
	ldr	r5, [r2]
	b	.L10
.L12:
	ldr	r2, .L27+36
	ldr	r9, [r2]
.L17:
	ldr	r2, .L27+40
	mov	r0, #0
	ldr	fp, [r2]
	ldr	r10, [r7, #8]
	bl	ADAU1977_SAI_OVERTEMP_DRV_C
	mov	r4, r0
	mov	r0, #1
	bl	ADAU1977_SAI_OVERTEMP_DRV_C
	mov	r2, r0
	mov	r0, #2
	orr	r4, r4, r2
	bl	ADAU1977_SAI_OVERTEMP_DRV_C
	mov	r2, r0
	mov	r0, #3
	orr	r4, r4, r2
	bl	ADAU1977_SAI_OVERTEMP_DRV_C
	mov	r3, r8
	orr	r2, r4, r0
	mov	r1, fp
	mov	r0, r10
	bl	regmap_update_bits
	subs	r4, r0, #0
	bne	.L1
	ldr	fp, .L27+44
	ldr	r3, [sp, #12]
	ldr	r1, [fp]
	ldr	r10, .L27+48
	ldr	r0, [sp, #16]
	lsl	r3, r3, r1
	ldr	r2, [r10]
	ldr	r1, .L27+52
	orr	r2, r3, r0, lsl r2
	ldr	r1, [r1]
	ldr	r0, [r7, #8]
	bl	regmap_write
	subs	r4, r0, #0
	bne	.L1
	ldr	r1, [fp]
	ldr	r3, [sp, #20]
	ldr	r0, [sp, #24]
	lsl	r3, r3, r1
	ldr	r2, [r10]
	ldr	r1, .L27+56
	orr	r2, r3, r0, lsl r2
	ldr	r1, [r1]
	ldr	r0, [r7, #8]
	bl	regmap_write
	subs	r4, r0, #0
	bne	.L1
	ldr	r2, .L27+20
	ldr	r1, .L27+24
	mov	r3, r9
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r0, [r7, #8]
	bl	regmap_update_bits
	subs	r4, r0, #0
	bne	.L1
	ldr	r2, .L27+60
	ldr	r1, .L27+64
	mov	r3, r5
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r0, [r7, #8]
	bl	regmap_update_bits
	subs	r4, r0, #0
	bne	.L1
	ldr	r3, [sp, #4]
	ldr	r0, .L27+68
	mov	r1, r3
	str	r3, [r7]
	bl	__aeabi_idiv
	mov	r1, r6
	bl	__aeabi_idiv
	mov	r1, r0
	ldr	r0, .L27+12
	bl	min
	str	r0, [r7, #4]
	b	.L1
.L14:
	ldr	r2, .L27+72
	ldr	r9, [r2]
	b	.L17
.L15:
	ldr	r2, .L27+76
	ldr	r9, [r2]
	b	.L17
.L16:
	ldr	r2, .L27+80
	ldr	r9, [r2]
	b	.L17
.L24:
	bl	__stack_chk_fail
.L28:
	.align	2
.L27:
	.word	.LC0
	.word	EINVAL
	.word	ADAU1977_SAI_CTRL1_SLOT_WIDTH_16
	.word	192000
	.word	ADAU1977_SAI_CTRL0_SAI_I2S
	.word	ADAU1977_SAI_CTRL0_SAI_MASK
	.word	ADAU1977_REG_SAI_CTRL0
	.word	ADAU1977_SAI_CTRL1_SLOT_WIDTH_32
	.word	ADAU1977_SAI_CTRL1_SLOT_WIDTH_24
	.word	ADAU1977_SAI_CTRL0_SAI_TDM_16
	.word	ADAU1977_REG_SAI_OVERTEMP
	.word	ADAU1977_CHAN_MAP_FIRST_SLOT_OFFSET
	.word	ADAU1977_CHAN_MAP_SECOND_SLOT_OFFSET
	.word	ADAU1977_REG_CMAP12
	.word	ADAU1977_REG_CMAP34
	.word	ADAU1977_SAI_CTRL1_SLOT_WIDTH_MASK
	.word	ADAU1977_REG_SAI_CTRL1
	.word	24576000
	.word	ADAU1977_SAI_CTRL0_SAI_TDM_8
	.word	ADAU1977_SAI_CTRL0_SAI_TDM_4
	.word	ADAU1977_SAI_CTRL0_SAI_TDM_2
	.size	adau1977_set_tdm_slot, .-adau1977_set_tdm_slot
	.comm	EINVAL,4,4
	.comm	ADAU1977_SAI_CTRL1_SLOT_WIDTH_MASK,4,4
	.comm	ADAU1977_SAI_CTRL1_SLOT_WIDTH_32,4,4
	.comm	ADAU1977_SAI_CTRL1_SLOT_WIDTH_24,4,4
	.comm	ADAU1977_SAI_CTRL1_SLOT_WIDTH_16,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_TDM_8,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_TDM_4,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_TDM_2,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_TDM_16,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_MASK,4,4
	.comm	ADAU1977_SAI_CTRL0_SAI_I2S,4,4
	.comm	ADAU1977_REG_SAI_OVERTEMP,4,4
	.comm	ADAU1977_REG_SAI_CTRL1,4,4
	.comm	ADAU1977_REG_SAI_CTRL0,4,4
	.comm	ADAU1977_REG_CMAP34,4,4
	.comm	ADAU1977_REG_CMAP12,4,4
	.comm	ADAU1977_CHAN_MAP_SECOND_SLOT_OFFSET,4,4
	.comm	ADAU1977_CHAN_MAP_FIRST_SLOT_OFFSET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
