	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx24120_message_send
_cx24120_message_send:                  ## @cx24120_message_send
	.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	%rsi, %r14
	movq	%rdi, %r12
	cmpq	$0, 8(%rdi)
	je	LBB0_2
## %bb.1:
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_cx24120_check_cmd
LBB0_2:
	movq	_CX24120_REG_CMD_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	%r12, %rdi
	callq	_cx24120_writereg
	movq	_CX24120_REG_CMD_ARGS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r14), %rdx
	movl	4(%r14), %ecx
	movq	%r12, %rdi
	movl	$1, %r8d
	callq	_cx24120_writeregs
	movq	_CX24120_REG_CMD_END@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_cx24120_writereg
	movl	$-1000, %ebx                    ## imm = 0xFC18
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r12, %rdi
	callq	_cx24120_readreg
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$20, %edi
	callq	_msleep
	addl	$20, %ebx
	jne	LBB0_3
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_err
	movq	_EREMOTEIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_6:
	movq	(%r12), %rdi
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	xorl	%eax, %eax
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CX24120_REG_CMD_START,4,2      ## @CX24120_REG_CMD_START
	.comm	_CX24120_REG_CMD_ARGS,4,2       ## @CX24120_REG_CMD_ARGS
	.comm	_CX24120_REG_CMD_END,4,2        ## @CX24120_REG_CMD_END
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error sending message to firmware\n"

	.comm	_EREMOTEIO,4,2                  ## @EREMOTEIO
L_.str.1:                               ## @.str.1
	.asciz	"sent message 0x%02x\n"

	.no_dead_strip	_cx24120_message_send
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx24120_message_send
_cx24120_message_send:                  ; @cx24120_message_send
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x1
	mov	x20, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w1, [x19]
	mov	x0, x20
	bl	_cx24120_check_cmd
LBB0_2:
Lloh0:
	adrp	x8, _CX24120_REG_CMD_START@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CX24120_REG_CMD_START@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x19]
	mov	x0, x20
	bl	_cx24120_writereg
Lloh3:
	adrp	x8, _CX24120_REG_CMD_ARGS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CX24120_REG_CMD_ARGS@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	x2, [x19, #8]
	ldr	w3, [x19, #4]
	mov	x0, x20
	mov	w4, #1
	bl	_cx24120_writeregs
Lloh6:
	adrp	x21, _CX24120_REG_CMD_END@GOTPAGE
Lloh7:
	ldr	x21, [x21, _CX24120_REG_CMD_END@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	mov	w2, #1
	bl	_cx24120_writereg
	mov	w22, #-1000
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x20
	bl	_cx24120_readreg
	cbz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #20
	bl	_msleep
	adds	w22, w22, #20
	b.ne	LBB0_3
; %bb.5:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_err
Lloh10:
	adrp	x8, _EREMOTEIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EREMOTEIO@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
	ldr	x0, [x20]
	ldr	w2, [x19]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_CX24120_REG_CMD_START,4,2      ; @CX24120_REG_CMD_START
	.comm	_CX24120_REG_CMD_ARGS,4,2       ; @CX24120_REG_CMD_ARGS
	.comm	_CX24120_REG_CMD_END,4,2        ; @CX24120_REG_CMD_END
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error sending message to firmware\n"

	.comm	_EREMOTEIO,4,2                  ; @EREMOTEIO
l_.str.1:                               ; @.str.1
	.asciz	"sent message 0x%02x\n"

	.no_dead_strip	_cx24120_message_send
.subsections_via_symbols
