	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ams_delta_set_audio_mode
_ams_delta_set_audio_mode:              ## @ams_delta_set_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, %r15
	movq	%rdi, %rbx
	callq	_snd_kcontrol_chip
	cmpl	$0, 4(%rax)
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	(%r15), %rcx
	movq	(%rcx), %rcx
	cmpq	(%rax), %rcx
	jge	LBB0_4
## %bb.5:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_ams_delta_audio_mode_pins@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r15), %rcx
	movq	(%rcx), %rcx
	movzwl	(%rax,%rcx,2), %r12d
	movq	_AMS_DELTA_MOUTHPIECE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %ebx
	shll	%cl, %ebx
	movl	$1, %r13d
	xorl	%r15d, %r15d
	btl	%ecx, %r12d
	setb	%r15b
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_snd_soc_dapm_get_pin_status
	xorl	%ecx, %ecx
	cmpl	%r15d, %eax
	je	LBB0_10
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	testl	%r12d, %ebx
	je	LBB0_8
## %bb.7:
	callq	_snd_soc_dapm_enable_pin
	jmp	LBB0_9
LBB0_1:
	movq	_EUNATCH@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_33
LBB0_8:
	callq	_snd_soc_dapm_disable_pin
LBB0_9:
	movl	$1, %ecx
LBB0_10:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	_AMS_DELTA_EARPIECE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	shll	%cl, %r13d
	xorl	%ebx, %ebx
	btl	%ecx, %r12d
	setb	%bl
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_snd_soc_dapm_get_pin_status
	cmpl	%ebx, %eax
	je	LBB0_15
## %bb.11:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	testl	%r12d, %r13d
	je	LBB0_13
## %bb.12:
	callq	_snd_soc_dapm_enable_pin
	jmp	LBB0_14
LBB0_13:
	callq	_snd_soc_dapm_disable_pin
LBB0_14:
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_15:
	movq	_AMS_DELTA_MICROPHONE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %r15d
	shll	%cl, %r15d
	movl	$1, %r13d
	xorl	%ebx, %ebx
	btl	%ecx, %r12d
	setb	%bl
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_snd_soc_dapm_get_pin_status
	cmpl	%ebx, %eax
	je	LBB0_20
## %bb.16:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	testl	%r12d, %r15d
	je	LBB0_18
## %bb.17:
	callq	_snd_soc_dapm_enable_pin
	jmp	LBB0_19
LBB0_18:
	callq	_snd_soc_dapm_disable_pin
LBB0_19:
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_20:
	movq	_AMS_DELTA_SPEAKER@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	shll	%cl, %r13d
	xorl	%ebx, %ebx
	btl	%ecx, %r12d
	setb	%bl
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_snd_soc_dapm_get_pin_status
	cmpl	%ebx, %eax
	je	LBB0_25
## %bb.21:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	testl	%r12d, %r13d
	je	LBB0_23
## %bb.22:
	callq	_snd_soc_dapm_enable_pin
	jmp	LBB0_24
LBB0_23:
	callq	_snd_soc_dapm_disable_pin
LBB0_24:
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_25:
	movq	_AMS_DELTA_AGC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %eax
	shll	%cl, %eax
	xorl	%edx, %edx
	btl	%ecx, %r12d
	setb	%dl
	movq	_ams_delta_audio_agc@GOTPCREL(%rip), %rcx
	cmpl	%edx, (%rcx)
	jne	LBB0_26
## %bb.28:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_31
## %bb.29:
	xorl	%ebx, %ebx
	jmp	LBB0_32
LBB0_26:
	movl	%edx, (%rcx)
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	testl	%r12d, %eax
	je	LBB0_30
## %bb.27:
	callq	_snd_soc_dapm_enable_pin
	jmp	LBB0_31
LBB0_30:
	callq	_snd_soc_dapm_disable_pin
LBB0_31:
	movq	%r14, %rdi
	callq	_snd_soc_dapm_sync
	movl	$1, %ebx
LBB0_32:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_33:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EUNATCH,4,2                    ## @EUNATCH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ams_delta_audio_mode_pins,8,3  ## @ams_delta_audio_mode_pins
	.comm	_AMS_DELTA_MOUTHPIECE,4,2       ## @AMS_DELTA_MOUTHPIECE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Mouthpiece"

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

	.comm	_AMS_DELTA_MICROPHONE,4,2       ## @AMS_DELTA_MICROPHONE
L_.str.2:                               ## @.str.2
	.asciz	"Microphone"

	.comm	_AMS_DELTA_SPEAKER,4,2          ## @AMS_DELTA_SPEAKER
L_.str.3:                               ## @.str.3
	.asciz	"Speaker"

	.comm	_AMS_DELTA_AGC,4,2              ## @AMS_DELTA_AGC
	.comm	_ams_delta_audio_agc,4,2        ## @ams_delta_audio_agc
L_.str.4:                               ## @.str.4
	.asciz	"AGCIN"

	.no_dead_strip	_ams_delta_set_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_set_audio_mode
_ams_delta_set_audio_mode:              ; @ams_delta_set_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	x20, x1
	mov	x21, x0
	bl	_snd_kcontrol_chip
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_4
; %bb.1:
	ldr	x8, [x21]
	ldr	x9, [x20]
	ldr	x9, [x9]
	ldr	x8, [x8]
	cmp	x9, x8
	b.ge	LBB0_5
; %bb.2:
	mov	x19, x0
	bl	_mutex_lock
Lloh0:
	adrp	x8, _ams_delta_audio_mode_pins@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ams_delta_audio_mode_pins@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x20]
	ldr	x9, [x9]
	ldrh	w20, [x8, x9, lsl #1]
Lloh3:
	adrp	x8, _AMS_DELTA_MOUTHPIECE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AMS_DELTA_MOUTHPIECE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	w22, #1
	lsl	w8, w22, w8
	ands	w21, w8, w20
	cset	w23, ne
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_snd_soc_dapm_get_pin_status
	cmp	w0, w23
	b.ne	LBB0_7
; %bb.3:
	mov	w21, #0
	b	LBB0_11
LBB0_4:
Lloh8:
	adrp	x8, _EUNATCH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EUNATCH@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_34
LBB0_7:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	cbz	w21, LBB0_9
; %bb.8:
	bl	_snd_soc_dapm_enable_pin
	b	LBB0_10
LBB0_9:
	bl	_snd_soc_dapm_disable_pin
LBB0_10:
	mov	w21, #1
LBB0_11:
Lloh14:
	adrp	x8, _AMS_DELTA_EARPIECE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AMS_DELTA_EARPIECE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	lsl	w8, w22, w8
	ands	w22, w8, w20
	cset	w23, ne
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_snd_soc_dapm_get_pin_status
	cmp	w0, w23
	b.eq	LBB0_16
; %bb.12:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	cbz	w22, LBB0_14
; %bb.13:
	bl	_snd_soc_dapm_enable_pin
	b	LBB0_15
LBB0_14:
	bl	_snd_soc_dapm_disable_pin
LBB0_15:
	mov	w21, #1
LBB0_16:
Lloh21:
	adrp	x8, _AMS_DELTA_MICROPHONE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AMS_DELTA_MICROPHONE@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	mov	w22, #1
	lsl	w8, w22, w8
	ands	w23, w8, w20
	cset	w24, ne
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_snd_soc_dapm_get_pin_status
	cmp	w0, w24
	b.eq	LBB0_21
; %bb.17:
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	cbz	w23, LBB0_19
; %bb.18:
	bl	_snd_soc_dapm_enable_pin
	b	LBB0_20
LBB0_19:
	bl	_snd_soc_dapm_disable_pin
LBB0_20:
	mov	w21, #1
LBB0_21:
Lloh28:
	adrp	x8, _AMS_DELTA_SPEAKER@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AMS_DELTA_SPEAKER@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	lsl	w8, w22, w8
	ands	w22, w8, w20
	cset	w23, ne
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_snd_soc_dapm_get_pin_status
	cmp	w0, w23
	b.eq	LBB0_26
; %bb.22:
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	cbz	w22, LBB0_24
; %bb.23:
	bl	_snd_soc_dapm_enable_pin
	b	LBB0_25
LBB0_24:
	bl	_snd_soc_dapm_disable_pin
LBB0_25:
	mov	w21, #1
LBB0_26:
Lloh35:
	adrp	x8, _AMS_DELTA_AGC@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AMS_DELTA_AGC@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w8, w9, w8
	ands	w8, w8, w20
	cset	w9, ne
Lloh38:
	adrp	x10, _ams_delta_audio_agc@GOTPAGE
Lloh39:
	ldr	x10, [x10, _ams_delta_audio_agc@GOTPAGEOFF]
	ldr	w11, [x10]
	cmp	w11, w9
	b.ne	LBB0_29
; %bb.27:
	cbnz	w21, LBB0_32
; %bb.28:
	mov	w20, #0
	b	LBB0_33
LBB0_29:
	str	w9, [x10]
Lloh40:
	adrp	x1, l_.str.4@PAGE
Lloh41:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	cbz	w8, LBB0_31
; %bb.30:
	bl	_snd_soc_dapm_enable_pin
	b	LBB0_32
LBB0_31:
	bl	_snd_soc_dapm_disable_pin
LBB0_32:
	mov	x0, x19
	bl	_snd_soc_dapm_sync
	mov	w20, #1
LBB0_33:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_34:
	mov	x0, x20
	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 AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_EUNATCH,4,2                    ; @EUNATCH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ams_delta_audio_mode_pins,8,3  ; @ams_delta_audio_mode_pins
	.comm	_AMS_DELTA_MOUTHPIECE,4,2       ; @AMS_DELTA_MOUTHPIECE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Mouthpiece"

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

	.comm	_AMS_DELTA_MICROPHONE,4,2       ; @AMS_DELTA_MICROPHONE
l_.str.2:                               ; @.str.2
	.asciz	"Microphone"

	.comm	_AMS_DELTA_SPEAKER,4,2          ; @AMS_DELTA_SPEAKER
l_.str.3:                               ; @.str.3
	.asciz	"Speaker"

	.comm	_AMS_DELTA_AGC,4,2              ; @AMS_DELTA_AGC
	.comm	_ams_delta_audio_agc,4,2        ; @ams_delta_audio_agc
l_.str.4:                               ; @.str.4
	.asciz	"AGCIN"

	.no_dead_strip	_ams_delta_set_audio_mode
.subsections_via_symbols
