	.file	"extr_patch_realtek.c_alc_update_headset_mode.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	alc_update_headset_mode, @function
alc_update_headset_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
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	rbx, QWORD PTR [rdi]
	mov	rax, QWORD PTR 32[rbx]
	mov	rdi, rbx
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR 24[rbx]
	mov	r13, QWORD PTR [rax+rdx*8]
	call	alc_get_hp_pin@PLT
	mov	rdi, rbp
	mov	rsi, rax
	mov	r12, rax
	call	snd_hda_jack_detect@PLT
	test	eax, eax
	jne	.L2
	cmp	DWORD PTR 16[rbx], 128
	je	.L30
	mov	rdi, rbp
	mov	r13d, 128
	call	alc_headset_mode_unplugged@PLT
	mov	eax, DWORD PTR ALC_HEADSET_MODE_UNKNOWN[rip]
	mov	DWORD PTR 40[rbx], 0
	mov	DWORD PTR 16[rbx], eax
	mov	eax, DWORD PTR ALC_HEADSET_TYPE_UNKNOWN[rip]
	mov	DWORD PTR 48[rbx], eax
.L10:
	mov	edx, DWORD PTR AC_PINCTL_OUT_EN[rip]
	mov	rsi, r12
	mov	rdi, rbp
	or	edx, DWORD PTR AC_PINCTL_HP_EN[rip]
	call	snd_hda_set_pin_ctl_cache@PLT
	mov	rsi, QWORD PTR 8[rbx]
	test	rsi, rsi
	je	.L14
	cmp	rsi, r12
	jne	.L32
.L14:
	mov	DWORD PTR 16[rbx], r13d
.L30:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	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
	jmp	snd_hda_gen_update_outputs@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	eax, DWORD PTR 16[rbx]
	cmp	QWORD PTR [rbx], r13
	je	.L5
	mov	rdx, QWORD PTR 8[rbx]
	cmp	rdx, r13
	je	.L6
	cmp	eax, 131
	je	.L30
	mov	rdi, rbp
	mov	r13d, 131
	call	alc_headset_mode_default@PLT
	mov	DWORD PTR 40[rbx], 1
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L32:
	mov	edx, DWORD PTR PIN_VREFHIZ[rip]
	mov	rdi, rbp
	call	snd_hda_set_pin_ctl_cache@PLT
	mov	DWORD PTR 16[rbx], r13d
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	eax, 130
	je	.L30
	mov	eax, DWORD PTR 48[rbx]
	cmp	eax, DWORD PTR ALC_HEADSET_TYPE_UNKNOWN[rip]
	je	.L33
.L11:
	cmp	DWORD PTR ALC_HEADSET_TYPE_CTIA[rip], eax
	je	.L34
	cmp	DWORD PTR ALC_HEADSET_TYPE_OMTP[rip], eax
	je	.L35
.L13:
	mov	DWORD PTR 40[rbx], 1
	mov	r13d, 130
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L6:
	cmp	eax, 129
	je	.L30
	mov	rsi, r12
	mov	rdi, rbp
	mov	r13d, 129
	call	alc_headset_mode_mic_in@PLT
	mov	DWORD PTR 40[rbx], 0
	mov	DWORD PTR 16[rbx], r13d
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L33:
	mov	rdi, rbp
	call	alc_determine_headset_type@PLT
	mov	eax, DWORD PTR 48[rbx]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rdi, rbp
	call	alc_headset_mode_ctia@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L35:
	mov	rdi, rbp
	call	alc_headset_mode_omtp@PLT
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	alc_update_headset_mode, .-alc_update_headset_mode
	.comm	PIN_VREFHIZ,4,4
	.comm	ALC_HEADSET_TYPE_UNKNOWN,4,4
	.comm	ALC_HEADSET_TYPE_OMTP,4,4
	.comm	ALC_HEADSET_TYPE_CTIA,4,4
	.comm	ALC_HEADSET_MODE_UNKNOWN,4,4
	.comm	AC_PINCTL_OUT_EN,4,4
	.comm	AC_PINCTL_HP_EN,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_patch_realtek.c_alc_update_headset_mode.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	alc_update_headset_mode, %function
alc_update_headset_mode:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r4, [r0]
	mov	r5, r0
	ldr	r2, [r4, #16]
	ldr	r3, [r4, #12]
	ldr	r2, [r2]
	mov	r0, r4
	ldr	r8, [r3, r2, lsl #2]
	bl	alc_get_hp_pin
	mov	r6, r0
	mov	r0, r5
	mov	r1, r6
	bl	snd_hda_jack_detect
	subs	r7, r0, #0
	bne	.L2
	ldr	r3, [r4, #8]
	cmp	r3, #128
	beq	.L29
	mov	r0, r5
	bl	alc_headset_mode_unplugged
	str	r7, [r4, #20]
	mov	r7, #128
	ldr	r2, .L35
	ldr	r3, .L35+4
	ldr	r2, [r2]
	ldr	r3, [r3]
	str	r2, [r4, #8]
	str	r3, [r4, #24]
.L10:
	ldr	r2, .L35+8
	ldr	r3, .L35+12
	ldr	r2, [r2]
	ldr	r3, [r3]
	mov	r1, r6
	mov	r0, r5
	orr	r2, r2, r3
	bl	snd_hda_set_pin_ctl_cache
	ldr	r1, [r4, #4]
	cmp	r1, #0
	cmpne	r1, r6
	bne	.L31
.L14:
	str	r7, [r4, #8]
.L29:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, lr}
	b	snd_hda_gen_update_outputs
.L2:
	ldr	r3, [r4]
	ldr	r1, [r4, #8]
	cmp	r3, r8
	beq	.L5
	ldr	r2, [r4, #4]
	cmp	r2, r8
	beq	.L6
	cmp	r1, #131
	beq	.L29
	mov	r0, r5
	bl	alc_headset_mode_default
	mov	r3, #1
	mov	r7, #131
	str	r3, [r4, #20]
	b	.L10
.L5:
	cmp	r1, #130
	beq	.L29
	ldr	r2, .L35+4
	ldr	r3, [r4, #24]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L32
.L11:
	ldr	r2, .L35+16
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L33
	ldr	r2, .L35+20
	ldr	r2, [r2]
	cmp	r2, r3
	beq	.L34
.L13:
	mov	r3, #1
	mov	r7, #130
	str	r3, [r4, #20]
	b	.L10
.L6:
	cmp	r1, #129
	beq	.L29
	mov	r1, r6
	mov	r0, r5
	bl	alc_headset_mode_mic_in
	mov	r3, #0
	mov	r7, #129
	str	r3, [r4, #20]
	b	.L14
.L31:
	ldr	r3, .L35+24
	mov	r0, r5
	ldr	r2, [r3]
	bl	snd_hda_set_pin_ctl_cache
	b	.L14
.L32:
	mov	r0, r5
	bl	alc_determine_headset_type
	ldr	r3, [r4, #24]
	b	.L11
.L33:
	mov	r0, r5
	bl	alc_headset_mode_ctia
	b	.L13
.L34:
	mov	r0, r5
	bl	alc_headset_mode_omtp
	b	.L13
.L36:
	.align	2
.L35:
	.word	ALC_HEADSET_MODE_UNKNOWN
	.word	ALC_HEADSET_TYPE_UNKNOWN
	.word	AC_PINCTL_OUT_EN
	.word	AC_PINCTL_HP_EN
	.word	ALC_HEADSET_TYPE_CTIA
	.word	ALC_HEADSET_TYPE_OMTP
	.word	PIN_VREFHIZ
	.size	alc_update_headset_mode, .-alc_update_headset_mode
	.comm	PIN_VREFHIZ,4,4
	.comm	ALC_HEADSET_TYPE_UNKNOWN,4,4
	.comm	ALC_HEADSET_TYPE_OMTP,4,4
	.comm	ALC_HEADSET_TYPE_CTIA,4,4
	.comm	ALC_HEADSET_MODE_UNKNOWN,4,4
	.comm	AC_PINCTL_OUT_EN,4,4
	.comm	AC_PINCTL_HP_EN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
