	.file	"extr_ams-delta.c_ams_delta_get_audio_mode.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Mouthpiece"
.LC1:
	.string	"Earpiece"
.LC2:
	.string	"Microphone"
.LC3:
	.string	"Speaker"
	.text
	.p2align 4
	.type	ams_delta_get_audio_mode, @function
ams_delta_get_audio_mode:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	snd_kcontrol_chip@PLT
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	r13, rax
	call	snd_soc_dapm_get_pin_status@PLT
	movzx	ecx, WORD PTR AMS_DELTA_MOUTHPIECE[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, r13
	movzx	ebp, ax
	sal	ebp, cl
	call	snd_soc_dapm_get_pin_status@PLT
	movzx	ecx, WORD PTR AMS_DELTA_EARPIECE[rip]
	lea	rsi, .LC2[rip]
	mov	rdi, r13
	movzx	eax, ax
	sal	eax, cl
	or	bp, ax
	je	.L2
	call	snd_soc_dapm_get_pin_status@PLT
	movzx	ecx, WORD PTR AMS_DELTA_MICROPHONE[rip]
	movzx	eax, ax
	sal	eax, cl
	or	ebp, eax
.L3:
	xor	ebx, ebx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdx, QWORD PTR ams_delta_audio_mode_pins[rip]
	movzx	eax, bx
	cmp	WORD PTR [rdx+rax*2], bp
	je	.L9
	add	ebx, 1
.L4:
	mov	edi, DWORD PTR ams_delta_audio_mode[rip]
	call	ARRAY_SIZE@PLT
	cmp	ax, bx
	ja	.L8
.L9:
	mov	edi, DWORD PTR ams_delta_audio_mode[rip]
	call	ARRAY_SIZE@PLT
	cmp	ax, bx
	jbe	.L14
	mov	rax, QWORD PTR [r12]
	mov	WORD PTR [rax], bx
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	call	snd_soc_dapm_get_pin_status@PLT
	movzx	ecx, WORD PTR AMS_DELTA_MICROPHONE[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, r13
	movzx	ebp, ax
	sal	ebp, cl
	call	snd_soc_dapm_get_pin_status@PLT
	movzx	ecx, WORD PTR AMS_DELTA_SPEAKER[rip]
	movzx	edx, WORD PTR ams_delta_audio_agc[rip]
	movzx	eax, ax
	sal	eax, cl
	movzx	ecx, WORD PTR AMS_DELTA_AGC[rip]
	or	ebp, eax
	sal	edx, cl
	or	ebp, edx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ams_delta_get_audio_mode, .-ams_delta_get_audio_mode
	.comm	ams_delta_audio_mode_pins,8,8
	.comm	ams_delta_audio_mode,4,4
	.comm	ams_delta_audio_agc,2,2
	.comm	EINVAL,4,4
	.comm	AMS_DELTA_SPEAKER,2,2
	.comm	AMS_DELTA_MOUTHPIECE,2,2
	.comm	AMS_DELTA_MICROPHONE,2,2
	.comm	AMS_DELTA_EARPIECE,2,2
	.comm	AMS_DELTA_AGC,2,2
	.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_ams-delta.c_ams_delta_get_audio_mode.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Mouthpiece\000"
	.align	2
.LC1:
	.ascii	"Earpiece\000"
	.align	2
.LC2:
	.ascii	"Microphone\000"
	.align	2
.LC3:
	.ascii	"Speaker\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ams_delta_get_audio_mode, %function
ams_delta_get_audio_mode:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r10, r1
	bl	snd_kcontrol_chip
	ldr	r1, .L15
	mov	r5, r0
	bl	snd_soc_dapm_get_pin_status
	mov	r6, r0
	ldr	r3, .L15+4
	mov	r0, r5
	ldrh	r3, [r3]
	ldr	r1, .L15+8
	lsl	r6, r6, r3
	bl	snd_soc_dapm_get_pin_status
	ldr	r3, .L15+12
	lsl	r6, r6, #16
	ldrh	r3, [r3]
	asr	r6, r6, #16
	orr	r6, r6, r0, lsl r3
	lsl	r6, r6, #16
	asr	r6, r6, #16
	cmp	r6, #0
	beq	.L2
	mov	r0, r5
	ldr	r1, .L15+16
	bl	snd_soc_dapm_get_pin_status
	ldr	r3, .L15+20
	ldrh	r3, [r3]
	orr	r6, r6, r0, lsl r3
	lsl	r6, r6, #16
	lsr	r6, r6, #16
.L3:
	mov	r5, #0
	ldr	r7, .L15+24
	ldr	r8, .L15+28
	ldr	r9, .L15+32
	b	.L4
.L7:
	ldr	r2, [r9]
	add	r5, r5, #1
	ldrh	r3, [r2, r3]
	cmp	r3, r6
	beq	.L8
.L4:
	ldr	r0, [r7]
	bl	ARRAY_SIZE
	lsl	r4, r5, #16
	lsr	r4, r4, #16
	and	r3, r5, r8
	cmp	r0, r4
	lsl	r3, r3, #1
	bhi	.L7
.L8:
	ldr	r0, [r7]
	bl	ARRAY_SIZE
	cmp	r0, r4
	bls	.L14
	ldr	r3, [r10]
	mov	r0, #0
	strh	r4, [r3]	@ movhi
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r1, .L15+16
	mov	r0, r5
	bl	snd_soc_dapm_get_pin_status
	mov	r4, r0
	ldr	r3, .L15+20
	ldr	r1, .L15+36
	ldrh	r3, [r3]
	mov	r0, r5
	lsl	r4, r4, r3
	bl	snd_soc_dapm_get_pin_status
	ldr	r2, .L15+40
	ldr	r3, .L15+44
	ldr	r1, .L15+48
	ldrh	r2, [r2]
	lsl	r4, r4, #16
	ldrh	r3, [r3]
	ldrh	r6, [r1]
	asr	r4, r4, #16
	orr	r4, r4, r0, lsl r2
	orr	r6, r4, r3, lsl r6
	lsl	r6, r6, #16
	lsr	r6, r6, #16
	b	.L3
.L14:
	ldr	r3, .L15+52
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L16:
	.align	2
.L15:
	.word	.LC0
	.word	AMS_DELTA_MOUTHPIECE
	.word	.LC1
	.word	AMS_DELTA_EARPIECE
	.word	.LC2
	.word	AMS_DELTA_MICROPHONE
	.word	ams_delta_audio_mode
	.word	65535
	.word	ams_delta_audio_mode_pins
	.word	.LC3
	.word	AMS_DELTA_SPEAKER
	.word	ams_delta_audio_agc
	.word	AMS_DELTA_AGC
	.word	EINVAL
	.size	ams_delta_get_audio_mode, .-ams_delta_get_audio_mode
	.comm	ams_delta_audio_mode_pins,4,4
	.comm	ams_delta_audio_mode,4,4
	.comm	ams_delta_audio_agc,2,2
	.comm	EINVAL,4,4
	.comm	AMS_DELTA_SPEAKER,2,2
	.comm	AMS_DELTA_MOUTHPIECE,2,2
	.comm	AMS_DELTA_MICROPHONE,2,2
	.comm	AMS_DELTA_EARPIECE,2,2
	.comm	AMS_DELTA_AGC,2,2
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
