	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arizona_hpdet_wait
_arizona_hpdet_wait:                    ## @arizona_hpdet_wait
	.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	8(%rdi), %r12
	movq	_ARIZONA_HPDET_WAIT_COUNT@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	jle	LBB0_8
## %bb.1:
	movq	%rdi, %r15
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_ARIZONA_HP_DONE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_10
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_ARIZONA_HPDET_WAIT_DELAY_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msleep
	incl	%r14d
	cmpl	(%r13), %r14d
	jge	LBB0_8
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r12), %edi
	movq	_ARIZONA_HEADPHONE_DETECT_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, (%r15)
	movl	-44(%rbp), %eax
	je	LBB0_2
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_ARIZONA_HP_DONE_B@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_8:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_9:
	movl	%eax, %ebx
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ARIZONA_HPDET_WAIT_COUNT,4,2   ## @ARIZONA_HPDET_WAIT_COUNT
	.comm	_ARIZONA_HEADPHONE_DETECT_2,4,2 ## @ARIZONA_HEADPHONE_DETECT_2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read HPDET state: %d\n"

	.comm	_ARIZONA_HP_DONE,4,2            ## @ARIZONA_HP_DONE
	.comm	_ARIZONA_HP_DONE_B,4,2          ## @ARIZONA_HP_DONE_B
	.comm	_ARIZONA_HPDET_WAIT_DELAY_MS,4,2 ## @ARIZONA_HPDET_WAIT_DELAY_MS
L_.str.1:                               ## @.str.1
	.asciz	"HPDET did not appear to complete\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_arizona_hpdet_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arizona_hpdet_wait
_arizona_hpdet_wait:                    ; @arizona_hpdet_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x21, [x0, #8]
Lloh0:
	adrp	x22, _ARIZONA_HPDET_WAIT_COUNT@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ARIZONA_HPDET_WAIT_COUNT@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.1:
	mov	x19, x0
	mov	w23, #0
Lloh2:
	adrp	x24, _ARIZONA_HEADPHONE_DETECT_2@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ARIZONA_HEADPHONE_DETECT_2@GOTPAGEOFF]
Lloh4:
	adrp	x25, _ARIZONA_HP_DONE@GOTPAGE
Lloh5:
	ldr	x25, [x25, _ARIZONA_HP_DONE@GOTPAGEOFF]
Lloh6:
	adrp	x26, _ARIZONA_HPDET_WAIT_DELAY_MS@GOTPAGE
Lloh7:
	ldr	x26, [x26, _ARIZONA_HPDET_WAIT_DELAY_MS@GOTPAGEOFF]
Lloh8:
	adrp	x27, _ARIZONA_HP_DONE_B@GOTPAGE
Lloh9:
	ldr	x27, [x27, _ARIZONA_HP_DONE_B@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x25]
	tst	w9, w8
	b.ne	LBB0_7
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x26]
	bl	_msleep
	add	w23, w23, #1
	ldr	w8, [x22]
	cmp	w23, w8
	b.ge	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #4]
	ldr	w1, [x24]
	add	x2, sp, #12
	bl	_regmap_read
	cbnz	w0, LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x19]
	ldr	w8, [sp, #12]
	cbz	w9, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_3
LBB0_7:
	mov	w20, #0
	b	LBB0_10
LBB0_8:
	ldr	w0, [x21]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
Lloh12:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_9:
	mov	x20, x0
	ldr	w0, [x21]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ARIZONA_HPDET_WAIT_COUNT,4,2   ; @ARIZONA_HPDET_WAIT_COUNT
	.comm	_ARIZONA_HEADPHONE_DETECT_2,4,2 ; @ARIZONA_HEADPHONE_DETECT_2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read HPDET state: %d\n"

	.comm	_ARIZONA_HP_DONE,4,2            ; @ARIZONA_HP_DONE
	.comm	_ARIZONA_HP_DONE_B,4,2          ; @ARIZONA_HP_DONE_B
	.comm	_ARIZONA_HPDET_WAIT_DELAY_MS,4,2 ; @ARIZONA_HPDET_WAIT_DELAY_MS
l_.str.1:                               ; @.str.1
	.asciz	"HPDET did not appear to complete\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_arizona_hpdet_wait
.subsections_via_symbols
