	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arizona_identify_headphone
_arizona_identify_headphone:            ## @arizona_identify_headphone
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 24(%rdi)
	jne	LBB0_12
## %bb.1:
	movq	%rdi, %rbx
	movq	32(%rdi), %r14
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movl	20(%rbx), %edi
	callq	_pm_runtime_get
	movl	$1, (%rbx)
	cmpq	$0, 8(%rbx)
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_arizona_stop_mic
LBB0_3:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_arizona_extcon_hp_clamp
	movq	_ARIZONA_ACCESSORY_DETECT_MODE_1@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_ARIZONA_ACCDET_MODE_MASK@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	4(%r14), %edi
	movl	8(%r14), %ecx
	callq	_regmap_update_bits
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_5:
	movl	4(%r14), %edi
	movq	_ARIZONA_HEADPHONE_DETECT_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ARIZONA_HP_POLL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	callq	_regmap_update_bits
	testl	%eax, %eax
	je	LBB0_12
## %bb.6:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_7:
	movl	%eax, %edx
	callq	_dev_err
	movl	4(%r14), %edi
	movl	(%r15), %esi
	movl	(%r12), %edx
	movq	_ARIZONA_ACCDET_MODE_MIC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_regmap_update_bits
	movl	16(%rbx), %edi
	movq	_EXTCON_JACK_HEADPHONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_extcon_set_state_sync
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_9:
	cmpq	$0, 8(%rbx)
	je	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	callq	_arizona_start_mic
LBB0_11:
	movl	$0, (%rbx)
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Starting HPDET\n"

	.comm	_ARIZONA_ACCESSORY_DETECT_MODE_1,4,2 ## @ARIZONA_ACCESSORY_DETECT_MODE_1
	.comm	_ARIZONA_ACCDET_MODE_MASK,4,2   ## @ARIZONA_ACCDET_MODE_MASK
L_.str.1:                               ## @.str.1
	.asciz	"Failed to set HPDET mode: %d\n"

	.comm	_ARIZONA_HEADPHONE_DETECT_1,4,2 ## @ARIZONA_HEADPHONE_DETECT_1
	.comm	_ARIZONA_HP_POLL,4,2            ## @ARIZONA_HP_POLL
L_.str.2:                               ## @.str.2
	.asciz	"Can't start HPDETL measurement: %d\n"

	.comm	_ARIZONA_ACCDET_MODE_MIC,4,2    ## @ARIZONA_ACCDET_MODE_MIC
	.comm	_EXTCON_JACK_HEADPHONE,4,2      ## @EXTCON_JACK_HEADPHONE
L_.str.3:                               ## @.str.3
	.asciz	"Failed to report headphone: %d\n"

	.no_dead_strip	_arizona_identify_headphone
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arizona_identify_headphone
_arizona_identify_headphone:            ; @arizona_identify_headphone
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0, #24]
	cbnz	x8, LBB0_12
; %bb.1:
	mov	x19, x0
	ldr	x20, [x0, #32]
	ldr	w0, [x20]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w0, [x19, #20]
	bl	_pm_runtime_get
	mov	w8, #1
	str	w8, [x19]
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_arizona_stop_mic
LBB0_3:
	mov	x0, x19
	mov	w1, #1
	bl	_arizona_extcon_hp_clamp
Lloh2:
	adrp	x21, _ARIZONA_ACCESSORY_DETECT_MODE_1@GOTPAGE
Lloh3:
	ldr	x21, [x21, _ARIZONA_ACCESSORY_DETECT_MODE_1@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh4:
	adrp	x22, _ARIZONA_ACCDET_MODE_MASK@GOTPAGE
Lloh5:
	ldr	x22, [x22, _ARIZONA_ACCDET_MODE_MASK@GOTPAGEOFF]
	ldr	w2, [x22]
	ldp	w0, w3, [x20, #4]
	bl	_regmap_update_bits
	cbz	w0, LBB0_5
; %bb.4:
	mov	x2, x0
	ldr	w0, [x20]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_5:
	ldr	w0, [x20, #4]
Lloh8:
	adrp	x8, _ARIZONA_HEADPHONE_DETECT_1@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ARIZONA_HEADPHONE_DETECT_1@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _ARIZONA_HP_POLL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ARIZONA_HP_POLL@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	cbz	w0, LBB0_12
; %bb.6:
	mov	x2, x0
	ldr	w0, [x20]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_7:
	bl	_dev_err
	ldr	w0, [x20, #4]
	ldr	w1, [x21]
	ldr	w2, [x22]
Lloh16:
	adrp	x8, _ARIZONA_ACCDET_MODE_MIC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ARIZONA_ACCDET_MODE_MIC@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
	bl	_regmap_update_bits
	ldr	w0, [x19, #16]
Lloh19:
	adrp	x8, _EXTCON_JACK_HEADPHONE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EXTCON_JACK_HEADPHONE@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_extcon_set_state_sync
	cbz	w0, LBB0_9
; %bb.8:
	mov	x2, x0
	ldr	w0, [x20]
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
LBB0_9:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x19
	bl	_arizona_start_mic
LBB0_11:
	str	wzr, [x19]
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Starting HPDET\n"

	.comm	_ARIZONA_ACCESSORY_DETECT_MODE_1,4,2 ; @ARIZONA_ACCESSORY_DETECT_MODE_1
	.comm	_ARIZONA_ACCDET_MODE_MASK,4,2   ; @ARIZONA_ACCDET_MODE_MASK
l_.str.1:                               ; @.str.1
	.asciz	"Failed to set HPDET mode: %d\n"

	.comm	_ARIZONA_HEADPHONE_DETECT_1,4,2 ; @ARIZONA_HEADPHONE_DETECT_1
	.comm	_ARIZONA_HP_POLL,4,2            ; @ARIZONA_HP_POLL
l_.str.2:                               ; @.str.2
	.asciz	"Can't start HPDETL measurement: %d\n"

	.comm	_ARIZONA_ACCDET_MODE_MIC,4,2    ; @ARIZONA_ACCDET_MODE_MIC
	.comm	_EXTCON_JACK_HEADPHONE,4,2      ; @EXTCON_JACK_HEADPHONE
l_.str.3:                               ; @.str.3
	.asciz	"Failed to report headphone: %d\n"

	.no_dead_strip	_arizona_identify_headphone
.subsections_via_symbols
