	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wm5102_apply_hardware_patch
_wm5102_apply_hardware_patch:           ## @wm5102_apply_hardware_patch
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	-32(%rbp), %rsi
	callq	_arizona_enable_freerun_sysclk
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.1:
	movl	(%r14), %edi
	movq	_ARIZONA_WRITE_SEQUENCER_CTRL_0@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_ARIZONA_WSEQ_ENA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ARIZONA_WSEQ_START@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	orl	$160, %edx
	callq	_regmap_write
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	movl	4(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_5
LBB0_3:
	movq	_ARIZONA_WRITE_SEQUENCER_CTRL_1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ARIZONA_WSEQ_BUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$30, %esi
	xorl	%r8d, %r8d
	callq	_arizona_poll_reg
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %ebx
	movl	(%r14), %edi
	movl	(%r15), %esi
	movq	_ARIZONA_WSEQ_ABORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_regmap_write
LBB0_5:
	leaq	-32(%rbp), %rsi
	movq	%r14, %rdi
	callq	_arizona_disable_freerun_sysclk
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	-32(%rbp), %rsi
	movq	%r14, %rdi
	callq	_arizona_disable_freerun_sysclk
	movl	%eax, %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_ARIZONA_WRITE_SEQUENCER_CTRL_0,4,2 ## @ARIZONA_WRITE_SEQUENCER_CTRL_0
	.comm	_ARIZONA_WSEQ_ENA,4,2           ## @ARIZONA_WSEQ_ENA
	.comm	_ARIZONA_WSEQ_START,4,2         ## @ARIZONA_WSEQ_START
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to start write sequencer: %d\n"

	.comm	_ARIZONA_WRITE_SEQUENCER_CTRL_1,4,2 ## @ARIZONA_WRITE_SEQUENCER_CTRL_1
	.comm	_ARIZONA_WSEQ_BUSY,4,2          ## @ARIZONA_WSEQ_BUSY
	.comm	_ARIZONA_WSEQ_ABORT,4,2         ## @ARIZONA_WSEQ_ABORT
	.no_dead_strip	_wm5102_apply_hardware_patch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wm5102_apply_hardware_patch
_wm5102_apply_hardware_patch:           ; @wm5102_apply_hardware_patch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	add	x1, sp, #8
	bl	_arizona_enable_freerun_sysclk
	mov	x20, x0
	cbnz	w0, LBB0_6
; %bb.1:
	ldr	w0, [x19]
Lloh0:
	adrp	x21, _ARIZONA_WRITE_SEQUENCER_CTRL_0@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ARIZONA_WRITE_SEQUENCER_CTRL_0@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x8, _ARIZONA_WSEQ_ENA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ARIZONA_WSEQ_ENA@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _ARIZONA_WSEQ_START@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ARIZONA_WSEQ_START@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w8, w9
	mov	w9, #160
	orr	w2, w8, w9
	bl	_regmap_write
	cbz	w0, LBB0_3
; %bb.2:
	mov	x20, x0
	ldr	w0, [x19, #4]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
	b	LBB0_5
LBB0_3:
Lloh10:
	adrp	x8, _ARIZONA_WRITE_SEQUENCER_CTRL_1@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ARIZONA_WRITE_SEQUENCER_CTRL_1@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
Lloh13:
	adrp	x8, _ARIZONA_WSEQ_BUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ARIZONA_WSEQ_BUSY@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #30
	mov	w4, #0
	bl	_arizona_poll_reg
	cbz	w0, LBB0_7
; %bb.4:
	mov	x20, x0
	ldr	w0, [x19]
	ldr	w1, [x21]
Lloh16:
	adrp	x8, _ARIZONA_WSEQ_ABORT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ARIZONA_WSEQ_ABORT@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	bl	_regmap_write
LBB0_5:
	add	x1, sp, #8
	mov	x0, x19
	bl	_arizona_disable_freerun_sysclk
LBB0_6:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
LBB0_7:
	add	x1, sp, #8
	mov	x0, x19
	bl	_arizona_disable_freerun_sysclk
	mov	x20, x0
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ARIZONA_WRITE_SEQUENCER_CTRL_0,4,2 ; @ARIZONA_WRITE_SEQUENCER_CTRL_0
	.comm	_ARIZONA_WSEQ_ENA,4,2           ; @ARIZONA_WSEQ_ENA
	.comm	_ARIZONA_WSEQ_START,4,2         ; @ARIZONA_WSEQ_START
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to start write sequencer: %d\n"

	.comm	_ARIZONA_WRITE_SEQUENCER_CTRL_1,4,2 ; @ARIZONA_WRITE_SEQUENCER_CTRL_1
	.comm	_ARIZONA_WSEQ_BUSY,4,2          ; @ARIZONA_WSEQ_BUSY
	.comm	_ARIZONA_WSEQ_ABORT,4,2         ; @ARIZONA_WSEQ_ABORT
	.no_dead_strip	_wm5102_apply_hardware_patch
.subsections_via_symbols
