	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cxd2880_io_spi_write_reg
_cxd2880_io_spi_write_reg:              ## @cxd2880_io_spi_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %ebx
	movq	%rcx, %r14
	movl	%edx, %r15d
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_BURST_WRITE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	addl	$4, %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	testq	%r12, %r12
	je	LBB0_3
## %bb.1:
	testq	%r14, %r14
	je	LBB0_3
## %bb.2:
	movq	(%r12), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	cmpl	%ebx, -64(%rbp)                 ## 4-byte Folded Reload
	jl	LBB0_3
## %bb.5:
	leal	(%rbx,%r15), %eax
	cmpl	$257, %eax                      ## imm = 0x101
	jl	LBB0_6
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movl	%r12d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_CXD2880_IO_TGT_SYS@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, (%rdx)
	sete	%al
	orl	$14, %eax
	movl	%eax, (%r13)
	xorl	%r12d, %r12d
	testl	%ebx, %ebx
	jle	LBB0_13
## %bb.7:
	movq	%r13, %rax
	addq	$12, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, 4(%r13)
	cmpl	$255, %ebx
	movl	$255, %edx
	cmovbl	%ebx, %edx
	movl	%edx, 8(%r13)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_memcpy
	movl	$3, %edx
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movq	_CXD2880_IO_TGT_SYS@GOTPCREL(%rip), %rcx
	cmpl	%eax, (%rcx)
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movslq	8(%r13), %rax
	movl	$0, 12(%r13,%rax,4)
	movl	$4, %edx
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	addl	8(%r13), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	*(%rdi)
	testl	%eax, %eax
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	movslq	8(%r13), %rax
	addl	%eax, %r15d
	leaq	(%r14,%rax,4), %r14
	subl	%eax, %ebx
	jg	LBB0_8
	jmp	LBB0_13
LBB0_11:
	movl	%eax, %r12d
	jmp	LBB0_13
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_BURST_WRITE_MAX,4,2            ## @BURST_WRITE_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CXD2880_IO_TGT_SYS,4,2         ## @CXD2880_IO_TGT_SYS
	.no_dead_strip	_cxd2880_io_spi_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_io_spi_write_reg
_cxd2880_io_spi_write_reg:              ; @cxd2880_io_spi_write_reg
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
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	x23, x9, x8
	mov	sp, x23
	cbz	x0, LBB0_5
; %bb.1:
	cbz	x20, LBB0_5
; %bb.2:
	ldr	x24, [x0]
	cbz	x24, LBB0_5
; %bb.3:
	cmp	w12, w19
	b.lt	LBB0_5
; %bb.4:
	add	w8, w19, w21
	cmp	w8, #257
	b.lt	LBB0_8
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldur	x8, [x29, #-88]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.7:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh14:
	adrp	x26, _CXD2880_IO_TGT_SYS@GOTPAGE
Lloh15:
	ldr	x26, [x26, _CXD2880_IO_TGT_SYS@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w8, w22
	mov	w8, #14
	cinc	w8, w8, eq
	str	w8, [x23]
	cmp	w19, #1
	b.lt	LBB0_15
; %bb.9:
	add	x25, x23, #12
	mov	w27, #255
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	cmp	w19, #255
	csel	w2, w19, w27, lo
	stp	w21, w2, [x23, #4]
	mov	x0, x25
	mov	x1, x20
	bl	_memcpy
	ldr	w8, [x26]
	cmp	w8, w22
	b.ne	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldrsw	x8, [x23, #8]
	add	x8, x23, x8, lsl #2
	str	wzr, [x8, #12]
	mov	w8, #4
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=1
	mov	w8, #3
LBB0_13:                                ;   in Loop: Header=BB0_10 Depth=1
	ldr	x9, [x24]
	ldr	w10, [x23, #8]
	add	w2, w10, w8
	mov	x0, x24
	mov	x1, x23
	blr	x9
	cbnz	w0, LBB0_6
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	ldrsw	x8, [x23, #8]
	add	w21, w8, w21
	add	x20, x20, x8, lsl #2
	sub	w19, w19, w8
	cmp	w19, #0
	b.gt	LBB0_10
	b	LBB0_6
LBB0_15:
	mov	w0, #0
	b	LBB0_6
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_BURST_WRITE_MAX,4,2            ; @BURST_WRITE_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CXD2880_IO_TGT_SYS,4,2         ; @CXD2880_IO_TGT_SYS
	.no_dead_strip	_cxd2880_io_spi_write_reg
.subsections_via_symbols
