	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function at25_ee_read
_at25_ee_read:                          ## @at25_ee_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	%rcx, %rbx
	movq	%rdx, %r12
	movl	%esi, %r14d
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_EE_MAXADDRLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	xorl	%edi, %edi
	cmpl	%r14d, 16(%r13)
	setbe	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	%r12, -104(%rbp)                ## 8-byte Spill
	movl	%r14d, %eax
	addq	%rbx, %rax
	movl	16(%r13), %ecx
	movl	%ecx, %r12d
	subl	%r14d, %r12d
	cmpq	%rcx, %rax
	cmovbeq	%rbx, %r12
	xorl	%edi, %edi
	testq	%r12, %r12
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_AT25_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_EE_INSTR_BIT3_IS_ADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	(%r13), %edx
	testl	%ecx, 20(%r13)
	je	LBB0_6
## %bb.4:
	leal	(,%rdx,8), %ecx
	movl	%r14d, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shrl	%cl, %esi
	testl	%esi, %esi
	je	LBB0_6
## %bb.5:
	movq	_AT25_INSTR_BIT3@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
LBB0_6:
	leaq	4(%r15), %rcx
	movl	%eax, (%r15)
	cmpl	$2, %edx
	jb	LBB0_10
## %bb.7:
	je	LBB0_9
## %bb.8:
	movl	%r14d, %eax
	shrl	$16, %eax
	movq	%r15, %rcx
	addq	$8, %rcx
	movl	%eax, 4(%r15)
LBB0_9:
	movl	%r14d, %eax
	shrl	$8, %eax
	movl	%eax, (%rcx)
	addq	$4, %rcx
LBB0_10:
	movl	%r14d, (%rcx)
	leaq	-112(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_spi_message_init
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	%r15, -80(%rbp)
	movl	(%r13), %eax
	incl	%eax
	movl	%eax, -96(%rbp)
	leaq	-96(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	leaq	-72(%rbp), %rdi
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	%rax, -64(%rbp)
	movl	%r12d, -72(%rbp)
	movq	%rbx, %rsi
	callq	_spi_message_add_tail
	leaq	4(%r13), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	8(%r13), %rdi
	movq	%rbx, %rsi
	callq	_spi_sync
	movl	%eax, %ebx
	movq	8(%r13), %rdi
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdx
	movl	%r14d, %ecx
	movl	%eax, %r8d
	callq	_dev_dbg
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_11
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EE_MAXADDRLEN,4,2              ## @EE_MAXADDRLEN
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AT25_READ,4,2                  ## @AT25_READ
	.comm	_EE_INSTR_BIT3_IS_ADDR,4,2      ## @EE_INSTR_BIT3_IS_ADDR
	.comm	_AT25_INSTR_BIT3,4,2            ## @AT25_INSTR_BIT3
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"read %zu bytes at %d --> %zd\n"

	.no_dead_strip	_at25_ee_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function at25_ee_read
_at25_ee_read:                          ; @at25_ee_read
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #64
	mov	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _EE_MAXADDRLEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EE_MAXADDRLEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w8, w8, #1
	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
	ldr	w8, [x0, #16]
	cmp	w8, w1
	cset	w0, ls
	bl	_unlikely
	cbnz	x0, LBB0_2
; %bb.1:
	add	x8, x22, w19, uxtw
	ldr	w9, [x20, #16]
	sub	w10, w9, w19
	cmp	x8, x9
	csel	x22, x10, x22, hi
	cmp	x22, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_5
LBB0_2:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_3:
	ldur	x8, [x29, #-56]
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_12
; %bb.4:
	mov	x0, x21
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh14:
	adrp	x8, _AT25_READ@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AT25_READ@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x8]
	ldr	w8, [x20, #20]
Lloh17:
	adrp	x10, _EE_INSTR_BIT3_IS_ADDR@GOTPAGE
Lloh18:
	ldr	x10, [x10, _EE_INSTR_BIT3_IS_ADDR@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	and	w8, w10, w8
	ldr	w10, [x20]
	cmp	w8, #0
	lsl	w8, w10, #3
	lsr	w8, w19, w8
	ccmp	w8, #0, #4, ne
	b.eq	LBB0_7
; %bb.6:
Lloh20:
	adrp	x8, _AT25_INSTR_BIT3@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AT25_INSTR_BIT3@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	orr	w9, w8, w9
LBB0_7:
	mov	x8, x23
	str	w9, [x8], #4
	cmp	w10, #2
	b.lo	LBB0_11
; %bb.8:
	b.eq	LBB0_10
; %bb.9:
	lsr	w9, w19, #16
	add	x8, x23, #8
	str	w9, [x23, #4]
LBB0_10:
	lsr	w9, w19, #8
	str	w9, [x8], #4
LBB0_11:
	str	w19, [x8]
	sub	x0, x29, #112
	bl	_spi_message_init
	sub	x24, x29, #104
	sub	x0, x29, #104
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	stur	x23, [x29, #-88]
	ldr	w8, [x20]
	add	w8, w8, #1
	stur	w8, [x29, #-104]
	sub	x0, x29, #104
	sub	x1, x29, #112
	bl	_spi_message_add_tail
	add	x0, x24, #24
	stur	x21, [x29, #-72]
	stur	w22, [x29, #-80]
	sub	x1, x29, #112
	bl	_spi_message_add_tail
	add	x23, x20, #4
	mov	x0, x23
	bl	_mutex_lock
	ldr	x0, [x20, #8]
	sub	x1, x29, #112
	bl	_spi_sync
	mov	x21, x0
	ldr	x0, [x20, #8]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	mov	x3, x19
	mov	x4, x21
	bl	_dev_dbg
	mov	x0, x23
	bl	_mutex_unlock
	b	LBB0_3
LBB0_12:
	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 AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_EE_MAXADDRLEN,4,2              ; @EE_MAXADDRLEN
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AT25_READ,4,2                  ; @AT25_READ
	.comm	_EE_INSTR_BIT3_IS_ADDR,4,2      ; @EE_INSTR_BIT3_IS_ADDR
	.comm	_AT25_INSTR_BIT3,4,2            ; @AT25_INSTR_BIT3
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"read %zu bytes at %d --> %zd\n"

	.no_dead_strip	_at25_ee_read
.subsections_via_symbols
