	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alc_update_headset_mode
_alc_update_headset_mode:               ## @alc_update_headset_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	%rdi, %r15
	movq	(%rdi), %r14
	movq	24(%r14), %rax
	movq	32(%r14), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rbx
	movq	48(%r14), %rax
	movq	(%rax), %r13
	movq	%r13, %rsi
	callq	_snd_hda_jack_detect
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	cmpq	(%r14), %rbx
	jne	LBB0_6
## %bb.2:
	movl	$130, %r12d
	jmp	LBB0_4
LBB0_3:
	movl	$128, %r12d
LBB0_4:
	xorl	%ebx, %ebx
	cmpl	16(%r14), %r12d
	jne	LBB0_7
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%eax, %eax
	cmpq	8(%r14), %rbx
	sete	%bl
	setne	%al
	leal	(%rax,%rax), %r12d
	addl	$129, %r12d
	cmpl	16(%r14), %r12d
	je	LBB0_5
LBB0_7:
	leal	-128(%r12), %eax
	movzbl	%al, %eax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	jmpq	*%rax
LBB0_8:
	movq	%r15, %rdi
	callq	_alc_headset_mode_unplugged
	xorl	%r13d, %r13d
	jmp	LBB0_16
LBB0_9:
	movq	8(%r14), %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_alc_headset_mode_mic_in
	xorl	%r13d, %r13d
	jmp	LBB0_16
LBB0_10:
	movl	56(%r14), %eax
	movq	_ALC_HEADSET_TYPE_UNKNOWN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	callq	_alc_determine_headset_type
	movl	56(%r14), %eax
LBB0_12:
	movq	_ALC_HEADSET_TYPE_CTIA@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_20
## %bb.13:
	movq	%r15, %rdi
	callq	_alc_headset_mode_ctia
	jmp	LBB0_15
LBB0_14:
	movq	%r15, %rdi
	callq	_alc_headset_mode_default
LBB0_15:
	movl	$1, %r13d
LBB0_16:
	movl	%r13d, 40(%r14)
	testb	%bl, %bl
	jne	LBB0_19
## %bb.17:
	movq	_AC_PINCTL_OUT_EN@GOTPCREL(%rip), %rax
	movq	_AC_PINCTL_HP_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_snd_hda_set_pin_ctl_cache
	movq	8(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_19
## %bb.18:
	movq	_PIN_VREFHIZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_snd_hda_set_pin_ctl_cache
LBB0_19:
	movl	%r12d, 16(%r14)
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_snd_hda_gen_update_outputs     ## TAILCALL
LBB0_20:
	movq	_ALC_HEADSET_TYPE_OMTP@GOTPCREL(%rip), %rcx
	movl	$1, %r13d
	cmpl	(%rcx), %eax
	jne	LBB0_16
## %bb.21:
	movq	%r15, %rdi
	callq	_alc_headset_mode_omtp
	jmp	LBB0_16
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
LJTI0_0:
	.long	L0_0_set_8
	.long	L0_0_set_9
	.long	L0_0_set_10
	.long	L0_0_set_14
	.end_data_region
                                        ## -- End function
	.comm	_ALC_HEADSET_TYPE_UNKNOWN,4,2   ## @ALC_HEADSET_TYPE_UNKNOWN
	.comm	_ALC_HEADSET_TYPE_CTIA,4,2      ## @ALC_HEADSET_TYPE_CTIA
	.comm	_ALC_HEADSET_TYPE_OMTP,4,2      ## @ALC_HEADSET_TYPE_OMTP
	.comm	_AC_PINCTL_OUT_EN,4,2           ## @AC_PINCTL_OUT_EN
	.comm	_AC_PINCTL_HP_EN,4,2            ## @AC_PINCTL_HP_EN
	.comm	_PIN_VREFHIZ,4,2                ## @PIN_VREFHIZ
	.no_dead_strip	_alc_update_headset_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alc_update_headset_mode
_alc_update_headset_mode:               ; @alc_update_headset_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, x0
	ldr	x21, [x0]
	ldp	x8, x9, [x21, #24]
	ldr	x9, [x9]
	ldr	x22, [x8, x9, lsl #3]
	ldr	x8, [x21, #48]
	ldr	x20, [x8]
	mov	x1, x20
	bl	_snd_hda_jack_detect
	cbz	w0, LBB0_3
; %bb.1:
	ldr	x8, [x21]
	cmp	x22, x8
	b.ne	LBB0_4
; %bb.2:
	mov	w23, #0
	mov	w22, #130
	b	LBB0_5
LBB0_3:
	mov	w23, #0
	mov	w22, #128
	b	LBB0_5
LBB0_4:
	ldr	x8, [x21, #8]
	cmp	x22, x8
	cset	w23, eq
	mov	w8, #131
	mov	w9, #129
	csel	w22, w9, w8, eq
LBB0_5:
	ldr	w8, [x21, #16]
	cmp	w22, w8
	b.ne	LBB0_7
; %bb.6:
	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
LBB0_7:
	and	x8, x22, #0x3
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_8
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_8:
	mov	x0, x19
	bl	_alc_headset_mode_unplugged
	mov	w8, #0
	b	LBB0_18
LBB0_9:
	ldr	x2, [x21, #8]
	mov	x0, x19
	mov	x1, x20
	bl	_alc_headset_mode_mic_in
	mov	w8, #0
	b	LBB0_18
LBB0_10:
	ldr	w8, [x21, #56]
Lloh2:
	adrp	x9, _ALC_HEADSET_TYPE_UNKNOWN@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ALC_HEADSET_TYPE_UNKNOWN@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_alc_determine_headset_type
	ldr	w8, [x21, #56]
LBB0_12:
Lloh5:
	adrp	x9, _ALC_HEADSET_TYPE_CTIA@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ALC_HEADSET_TYPE_CTIA@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_15
; %bb.13:
	mov	x0, x19
	bl	_alc_headset_mode_ctia
	b	LBB0_17
LBB0_14:
	mov	x0, x19
	bl	_alc_headset_mode_default
	b	LBB0_17
LBB0_15:
Lloh8:
	adrp	x9, _ALC_HEADSET_TYPE_OMTP@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ALC_HEADSET_TYPE_OMTP@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_alc_headset_mode_omtp
LBB0_17:
	mov	w8, #1
LBB0_18:
	str	w8, [x21, #40]
	tbnz	w23, #0, LBB0_21
; %bb.19:
Lloh11:
	adrp	x8, _AC_PINCTL_OUT_EN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AC_PINCTL_OUT_EN@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _AC_PINCTL_HP_EN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AC_PINCTL_HP_EN@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	mov	x1, x20
	bl	_snd_hda_set_pin_ctl_cache
	ldr	x1, [x21, #8]
	cbz	x1, LBB0_21
; %bb.20:
Lloh17:
	adrp	x8, _PIN_VREFHIZ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PIN_VREFHIZ@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_snd_hda_set_pin_ctl_cache
LBB0_21:
	str	w22, [x21, #16]
	mov	x0, x19
	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
	b	_snd_hda_gen_update_outputs
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_8-LBB0_8)>>2
	.byte	(LBB0_9-LBB0_8)>>2
	.byte	(LBB0_10-LBB0_8)>>2
	.byte	(LBB0_14-LBB0_8)>>2
                                        ; -- End function
	.comm	_ALC_HEADSET_TYPE_UNKNOWN,4,2   ; @ALC_HEADSET_TYPE_UNKNOWN
	.comm	_ALC_HEADSET_TYPE_CTIA,4,2      ; @ALC_HEADSET_TYPE_CTIA
	.comm	_ALC_HEADSET_TYPE_OMTP,4,2      ; @ALC_HEADSET_TYPE_OMTP
	.comm	_AC_PINCTL_OUT_EN,4,2           ; @AC_PINCTL_OUT_EN
	.comm	_AC_PINCTL_HP_EN,4,2            ; @AC_PINCTL_HP_EN
	.comm	_PIN_VREFHIZ,4,2                ; @PIN_VREFHIZ
	.no_dead_strip	_alc_update_headset_mode
.subsections_via_symbols
