	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __c2port_read_flash_data
___c2port_read_flash_data:              ## @__c2port_read_flash_data
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	(%rdi), %rdx
	movq	8(%rdx), %rax
	imulq	(%rdx), %rax
	subq	%rbx, %rax
	jbe	LBB0_18
## %bb.1:
	cmpq	%rcx, %rax
	cmovbq	%rax, %rcx
	cmpq	$128, %rcx
	movl	$128, %r15d
	cmovbq	%rcx, %r15
	testq	%r15, %r15
	je	LBB0_18
## %bb.2:
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_C2PORT_FPDAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_c2port_write_ar
	movq	_C2PORT_BLOCK_READ@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_c2port_write_dr
	movq	%r12, %rdi
	callq	_c2port_poll_in_busy
	testl	%eax, %eax
	js	LBB0_17
## %bb.3:
	movq	%r12, %rdi
	callq	_c2port_poll_out_ready
	testl	%eax, %eax
	js	LBB0_17
## %bb.4:
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_c2port_read_dr
	testl	%eax, %eax
	js	LBB0_17
## %bb.5:
	movq	-48(%rbp), %rax
	movq	_C2PORT_COMMAND_OK@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_20
## %bb.6:
	movq	%rbx, %rsi
	shrq	$8, %rsi
	movq	%r12, %rdi
	callq	_c2port_write_dr
	movq	%r12, %rdi
	callq	_c2port_poll_in_busy
	testl	%eax, %eax
	js	LBB0_17
## %bb.7:
	movzbl	%bl, %esi
	movq	%r12, %rdi
	callq	_c2port_write_dr
	movq	%r12, %rdi
	callq	_c2port_poll_in_busy
	testl	%eax, %eax
	js	LBB0_17
## %bb.8:
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_c2port_write_dr
	movq	%r12, %rdi
	callq	_c2port_poll_in_busy
	testl	%eax, %eax
	js	LBB0_17
## %bb.9:
	movq	%r12, %rdi
	callq	_c2port_poll_out_ready
	testl	%eax, %eax
	js	LBB0_17
## %bb.10:
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_c2port_read_dr
	testl	%eax, %eax
	js	LBB0_17
## %bb.11:
	movq	-48(%rbp), %rax
	cmpq	(%r13), %rax
	jne	LBB0_20
## %bb.12:
	movq	%r15, %rbx
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_c2port_poll_out_ready
	testl	%eax, %eax
	js	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%r12, %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_c2port_read_dr
	testl	%eax, %eax
	js	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	incq	%r14
	decq	%rbx
	jne	LBB0_13
	jmp	LBB0_19
LBB0_18:
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_17:
	movslq	%eax, %r15
LBB0_19:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subq	(%rax), %r15
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_C2PORT_FPDAT,4,2               ## @C2PORT_FPDAT
	.comm	_C2PORT_BLOCK_READ,8,3          ## @C2PORT_BLOCK_READ
	.comm	_C2PORT_COMMAND_OK,8,3          ## @C2PORT_COMMAND_OK
	.comm	_EBUSY,8,3                      ## @EBUSY
	.no_dead_strip	___c2port_read_flash_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __c2port_read_flash_data
___c2port_read_flash_data:              ; @__c2port_read_flash_data
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	ldr	x8, [x0]
	ldp	x9, x8, [x8]
	mul	x8, x8, x9
	subs	x8, x8, x2
	b.ls	LBB0_16
; %bb.1:
	cmp	x8, x3
	csel	x8, x8, x3, lo
	mov	w9, #128
	cmp	x8, #128
	csel	x19, x8, x9, lo
	cbz	x19, LBB0_18
; %bb.2:
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _C2PORT_FPDAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _C2PORT_FPDAT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_c2port_write_ar
Lloh3:
	adrp	x8, _C2PORT_BLOCK_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _C2PORT_BLOCK_READ@GOTPAGEOFF]
Lloh5:
	ldr	x1, [x8]
	mov	x0, x21
	bl	_c2port_write_dr
	mov	x0, x21
	bl	_c2port_poll_in_busy
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.3:
	mov	x0, x21
	bl	_c2port_poll_out_ready
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.4:
	add	x8, sp, #8
	str	x8, [sp]
	mov	x0, x21
	bl	_c2port_read_dr
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.5:
	ldr	x8, [sp, #8]
Lloh6:
	adrp	x23, _C2PORT_COMMAND_OK@GOTPAGE
Lloh7:
	ldr	x23, [x23, _C2PORT_COMMAND_OK@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.6:
	lsr	x1, x22, #8
	mov	x0, x21
	bl	_c2port_write_dr
	mov	x0, x21
	bl	_c2port_poll_in_busy
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.7:
	and	x1, x22, #0xff
	mov	x0, x21
	bl	_c2port_write_dr
	mov	x0, x21
	bl	_c2port_poll_in_busy
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.8:
	mov	x0, x21
	mov	x1, x19
	bl	_c2port_write_dr
	mov	x0, x21
	bl	_c2port_poll_in_busy
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.9:
	mov	x0, x21
	bl	_c2port_poll_out_ready
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.10:
	add	x8, sp, #8
	str	x8, [sp]
	mov	x0, x21
	bl	_c2port_read_dr
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.11:
	ldr	x8, [sp, #8]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.12:
	mov	x22, x19
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_c2port_poll_out_ready
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	str	x20, [sp]
	mov	x0, x21
	bl	_c2port_read_dr
                                        ; kill: def $w0 killed $w0 def $x0
	tbnz	w0, #31, LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x20, x20, #1
	subs	x22, x22, #1
	b.ne	LBB0_13
	b	LBB0_18
LBB0_16:
	mov	x19, #0
	b	LBB0_18
LBB0_17:
	sxtw	x19, w0
LBB0_18:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
LBB0_19:
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_C2PORT_FPDAT,4,2               ; @C2PORT_FPDAT
	.comm	_C2PORT_BLOCK_READ,8,3          ; @C2PORT_BLOCK_READ
	.comm	_C2PORT_COMMAND_OK,8,3          ; @C2PORT_COMMAND_OK
	.comm	_EBUSY,8,3                      ; @EBUSY
	.no_dead_strip	___c2port_read_flash_data
.subsections_via_symbols
