	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AT91F_DataFlashRead            ## -- Begin function AT91F_DataFlashRead
	.p2align	4, 0x90
_AT91F_DataFlashRead:                   ## @AT91F_DataFlashRead
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_AT91F_SpiEnable
	movl	(%r13), %edi
	movq	_AT91C_DATAFLASH_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_AT91F_DataFlashWaitReady
	movq	_AT91C_DATAFLASH_OK@GOTPCREL(%rip), %rdx
	movl	$-1, %ecx
	cmpq	(%rdx), %rax
	jne	LBB0_8
## %bb.1:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_5
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$32768, %rbx                    ## imm = 0x8000
	movl	$32768, %r12d                   ## imm = 0x8000
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	cmovbq	%rbx, %r12
	movl	(%r13), %edi
	movq	_AT91C_DATAFLASH_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rbx
	movq	%rdx, %r13
	callq	_AT91F_DataFlashWaitReady
	movq	%r13, %rcx
	cmpq	(%r13), %rax
	jne	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %r15
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%r12, %rcx
	callq	_AT91F_DataFlashContinuousRead
	cmpq	(%r13), %rax
	jne	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdx
	addq	%r12, %r14
	addq	%r12, %rbx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	subq	%r12, %rbx
	movq	%r15, %r13
	jne	LBB0_2
LBB0_5:
	movq	%rax, %rcx
	jmp	LBB0_8
LBB0_7:
	movl	$-1, %ecx
LBB0_8:
	movl	%ecx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AT91C_DATAFLASH_TIMEOUT,4,2    ## @AT91C_DATAFLASH_TIMEOUT
	.comm	_AT91C_DATAFLASH_OK,8,3         ## @AT91C_DATAFLASH_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AT91F_DataFlashRead            ; -- Begin function AT91F_DataFlashRead
	.p2align	2
_AT91F_DataFlashRead:                   ; @AT91F_DataFlashRead
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_AT91F_SpiEnable
	ldr	w0, [x22]
Lloh0:
	adrp	x24, _AT91C_DATAFLASH_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _AT91C_DATAFLASH_TIMEOUT@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_AT91F_DataFlashWaitReady
Lloh2:
	adrp	x25, _AT91C_DATAFLASH_OK@GOTPAGE
Lloh3:
	ldr	x25, [x25, _AT91C_DATAFLASH_OK@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.1:
	cbz	x20, LBB0_7
; %bb.2:
	mov	w26, #32768
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x20, #8, lsl #12                ; =32768
	csel	x23, x20, x26, lo
	ldr	w0, [x22]
	ldr	w1, [x24]
	bl	_AT91F_DataFlashWaitReady
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x19
	mov	x3, x23
	bl	_AT91F_DataFlashContinuousRead
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x21, x23, x21
	add	x19, x19, x23
	subs	x20, x20, x23
	b.ne	LBB0_3
	b	LBB0_7
LBB0_6:
	mov	w0, #-1
LBB0_7:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_AT91C_DATAFLASH_TIMEOUT,4,2    ; @AT91C_DATAFLASH_TIMEOUT
	.comm	_AT91C_DATAFLASH_OK,8,3         ; @AT91C_DATAFLASH_OK
.subsections_via_symbols
