	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arizona_hpdet_do_id
_arizona_hpdet_do_id:                   ## @arizona_hpdet_do_id
	.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	40(%rdi), %r13
	cmpq	$0, 16(%r13)
	je	LBB0_13
## %bb.1:
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movl	8(%r13), %r15d
	movl	(%rsi), %ecx
	movq	(%rdi), %rax
	movslq	8(%rdi), %rdx
	leal	1(%rdx), %esi
	movl	%esi, 8(%rdi)
	movl	%ecx, (%rax,%rdx,4)
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.2:
	cmpl	$1, 8(%rbx)
	jne	LBB0_4
## %bb.3:
	movl	4(%r13), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	(%r13), %edi
	movq	_ARIZONA_ACCESSORY_DETECT_MODE_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ARIZONA_ACCDET_MODE_MASK@GOTPCREL(%rip), %rax
	movq	_ARIZONA_ACCDET_SRC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_ARIZONA_ACCDET_MODE_HPR@GOTPCREL(%rip), %rax
	movq	24(%rbx), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	callq	_regmap_update_bits
	movl	%r15d, %edi
	movl	$1, %esi
	callq	_gpio_set_value_cansleep
	movl	(%r13), %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
	jmp	LBB0_7
LBB0_4:
	movl	4(%r13), %edi
	movl	(%rax), %edx
	movl	4(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	(%rbx), %rax
	movl	(%rax), %ecx
	movl	%ecx, (%r12)
	movq	_ARIZONA_HPDET_MAX@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jl	LBB0_8
## %bb.5:
	cmpl	$0, 12(%rbx)
	je	LBB0_6
LBB0_8:
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.9:
	cmpl	$51, 4(%rax)
	jl	LBB0_11
LBB0_10:
	movl	4(%r13), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	$1, (%r14)
	movl	$1, 16(%rbx)
	jmp	LBB0_12
LBB0_11:
	movl	4(%r13), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_12:
	movl	(%r13), %edi
	movq	_ARIZONA_ACCESSORY_DETECT_MODE_1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ARIZONA_ACCDET_SRC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	24(%rbx), %rax
	movl	(%rax), %ecx
	callq	_regmap_update_bits
LBB0_13:
	xorl	%r14d, %r14d
	jmp	LBB0_14
LBB0_6:
	movl	4(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_dev_dbg
	movabsq	$4294967296, %rax               ## imm = 0x100000000
	movq	%rax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_arizona_start_hpdet_acc_id
	movl	32(%rbx), %edi
	callq	_pm_runtime_put
LBB0_7:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_14:
	movl	%r14d, %eax
	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	"Measuring mic\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
	.comm	_ARIZONA_ACCDET_SRC,4,2         ## @ARIZONA_ACCDET_SRC
	.comm	_ARIZONA_ACCDET_MODE_HPR,4,2    ## @ARIZONA_ACCDET_MODE_HPR
	.comm	_ARIZONA_HEADPHONE_DETECT_1,4,2 ## @ARIZONA_HEADPHONE_DETECT_1
	.comm	_ARIZONA_HP_POLL,4,2            ## @ARIZONA_HP_POLL
	.comm	_EAGAIN,4,2                     ## @EAGAIN
L_.str.1:                               ## @.str.1
	.asciz	"HPDET measured %d %d\n"

	.comm	_ARIZONA_HPDET_MAX,4,2          ## @ARIZONA_HPDET_MAX
L_.str.2:                               ## @.str.2
	.asciz	"Retrying high impedance\n"

L_.str.3:                               ## @.str.3
	.asciz	"Detected mic\n"

L_.str.4:                               ## @.str.4
	.asciz	"Detected headphone\n"

	.no_dead_strip	_arizona_hpdet_do_id
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function arizona_hpdet_do_id
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_arizona_hpdet_do_id:                   ; @arizona_hpdet_do_id
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x23, [x0, #40]
	ldr	x8, [x23, #16]
	cbz	x8, LBB0_11
; %bb.1:
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w20, [x23, #8]
	ldr	w9, [x1]
	ldr	x8, [x0]
	ldrsw	x10, [x0, #8]
	add	w11, w10, #1
	str	w11, [x0, #8]
	str	w9, [x8, x10, lsl #2]
	cbz	w20, LBB0_4
; %bb.2:
	ldr	w9, [x19, #8]
	cmp	w9, #1
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [x23, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	ldr	w0, [x23]
Lloh2:
	adrp	x8, _ARIZONA_ACCESSORY_DETECT_MODE_1@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ARIZONA_ACCESSORY_DETECT_MODE_1@GOTPAGEOFF]
Lloh4:
	adrp	x9, _ARIZONA_ACCDET_MODE_MASK@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ARIZONA_ACCDET_MODE_MASK@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	ldr	w8, [x9]
Lloh8:
	adrp	x9, _ARIZONA_ACCDET_SRC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ARIZONA_ACCDET_SRC@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh11:
	adrp	x8, _ARIZONA_ACCDET_MODE_HPR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ARIZONA_ACCDET_MODE_HPR@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	x9, [x19, #24]
	ldr	w9, [x9]
	orr	w3, w9, w8
	bl	_regmap_update_bits
	mov	x0, x20
	mov	w1, #1
	bl	_gpio_set_value_cansleep
	ldr	w0, [x23]
Lloh14:
	adrp	x8, _ARIZONA_HEADPHONE_DETECT_1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ARIZONA_HEADPHONE_DETECT_1@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _ARIZONA_HP_POLL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ARIZONA_HP_POLL@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x3, x2
	bl	_regmap_update_bits
	b	LBB0_13
LBB0_4:
	ldr	w0, [x23, #4]
	ldp	w9, w8, [x8]
	stp	x9, x8, [sp]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	ldr	x8, [x19]
	ldr	w9, [x8]
	str	w9, [x22]
Lloh22:
	adrp	x10, _ARIZONA_HPDET_MAX@GOTPAGE
Lloh23:
	ldr	x10, [x10, _ARIZONA_HPDET_MAX@GOTPAGEOFF]
Lloh24:
	ldr	w10, [x10]
	cmp	w9, w10
	b.lt	LBB0_6
; %bb.5:
	ldr	w9, [x19, #12]
	cbz	w9, LBB0_12
LBB0_6:
	cbz	w20, LBB0_8
; %bb.7:
	ldr	w8, [x8, #4]
	cmp	w8, #51
	b.lt	LBB0_9
LBB0_8:
	ldr	w0, [x23, #4]
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	mov	w8, #1
	str	w8, [x21]
	str	w8, [x19, #16]
	b	LBB0_10
LBB0_9:
	ldr	w0, [x23, #4]
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_dbg
LBB0_10:
	ldr	w0, [x23]
Lloh29:
	adrp	x8, _ARIZONA_ACCESSORY_DETECT_MODE_1@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ARIZONA_ACCESSORY_DETECT_MODE_1@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x8, _ARIZONA_ACCDET_SRC@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ARIZONA_ACCDET_SRC@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	ldr	x8, [x19, #24]
	ldr	w3, [x8]
	bl	_regmap_update_bits
LBB0_11:
	mov	w0, #0
	b	LBB0_14
LBB0_12:
	ldr	w0, [x23, #4]
Lloh35:
	adrp	x1, l_.str.2@PAGE
Lloh36:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh37:
	adrp	x8, lCPI0_0@PAGE
Lloh38:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19, #8]
	mov	x0, x19
	bl	_arizona_start_hpdet_acc_id
	ldr	w0, [x19, #32]
	bl	_pm_runtime_put
LBB0_13:
Lloh39:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdr	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Measuring mic\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
	.comm	_ARIZONA_ACCDET_SRC,4,2         ; @ARIZONA_ACCDET_SRC
	.comm	_ARIZONA_ACCDET_MODE_HPR,4,2    ; @ARIZONA_ACCDET_MODE_HPR
	.comm	_ARIZONA_HEADPHONE_DETECT_1,4,2 ; @ARIZONA_HEADPHONE_DETECT_1
	.comm	_ARIZONA_HP_POLL,4,2            ; @ARIZONA_HP_POLL
	.comm	_EAGAIN,4,2                     ; @EAGAIN
l_.str.1:                               ; @.str.1
	.asciz	"HPDET measured %d %d\n"

	.comm	_ARIZONA_HPDET_MAX,4,2          ; @ARIZONA_HPDET_MAX
l_.str.2:                               ; @.str.2
	.asciz	"Retrying high impedance\n"

l_.str.3:                               ; @.str.3
	.asciz	"Detected mic\n"

l_.str.4:                               ; @.str.4
	.asciz	"Detected headphone\n"

	.no_dead_strip	_arizona_hpdet_do_id
.subsections_via_symbols
