	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rave_sp_eeprom_io
_rave_sp_eeprom_io:                     ## @rave_sp_eeprom_io
	.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
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_RAVE_SP_EEPROM_WRITE@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	cmpl	%esi, (%rax)
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	setne	-52(%rbp)                       ## 1-byte Folded Spill
	sete	%bl
	shll	$2, %ebx
	movl	(%rdi), %r13d
	addl	%ebx, %r13d
	movq	_RAVE_SP_EEPROM_HEADER_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	16(,%rax,4), %r14
	movq	%r14, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	xorl	%edi, %edi
	cmpq	%r13, %r14
	setb	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_9:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_2:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	xorl	%eax, %eax
	movb	-52(%rbp), %dl                  ## 1-byte Reload
	movb	%dl, %al
	leal	8(,%rax,4), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	4(%r12), %eax
	movl	%eax, (%r15)
	movl	$0, 4(%r15)
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, 8(%r15)
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, 12(%r15)
	movl	$4, %eax
	cmpl	$5, (%r12)
	jb	LBB0_4
## %bb.3:
	sarl	$8, %edx
	movl	%edx, 16(%r15)
	movl	$5, %eax
LBB0_4:
	leaq	(%r15,%rax,4), %rdi
	movl	8(%rcx), %esi
	movl	%ebx, %edx
	movq	%rcx, %rbx
	callq	_memcpy
	movl	8(%r12), %edi
	movq	%r15, %rsi
	movl	%r13d, %edx
	movq	%rbx, %rcx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	callq	_rave_sp_exec
	testl	%eax, %eax
	je	LBB0_5
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_12
## %bb.11:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	cmpl	%r14d, (%rbx)
	jne	LBB0_6
## %bb.7:
	xorl	%eax, %eax
	cmpl	$0, 4(%rbx)
	jne	LBB0_10
## %bb.8:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_6:
	movq	_EPROTO@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RAVE_SP_EEPROM_WRITE,4,2       ## @RAVE_SP_EEPROM_WRITE
	.comm	_RAVE_SP_EEPROM_HEADER_MAX,4,2  ## @RAVE_SP_EEPROM_HEADER_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EPROTO,4,2                     ## @EPROTO
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_rave_sp_eeprom_io
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rave_sp_eeprom_io
_rave_sp_eeprom_io:                     ; @rave_sp_eeprom_io
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x19, x3
	mov	x25, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _RAVE_SP_EEPROM_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RAVE_SP_EEPROM_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	w9, #12
	mov	w10, #8
	cmp	w8, w1
	csel	w22, w10, w9, eq
	cset	w8, eq
	lsl	w24, w8, #2
	ldr	w8, [x0]
	add	w23, w24, w8
Lloh6:
	adrp	x8, _RAVE_SP_EEPROM_HEADER_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RAVE_SP_EEPROM_HEADER_MAX@GOTPAGEOFF]
Lloh8:
	ldrsw	x8, [x8]
	lsl	x12, x8, #2
	add	x8, x12, #16
	mov	x9, x8
Lloh9:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh10:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x10, x12, #31
	and	x10, x10, #0xfffffffffffffff0
	sub	x26, x9, x10
	mov	sp, x26
	cmp	x8, x23
	cset	w0, lo
	bl	_WARN_ON
	cbz	x0, LBB0_3
; %bb.1:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_3:
	ldp	w9, w8, [x21]
	stp	w8, wzr, [x26]
	stp	w20, w25, [x26, #8]
	cmp	w9, #5
	b.lo	LBB0_5
; %bb.4:
	asr	w8, w25, #8
	str	w8, [x26, #16]
	mov	w8, #5
	b	LBB0_6
LBB0_5:
	mov	w8, #4
LBB0_6:
	add	x0, x26, x8, lsl #2
	ldr	w1, [x19, #8]
	mov	x2, x24
	bl	_memcpy
	ldr	w0, [x21, #8]
	mov	x1, x26
	mov	x2, x23
	mov	x3, x19
	mov	x4, x22
	bl	_rave_sp_exec
	cbz	w0, LBB0_9
LBB0_7:
	ldur	x8, [x29, #-72]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.8:
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_9:
	ldr	w8, [x19]
	cmp	w8, w20
	b.ne	LBB0_12
; %bb.10:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_13
; %bb.11:
	mov	w0, #0
	b	LBB0_7
LBB0_12:
Lloh16:
	adrp	x8, _EPROTO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
	b	LBB0_2
LBB0_13:
Lloh18:
	adrp	x8, _EIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_2
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_RAVE_SP_EEPROM_WRITE,4,2       ; @RAVE_SP_EEPROM_WRITE
	.comm	_RAVE_SP_EEPROM_HEADER_MAX,4,2  ; @RAVE_SP_EEPROM_HEADER_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EPROTO,4,2                     ; @EPROTO
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_rave_sp_eeprom_io
.subsections_via_symbols
