	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ams_delta_get_audio_mode
_ams_delta_get_audio_mode:              ## @ams_delta_get_audio_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_snd_kcontrol_chip
	movq	%rax, %r15
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_snd_soc_dapm_get_pin_status
	movzwl	%ax, %r12d
	movq	_AMS_DELTA_MOUTHPIECE@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_snd_soc_dapm_get_pin_status
	movzwl	%ax, %ebx
	movq	_AMS_DELTA_EARPIECE@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	orl	%r12d, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_snd_soc_dapm_get_pin_status
	movzwl	%ax, %r12d
	movq	_AMS_DELTA_MICROPHONE@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	testw	%bx, %bx
	je	LBB0_2
## %bb.1:
	movzwl	%bx, %eax
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_snd_soc_dapm_get_pin_status
	movzwl	%ax, %eax
	movq	_AMS_DELTA_SPEAKER@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%r12d, %eax
	movq	_ams_delta_audio_agc@GOTPCREL(%rip), %rcx
	movzwl	(%rcx), %r12d
	movq	_AMS_DELTA_AGC@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r12d
LBB0_3:
	orl	%eax, %r12d
	movq	_ams_delta_audio_mode@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_ARRAY_SIZE
	xorl	%ebx, %ebx
	testw	%ax, %ax
	je	LBB0_7
## %bb.4:
	movq	_ams_delta_audio_mode_pins@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	cmpw	%r12w, (%rax,%rbx,2)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	movl	(%r15), %edi
	callq	_ARRAY_SIZE
	movzwl	%ax, %eax
	cmpq	%rax, %rbx
	jb	LBB0_5
LBB0_7:
	movl	(%r15), %edi
	callq	_ARRAY_SIZE
	cmpw	%ax, %bx
	jae	LBB0_8
## %bb.9:
	movq	(%r14), %rax
	movw	%bx, (%rax)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Mouthpiece"

	.comm	_AMS_DELTA_MOUTHPIECE,2,1       ## @AMS_DELTA_MOUTHPIECE
L_.str.1:                               ## @.str.1
	.asciz	"Earpiece"

	.comm	_AMS_DELTA_EARPIECE,2,1         ## @AMS_DELTA_EARPIECE
L_.str.2:                               ## @.str.2
	.asciz	"Microphone"

	.comm	_AMS_DELTA_MICROPHONE,2,1       ## @AMS_DELTA_MICROPHONE
L_.str.3:                               ## @.str.3
	.asciz	"Speaker"

	.comm	_AMS_DELTA_SPEAKER,2,1          ## @AMS_DELTA_SPEAKER
	.comm	_ams_delta_audio_agc,2,1        ## @ams_delta_audio_agc
	.comm	_AMS_DELTA_AGC,2,1              ## @AMS_DELTA_AGC
	.comm	_ams_delta_audio_mode,4,2       ## @ams_delta_audio_mode
	.comm	_ams_delta_audio_mode_pins,8,3  ## @ams_delta_audio_mode_pins
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_ams_delta_get_audio_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ams_delta_get_audio_mode
_ams_delta_get_audio_mode:              ; @ams_delta_get_audio_mode
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	bl	_snd_kcontrol_chip
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_snd_soc_dapm_get_pin_status
Lloh2:
	adrp	x8, _AMS_DELTA_MOUTHPIECE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AMS_DELTA_MOUTHPIECE@GOTPAGEOFF]
	ldrh	w8, [x8]
	lsl	w21, w0, w8
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_snd_soc_dapm_get_pin_status
Lloh6:
	adrp	x8, _AMS_DELTA_EARPIECE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AMS_DELTA_EARPIECE@GOTPAGEOFF]
	ldrh	w8, [x8]
	lsl	w8, w0, w8
	orr	w8, w8, w21
	and	w22, w8, #0xffff
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_snd_soc_dapm_get_pin_status
Lloh10:
	adrp	x8, _AMS_DELTA_MICROPHONE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AMS_DELTA_MICROPHONE@GOTPAGEOFF]
	ldrh	w8, [x8]
	lsl	w21, w0, w8
	cbz	w22, LBB0_2
; %bb.1:
	orr	w21, w21, w22
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_snd_soc_dapm_get_pin_status
Lloh14:
	adrp	x8, _AMS_DELTA_SPEAKER@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AMS_DELTA_SPEAKER@GOTPAGEOFF]
	ldrh	w8, [x8]
	lsl	w8, w0, w8
	orr	w8, w8, w21
Lloh16:
	adrp	x9, _ams_delta_audio_agc@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ams_delta_audio_agc@GOTPAGEOFF]
	ldrh	w9, [x9]
Lloh18:
	adrp	x10, _AMS_DELTA_AGC@GOTPAGE
Lloh19:
	ldr	x10, [x10, _AMS_DELTA_AGC@GOTPAGEOFF]
	ldrh	w10, [x10]
	lsl	w9, w9, w10
	orr	w21, w8, w9
LBB0_3:
Lloh20:
	adrp	x20, _ams_delta_audio_mode@GOTPAGE
Lloh21:
	ldr	x20, [x20, _ams_delta_audio_mode@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_8
; %bb.4:
	mov	x22, #0
Lloh22:
	adrp	x23, _ams_delta_audio_mode_pins@GOTPAGE
Lloh23:
	ldr	x23, [x23, _ams_delta_audio_mode_pins@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	ldrh	w8, [x8, x22, lsl #1]
	cmp	w8, w21, uxth
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	ldr	w0, [x20]
	bl	_ARRAY_SIZE
	cmp	x22, w0, uxtw
	b.lo	LBB0_5
LBB0_7:
	and	w21, w22, #0xffff
	b	LBB0_9
LBB0_8:
	mov	w21, #0
LBB0_9:
	ldr	w0, [x20]
	bl	_ARRAY_SIZE
	cmp	w21, w0
	b.hs	LBB0_11
; %bb.10:
	mov	w0, #0
	ldr	x8, [x19]
	strh	w21, [x8]
	b	LBB0_12
LBB0_11:
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Mouthpiece"

	.comm	_AMS_DELTA_MOUTHPIECE,2,1       ; @AMS_DELTA_MOUTHPIECE
l_.str.1:                               ; @.str.1
	.asciz	"Earpiece"

	.comm	_AMS_DELTA_EARPIECE,2,1         ; @AMS_DELTA_EARPIECE
l_.str.2:                               ; @.str.2
	.asciz	"Microphone"

	.comm	_AMS_DELTA_MICROPHONE,2,1       ; @AMS_DELTA_MICROPHONE
l_.str.3:                               ; @.str.3
	.asciz	"Speaker"

	.comm	_AMS_DELTA_SPEAKER,2,1          ; @AMS_DELTA_SPEAKER
	.comm	_ams_delta_audio_agc,2,1        ; @ams_delta_audio_agc
	.comm	_AMS_DELTA_AGC,2,1              ; @AMS_DELTA_AGC
	.comm	_ams_delta_audio_mode,4,2       ; @ams_delta_audio_mode
	.comm	_ams_delta_audio_mode_pins,8,3  ; @ams_delta_audio_mode_pins
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_ams_delta_get_audio_mode
.subsections_via_symbols
