	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sst25l_read
_sst25l_read:                           ## @sst25l_read
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r12
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_to_sst25l_flash
	testq	%r13, %r13
	je	LBB0_11
## %bb.1:
	movq	%rax, %r15
	leaq	(%rbx,%r13), %rax
	cmpq	8(%r15), %rax
	jbe	LBB0_3
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_3:
	testq	%r14, %r14
	je	LBB0_5
## %bb.4:
	movq	$0, (%r14)
LBB0_5:
	leaq	-104(%rbp), %rdi
	callq	_spi_message_init
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	_SST25L_CMD_READ@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -100(%rbp)
	movq	%rbx, %rax
	shrq	$16, %rax
	movb	%al, -99(%rbp)
	movb	%bh, -98(%rbp)
	movb	%bl, -97(%rbp)
	leaq	-100(%rbp), %rax
	movq	%rax, -96(%rbp)
	movl	$4, -88(%rbp)
	leaq	-96(%rbp), %rdi
	leaq	-104(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	leaq	-72(%rbp), %rdi
	movq	%r12, -56(%rbp)
	movl	%r13d, -64(%rbp)
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_sst25l_wait_till_ready
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_12
LBB0_7:
	movl	4(%r15), %edi
	leaq	-104(%rbp), %rsi
	callq	_spi_sync
	testq	%r14, %r14
	je	LBB0_10
## %bb.8:
	movl	-104(%rbp), %eax
	cmpl	$5, %eax
	jb	LBB0_10
## %bb.9:
	cltq
	movq	(%r14), %rcx
	addq	%rcx, %rax
	addq	$-4, %rax
	movq	%rax, (%r14)
LBB0_10:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_11:
	xorl	%ebx, %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
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SST25L_CMD_READ,1,0            ## @SST25L_CMD_READ
	.no_dead_strip	_sst25l_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sst25l_read
_sst25l_read:                           ; @sst25l_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x22, x4
	mov	x19, x3
	mov	x21, x2
	mov	x23, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	bl	_to_sst25l_flash
	cbz	x21, LBB0_11
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #8]
	add	x9, x21, x23
	cmp	x9, x8
	b.ls	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_3:
	cbz	x19, LBB0_5
; %bb.4:
	str	xzr, [x19]
LBB0_5:
	add	x0, sp, #16
	bl	_spi_message_init
	add	x24, sp, #24
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #48
	bl	_memset
Lloh6:
	adrp	x8, _SST25L_CMD_READ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SST25L_CMD_READ@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [sp, #12]
	lsr	x8, x23, #16
	strb	w8, [sp, #13]
	lsr	x8, x23, #8
	strb	w8, [sp, #14]
	strb	w23, [sp, #15]
	add	x8, sp, #12
	str	x8, [sp, #24]
	mov	w8, #4
	str	w8, [sp, #32]
	add	x0, sp, #24
	add	x1, sp, #16
	bl	_spi_message_add_tail
	add	x0, x24, #24
	str	x22, [sp, #64]
	str	w21, [sp, #56]
	add	x1, sp, #16
	bl	_spi_message_add_tail
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x20
	bl	_sst25l_wait_till_ready
	cbz	w0, LBB0_7
; %bb.6:
	mov	x21, x0
	mov	x0, x20
	bl	_mutex_unlock
	b	LBB0_11
LBB0_7:
	ldr	w0, [x20, #4]
	add	x1, sp, #16
	bl	_spi_sync
	cbz	x19, LBB0_10
; %bb.8:
	ldr	w8, [sp, #16]
	cmp	w8, #5
	b.lo	LBB0_10
; %bb.9:
	sxtw	x8, w8
	ldr	x9, [x19]
	add	x8, x8, x9
	sub	x8, x8, #4
	str	x8, [x19]
LBB0_10:
	mov	x0, x20
	bl	_mutex_unlock
	mov	w21, #0
LBB0_11:
	ldur	x8, [x29, #-56]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SST25L_CMD_READ,1,0            ; @SST25L_CMD_READ
	.no_dead_strip	_sst25l_read
.subsections_via_symbols
