	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mc13783_write
_mc13783_write:                         ## @mc13783_write
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$16, %rsp
	movq	_MC13783_MAX_REG_NUM@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jge	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_2:
	movq	_MC13783_WRITE_BIT_SHIFT@GOTPCREL(%rip), %rax
	movq	_MC13783_REG_NUM_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	movb	(%rax), %al
	movq	_MC13783_FRAME_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	btsl	%eax, %esi
	orl	%esi, %edx
	movl	%edx, -4(%rbp)
	movl	(%rdi), %edi
	leaq	-4(%rbp), %rsi
	movl	$4, %edx
	callq	_spi_rw
LBB0_3:
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MC13783_MAX_REG_NUM,4,2        ## @MC13783_MAX_REG_NUM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MC13783_WRITE_BIT_SHIFT,4,2    ## @MC13783_WRITE_BIT_SHIFT
	.comm	_MC13783_REG_NUM_SHIFT,4,2      ## @MC13783_REG_NUM_SHIFT
	.comm	_MC13783_FRAME_MASK,4,2         ## @MC13783_FRAME_MASK
	.no_dead_strip	_mc13783_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mc13783_write
_mc13783_write:                         ; @mc13783_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.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
Lloh0:
	adrp	x8, _MC13783_MAX_REG_NUM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MC13783_MAX_REG_NUM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ge	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _MC13783_WRITE_BIT_SHIFT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MC13783_WRITE_BIT_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mov	w9, #1
	lsl	w8, w9, w8
Lloh9:
	adrp	x9, _MC13783_REG_NUM_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _MC13783_REG_NUM_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	lsl	w9, w1, w9
Lloh12:
	adrp	x10, _MC13783_FRAME_MASK@GOTPAGE
Lloh13:
	ldr	x10, [x10, _MC13783_FRAME_MASK@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh14:
	ldr	w9, [x10]
	and	w9, w9, w2
	orr	w8, w9, w8
	stur	w8, [x29, #-4]
	ldr	w0, [x0]
	sub	x1, x29, #4
	mov	w2, #4
	bl	_spi_rw
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MC13783_MAX_REG_NUM,4,2        ; @MC13783_MAX_REG_NUM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MC13783_WRITE_BIT_SHIFT,4,2    ; @MC13783_WRITE_BIT_SHIFT
	.comm	_MC13783_REG_NUM_SHIFT,4,2      ; @MC13783_REG_NUM_SHIFT
	.comm	_MC13783_FRAME_MASK,4,2         ; @MC13783_FRAME_MASK
	.no_dead_strip	_mc13783_write
.subsections_via_symbols
