	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxd2880_write_reg
_cxd2880_write_reg:                     ## @cxd2880_write_reg
	.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
	movl	%ecx, %ebx
	movq	%rdx, %r15
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_BURST_WRITE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leal	4(%r12), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	testq	%r15, %r15
	je	LBB0_2
## %bb.4:
	cmpl	%ebx, %r12d
	jl	LBB0_6
## %bb.5:
	movq	_U8_MAX@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jl	LBB0_6
## %bb.7:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leal	(%rbx,%rcx), %eax
	cmpl	$257, %eax                      ## imm = 0x101
	jl	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_3
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	$14, (%r13)
	movl	%ecx, 4(%r13)
	movl	%ebx, 8(%r13)
	movq	%r13, %rdi
	addq	$12, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movl	8(%r13), %edx
	addl	$3, %edx
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_cxd2880_write_spi
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_12
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BURST_WRITE_MAX,4,2            ## @BURST_WRITE_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid arg\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_U8_MAX,4,2                     ## @U8_MAX
L_.str.1:                               ## @.str.1
	.asciz	"data size > WRITE_MAX\n"

L_.str.2:                               ## @.str.2
	.asciz	"out of range\n"

L_.str.3:                               ## @.str.3
	.asciz	"write spi failed %d\n"

	.no_dead_strip	_cxd2880_write_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cxd2880_write_reg
_cxd2880_write_reg:                     ; @cxd2880_write_reg
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x8, _BURST_WRITE_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BURST_WRITE_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w12, [x8]
	add	w8, w12, #4
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	cbz	x0, LBB0_4
; %bb.1:
	cbz	x2, LBB0_4
; %bb.2:
Lloh8:
	adrp	x8, _U8_MAX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _U8_MAX@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w12, w3
	ccmp	w8, w3, #8, ge
	b.ge	LBB0_8
; %bb.3:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
LBB0_5:
	bl	_pr_err
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_6:
	ldur	x8, [x29, #-24]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.7:
	mov	x0, x19
	sub	sp, x29, #16
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	add	w8, w3, w1
	cmp	w8, #257
	b.lt	LBB0_10
; %bb.9:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_10:
	mov	w8, #14
	stp	w8, w1, [x20]
	str	w3, [x20, #8]
	add	x0, x20, #12
	mov	x1, x2
	mov	x2, x3
	bl	_memcpy
	ldr	w8, [x20, #8]
	add	w2, w8, #3
	mov	x0, x19
	mov	x1, x20
	bl	_cxd2880_write_spi
	mov	x19, x0
	cbz	w0, LBB0_6
; %bb.11:
	str	x19, [sp, #-16]!
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
	add	sp, sp, #16
	b	LBB0_6
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_BURST_WRITE_MAX,4,2            ; @BURST_WRITE_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid arg\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_U8_MAX,4,2                     ; @U8_MAX
l_.str.1:                               ; @.str.1
	.asciz	"data size > WRITE_MAX\n"

l_.str.2:                               ; @.str.2
	.asciz	"out of range\n"

l_.str.3:                               ; @.str.3
	.asciz	"write spi failed %d\n"

	.no_dead_strip	_cxd2880_write_reg
.subsections_via_symbols
