	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wm8350_write
_wm8350_write:                          ## @wm8350_write
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $esi killed $esi def $rsi
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movl	%edx, %ebx
	movq	%rdi, %r13
	leal	(%rbx,%rsi), %r8d
	leal	-1(%r8), %edx
	movq	_WM8350_MAX_REGISTER@GOTPCREL(%rip), %rdi
	cmpl	(%rdi), %edx
	jle	LBB0_4
## %bb.15:
	movl	16(%r13), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_9
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_4:
	testl	%ebx, %ebx
	jle	LBB0_14
## %bb.5:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movslq	%esi, %rbx
	movslq	%r8d, %r14
	movq	_wm8350_reg_io_map@GOTPCREL(%rip), %r12
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rcx, %r15
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	cmpl	$0, (%rax,%rbx,4)
	je	LBB0_7
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_is_reg_locked
	testq	%rax, %rax
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r12), %rax
	movl	(%r15), %ecx
	andl	(%rax,%rbx,4), %ecx
	movl	%ecx, (%r15)
	movq	8(%r13), %rdx
	movl	(%rax,%rbx,4), %eax
	notl	%eax
	andl	(%rdx,%rbx,4), %eax
	orl	%ecx, %eax
	movl	%eax, (%rdx,%rbx,4)
	movl	(%r15), %edi
	callq	_cpu_to_be16
	movl	%eax, (%r15)
	incq	%rbx
	addq	$4, %r15
	cmpq	%r14, %rbx
	jl	LBB0_6
## %bb.13:
	movq	(%r13), %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
LBB0_14:
	addl	%ebx, %ebx
	movq	%r13, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%ebx, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_7:
	movl	16(%r13), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_8
LBB0_11:
	movl	16(%r13), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_8:
	movl	%ebx, %edx
LBB0_9:
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_WM8350_MAX_REGISTER,4,2        ## @WM8350_MAX_REGISTER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid reg %x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_wm8350_reg_io_map,8,3          ## @wm8350_reg_io_map
L_.str.1:                               ## @.str.1
	.asciz	"attempted write to read only reg R%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"attempted write to locked reg R%d\n"

	.no_dead_strip	_wm8350_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wm8350_write
_wm8350_write:                          ; @wm8350_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x4, [x0]
	cbz	x4, LBB0_3
; %bb.1:
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	add	w8, w2, w1
	sub	w2, w8, #1
Lloh0:
	adrp	x9, _WM8350_MAX_REGISTER@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WM8350_MAX_REGISTER@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w2, w9
	b.le	LBB0_4
; %bb.2:
	ldr	w0, [x20, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_14
LBB0_3:
Lloh5:
	adrp	x8, _ENODEV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_15
LBB0_4:
	mov	x19, x3
	cmp	w22, #1
	b.lt	LBB0_10
; %bb.5:
	sxtw	x23, w21
	sxtw	x24, w8
Lloh7:
	adrp	x25, _wm8350_reg_io_map@GOTPAGE
Lloh8:
	ldr	x25, [x25, _wm8350_reg_io_map@GOTPAGEOFF]
	mov	x26, x19
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	ldr	w8, [x8, x23, lsl #2]
	cbz	w8, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	mov	x1, x23
	bl	_is_reg_locked
	cbnz	x0, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x25]
	lsl	x9, x23, #2
	ldr	w10, [x8, x9]
	ldr	w11, [x26]
	and	w10, w11, w10
	str	w10, [x26]
	ldr	x11, [x20, #8]
	ldr	w12, [x11, x9]
	ldr	w8, [x8, x9]
	bic	w8, w12, w8
	orr	w8, w8, w10
	str	w8, [x11, x9]
	ldr	w0, [x26]
	bl	_cpu_to_be16
	str	w0, [x26], #4
	add	x23, x23, #1
	cmp	x23, x24
	b.lt	LBB0_6
; %bb.9:
	ldr	x4, [x20]
LBB0_10:
	lsl	w2, w22, #1
	mov	x0, x20
	mov	x1, x21
	mov	x3, x19
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	br	x4
LBB0_11:
	ldr	w0, [x20, #16]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_12:
	ldr	w0, [x20, #16]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_13:
	mov	x2, x23
LBB0_14:
	bl	_dev_err
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_WM8350_MAX_REGISTER,4,2        ; @WM8350_MAX_REGISTER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid reg %x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_wm8350_reg_io_map,8,3          ; @wm8350_reg_io_map
l_.str.1:                               ; @.str.1
	.asciz	"attempted write to read only reg R%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"attempted write to locked reg R%d\n"

	.no_dead_strip	_wm8350_write
.subsections_via_symbols
