	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rave_sp_eeprom_access
_rave_sp_eeprom_access:                 ## @rave_sp_eeprom_access
	.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, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %ebx
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_mutex_lock
	movq	_RAVE_SP_EEPROM_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	(%rcx)
	movl	%edx, %r13d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	callq	_unlikely
	movq	%rax, %r15
	testq	%rax, %rax
	movq	_RAVE_SP_EEPROM_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %eax
	movl	$0, %ecx
	cmovel	%ecx, %eax
	subl	%eax, %edi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_min
	movl	%eax, %r12d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movl	%ebx, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, %r8d
	callq	_rave_sp_eeprom_page_access
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testq	%r15, %r15
	movl	$0, %eax
	cmovnel	%eax, %r13d
	addl	%r12d, %ebx
	movl	%r12d, %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	subl	%r12d, -44(%rbp)                ## 4-byte Folded Spill
	jne	LBB0_1
LBB0_3:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RAVE_SP_EEPROM_PAGE_SIZE,4,2   ## @RAVE_SP_EEPROM_PAGE_SIZE
	.no_dead_strip	_rave_sp_eeprom_access
.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_access
_rave_sp_eeprom_access:                 ; @rave_sp_eeprom_access
	.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
	mov	x19, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x20, x0
	bl	_mutex_lock
Lloh0:
	adrp	x28, _RAVE_SP_EEPROM_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _RAVE_SP_EEPROM_PAGE_SIZE@GOTPAGEOFF]
	ldr	w8, [x28]
	udiv	w9, w22, w8
	msub	w24, w9, w8, w22
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_unlikely
	mov	x26, x0
	ldr	w8, [x28]
	cmp	x0, #0
	csel	w9, wzr, w24, eq
	sub	w0, w8, w9
	mov	x1, x19
	bl	_min
	mov	x27, x0
	mov	x0, x20
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	mov	x4, x27
	bl	_rave_sp_eeprom_page_access
	mov	x25, x0
	cbnz	w0, LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	x26, #0
	csel	w24, w24, wzr, eq
	add	w22, w27, w22
	add	x21, x21, w27, uxtw #2
	subs	w19, w19, w27
	b.ne	LBB0_1
LBB0_3:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x25
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_RAVE_SP_EEPROM_PAGE_SIZE,4,2   ; @RAVE_SP_EEPROM_PAGE_SIZE
	.no_dead_strip	_rave_sp_eeprom_access
.subsections_via_symbols
