	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meson_ao_cec_write
_meson_ao_cec_write:                    ## @meson_ao_cec_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %rbx
	movq	%rdi, %r14
	movq	_CEC_RW_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_FIELD_PREP
	movl	%eax, %r12d
	movq	_CEC_RW_WR_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	orl	%r12d, %ebx
	movq	_CEC_RW_WRITE_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	testq	%r15, %r15
	je	LBB0_2
## %bb.1:
	cmpl	$0, (%r15)
	jne	LBB0_6
LBB0_2:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	callq	_meson_ao_cec_wait_busy
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	_CEC_RW_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel_relaxed
LBB0_4:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	testq	%r15, %r15
	je	LBB0_6
## %bb.5:
	movl	%r12d, (%r15)
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CEC_RW_ADDR,4,2                ## @CEC_RW_ADDR
	.comm	_CEC_RW_WR_DATA,4,2             ## @CEC_RW_WR_DATA
	.comm	_CEC_RW_WRITE_EN,4,2            ## @CEC_RW_WRITE_EN
	.comm	_CEC_RW_REG,8,3                 ## @CEC_RW_REG
	.no_dead_strip	_meson_ao_cec_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meson_ao_cec_write
_meson_ao_cec_write:                    ; @meson_ao_cec_write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x3
	mov	x22, x2
	mov	x20, x0
Lloh0:
	adrp	x8, _CEC_RW_ADDR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CEC_RW_ADDR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_FIELD_PREP
	mov	x21, x0
Lloh3:
	adrp	x8, _CEC_RW_WR_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CEC_RW_WR_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_FIELD_PREP
	mov	x23, x0
Lloh6:
	adrp	x8, _CEC_RW_WRITE_EN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CEC_RW_WRITE_EN@GOTPAGEOFF]
Lloh8:
	ldr	w24, [x8]
	cbz	x19, LBB0_2
; %bb.1:
	ldr	w8, [x19]
	cbnz	w8, LBB0_6
LBB0_2:
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_meson_ao_cec_wait_busy
	mov	x22, x0
	cbnz	w0, LBB0_4
; %bb.3:
	orr	w8, w23, w21
	orr	w0, w8, w24
	ldr	x8, [x20, #8]
Lloh9:
	adrp	x9, _CEC_RW_REG@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CEC_RW_REG@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
LBB0_4:
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	cbz	x19, LBB0_6
; %bb.5:
	str	w22, [x19]
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CEC_RW_ADDR,4,2                ; @CEC_RW_ADDR
	.comm	_CEC_RW_WR_DATA,4,2             ; @CEC_RW_WR_DATA
	.comm	_CEC_RW_WRITE_EN,4,2            ; @CEC_RW_WRITE_EN
	.comm	_CEC_RW_REG,8,3                 ; @CEC_RW_REG
	.no_dead_strip	_meson_ao_cec_write
.subsections_via_symbols
