	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sdgecko_readSectors            ## -- Begin function sdgecko_readSectors
	.p2align	4, 0x90
_sdgecko_readSectors:                   ## @sdgecko_readSectors
	.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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	testq	%rdi, %rdi
	js	LBB0_13
## %bb.1:
	movq	%rdi, %rbx
	movq	_MAX_DRIVE@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jle	LBB0_13
## %bb.2:
	movq	%rcx, %r14
	movl	%edx, %r15d
	movl	%esi, %r12d
	movq	%rbx, %rdi
	callq	_sdgecko_preIO
	testq	%rax, %rax
	jne	LBB0_15
## %bb.3:
	testl	%r15d, %r15d
	jle	LBB0_17
## %bb.4:
	movq	_PAGE_SIZE512@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	__ioPageSize@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	cmpq	(%rdx,%rbx,8), %rcx
	je	LBB0_6
## %bb.5:
	movq	%rcx, (%rdx,%rbx,8)
	movq	(%rax), %rsi
	movq	%rbx, %rdi
	callq	___card_setblocklen
	testq	%rax, %rax
	jne	LBB0_15
LBB0_6:
	leaq	-64(%rbp), %r13
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movq	%r13, %rdx
	callq	___convert_sector
	movq	%rbx, %rdi
	movl	$18, %esi
	movq	%r13, %rdx
	callq	___card_sendcmd
	testq	%rax, %rax
	jne	LBB0_15
## %bb.7:
	movq	%rbx, %rdi
	callq	___card_response1
	testq	%rax, %rax
	jne	LBB0_15
## %bb.8:
	movq	__ioPageSize@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdx
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	___card_dataread
	testq	%rax, %rax
	jne	LBB0_15
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdx
	addq	%rdx, %r14
	decl	%r15d
	jne	LBB0_9
## %bb.11:
	movq	%rbx, %rdi
	movl	$12, %esi
	xorl	%edx, %edx
	callq	___card_sendcmd
	testq	%rax, %rax
	jne	LBB0_15
## %bb.12:
	movq	%rbx, %rdi
	callq	___card_stopresponse
	jmp	LBB0_15
LBB0_13:
	movq	_CARDIO_ERROR_NOCARD@GOTPCREL(%rip), %rax
LBB0_14:
	movq	(%rax), %rax
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_18
## %bb.16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	_CARDIO_ERROR_INTERNAL@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_DRIVE,8,3                  ## @MAX_DRIVE
	.comm	_CARDIO_ERROR_NOCARD,8,3        ## @CARDIO_ERROR_NOCARD
	.comm	_CARDIO_ERROR_INTERNAL,8,3      ## @CARDIO_ERROR_INTERNAL
	.comm	_PAGE_SIZE512,8,3               ## @PAGE_SIZE512
	.comm	__ioPageSize,8,3                ## @_ioPageSize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sdgecko_readSectors            ; -- Begin function sdgecko_readSectors
	.p2align	2
_sdgecko_readSectors:                   ; @sdgecko_readSectors
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	tbnz	x0, #63, LBB0_13
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _MAX_DRIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_DRIVE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x0
	b.le	LBB0_13
; %bb.2:
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x0, x19
	bl	_sdgecko_preIO
	cbnz	x0, LBB0_15
; %bb.3:
	cmp	w21, #0
	b.le	LBB0_17
; %bb.4:
Lloh6:
	adrp	x8, _PAGE_SIZE512@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE512@GOTPAGEOFF]
	ldr	x9, [x8]
Lloh8:
	adrp	x23, __ioPageSize@GOTPAGE
Lloh9:
	ldr	x23, [x23, __ioPageSize@GOTPAGEOFF]
	ldr	x10, [x23]
	ldr	x11, [x10, x19, lsl #3]
	cmp	x9, x11
	b.eq	LBB0_6
; %bb.5:
	str	x9, [x10, x19, lsl #3]
	ldr	x1, [x8]
	mov	x0, x19
	bl	___card_setblocklen
	cbnz	x0, LBB0_15
LBB0_6:
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x22
	bl	___convert_sector
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #18
	bl	___card_sendcmd
	cbnz	x0, LBB0_15
; %bb.7:
	mov	x0, x19
	bl	___card_response1
	cbnz	x0, LBB0_15
; %bb.8:
	ldr	x8, [x23]
	ldr	x2, [x8, x19, lsl #3]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	___card_dataread
	cbnz	x0, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x23]
	ldr	x2, [x8, x19, lsl #3]
	add	x20, x20, x2
	subs	w21, w21, #1
	b.ne	LBB0_9
; %bb.11:
	mov	x0, x19
	mov	w1, #12
	mov	x2, #0
	bl	___card_sendcmd
	cbnz	x0, LBB0_15
; %bb.12:
	mov	x0, x19
	bl	___card_stopresponse
	b	LBB0_15
LBB0_13:
Lloh10:
	adrp	x8, _CARDIO_ERROR_NOCARD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CARDIO_ERROR_NOCARD@GOTPAGEOFF]
LBB0_14:
	ldr	x0, [x8]
LBB0_15:
	ldr	x8, [sp, #24]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.16:
	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
	add	sp, sp, #96
	ret
LBB0_17:
Lloh15:
	adrp	x8, _CARDIO_ERROR_INTERNAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CARDIO_ERROR_INTERNAL@GOTPAGEOFF]
	b	LBB0_14
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_DRIVE,8,3                  ; @MAX_DRIVE
	.comm	_CARDIO_ERROR_NOCARD,8,3        ; @CARDIO_ERROR_NOCARD
	.comm	_CARDIO_ERROR_INTERNAL,8,3      ; @CARDIO_ERROR_INTERNAL
	.comm	_PAGE_SIZE512,8,3               ; @PAGE_SIZE512
	.comm	__ioPageSize,8,3                ; @_ioPageSize
.subsections_via_symbols
