	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __card_dataread
___card_dataread:                       ## @__card_dataread
	.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_6
## %bb.1:
	movq	%rdi, %r12
	movq	_MAX_DRIVE@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jle	LBB0_6
## %bb.2:
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%r12, %rdi
	callq	___exi_wait
	movq	_EXI_DEVICE_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	__ioCardFreq@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_EXI_Select
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	_CARDIO_ERROR_READY@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	testq	%r14, %r14
	je	LBB0_23
## %bb.4:
	cmpq	$8, %r14
	jb	LBB0_5
## %bb.8:
	movq	__ioClrFlag@GOTPCREL(%rip), %rcx
	leaq	4(%rcx), %rax
	cmpq	%rax, %rbx
	jae	LBB0_11
## %bb.9:
	leaq	(%rbx,%r14,4), %rax
	cmpq	__ioClrFlag@GOTPCREL(%rip), %rax
	jbe	LBB0_11
LBB0_5:
	xorl	%eax, %eax
LBB0_17:
	movq	%rax, %rcx
	notq	%rcx
	addq	%r14, %rcx
	movq	%r14, %rdx
	andq	$3, %rdx
	je	LBB0_20
## %bb.18:
	movq	__ioClrFlag@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %edi
	movl	%edi, (%rbx,%rax,4)
	incq	%rax
	decq	%rdx
	jne	LBB0_19
LBB0_20:
	cmpq	$3, %rcx
	jb	LBB0_23
## %bb.21:
	movq	__ioClrFlag@GOTPCREL(%rip), %rcx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx), %edx
	movl	%edx, (%rbx,%rax,4)
	movl	(%rcx), %edx
	movl	%edx, 4(%rbx,%rax,4)
	movl	(%rcx), %edx
	movl	%edx, 8(%rbx,%rax,4)
	movl	(%rcx), %edx
	movl	%edx, 12(%rbx,%rax,4)
	addq	$4, %rax
	cmpq	%rax, %r14
	jne	LBB0_22
	jmp	LBB0_23
LBB0_6:
	movq	_CARDIO_ERROR_NOCARD@GOTPCREL(%rip), %rax
	jmp	LBB0_40
LBB0_7:
	movq	%r12, %rdi
	callq	_EXI_Unlock
	movq	_CARDIO_ERROR_NOCARD@GOTPCREL(%rip), %rax
	jmp	LBB0_40
LBB0_11:
	movq	%r14, %rax
	andq	$-8, %rax
	leaq	-8(%rax), %rsi
	movq	%rsi, %rdx
	shrq	$3, %rdx
	incq	%rdx
	testq	%rsi, %rsi
	je	LBB0_43
## %bb.12:
	movq	%rdx, %rdi
	andq	$-2, %rdi
	movd	(%rcx), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%rbx,%rsi,4)
	movdqu	%xmm0, 16(%rbx,%rsi,4)
	movdqu	%xmm0, 32(%rbx,%rsi,4)
	movdqu	%xmm0, 48(%rbx,%rsi,4)
	addq	$16, %rsi
	addq	$-2, %rdi
	jne	LBB0_13
## %bb.14:
	testb	$1, %dl
	je	LBB0_16
LBB0_15:
	movd	(%rcx), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movdqu	%xmm0, (%rbx,%rsi,4)
	movdqu	%xmm0, 16(%rbx,%rsi,4)
LBB0_16:
	cmpq	%r14, %rax
	jne	LBB0_17
LBB0_23:
	movq	_EXI_READWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_39
## %bb.24:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_gettick
	movq	%rax, %r13
	movq	__ioClrFlag@GOTPCREL(%rip), %rax
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$254, (%rbx)
	je	LBB0_32
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	%rax, %r15
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	_EXI_READWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_39
## %bb.27:                              ##   in Loop: Header=BB0_25 Depth=1
	cmpl	$254, (%rbx)
	je	LBB0_33
## %bb.28:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	$1500, %edx                     ## imm = 0x5DC
	callq	___card_checktimeout
	testq	%rax, %rax
	movq	%r15, %rax
	je	LBB0_25
## %bb.29:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	_EXI_READWRITE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_39
## %bb.30:
	cmpl	$254, (%rbx)
	je	LBB0_34
## %bb.31:
	movq	_CARDIO_ERROR_IOTIMEOUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_34
LBB0_32:
	movq	_EXI_READWRITE@GOTPCREL(%rip), %r13
	jmp	LBB0_35
LBB0_33:
	movq	_EXI_READWRITE@GOTPCREL(%rip), %r13
LBB0_34:
	movq	%r15, %rax
LBB0_35:
	movq	%rax, %r15
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movl	(%r13), %ecx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_39
## %bb.36:
	movl	$1, %edi
	callq	_usleep
	movl	(%r15), %eax
	movl	%eax, -52(%rbp)
	movl	%eax, -56(%rbp)
	movl	(%r13), %ecx
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	movl	$2, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_39
## %bb.37:
	movl	-56(%rbp), %eax
	shll	$8, %eax
	movzwl	%ax, %eax
	movzbl	-52(%rbp), %r15d
	orl	%eax, %r15d
	movq	%r12, %rdi
	callq	_EXI_Deselect
	movq	%r12, %rdi
	callq	_EXI_Unlock
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	___make_crc16
	cmpl	%r15d, %eax
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_41
## %bb.38:
	movq	_CARDIO_OP_IOERR_CRC@GOTPCREL(%rip), %rax
	jmp	LBB0_40
LBB0_39:
	movq	%r12, %rdi
	callq	_EXI_Deselect
	movq	%r12, %rdi
	callq	_EXI_Unlock
	movq	_CARDIO_ERROR_IOERROR@GOTPCREL(%rip), %rax
LBB0_40:
	movq	(%rax), %rax
LBB0_41:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_44
## %bb.42:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_43:
	xorl	%esi, %esi
	testb	$1, %dl
	jne	LBB0_15
	jmp	LBB0_16
LBB0_44:
	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	_EXI_DEVICE_0,4,2               ## @EXI_DEVICE_0
	.comm	__ioCardFreq,4,2                ## @_ioCardFreq
	.comm	_CARDIO_ERROR_READY,8,3         ## @CARDIO_ERROR_READY
	.comm	__ioClrFlag,4,2                 ## @_ioClrFlag
	.comm	_EXI_READWRITE,4,2              ## @EXI_READWRITE
	.comm	_CARDIO_ERROR_IOERROR,8,3       ## @CARDIO_ERROR_IOERROR
	.comm	_CARDIO_ERROR_IOTIMEOUT,8,3     ## @CARDIO_ERROR_IOTIMEOUT
	.comm	_CARDIO_OP_IOERR_CRC,8,3        ## @CARDIO_OP_IOERR_CRC
	.no_dead_strip	___card_dataread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __card_dataread
___card_dataread:                       ; @__card_dataread
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	tbnz	x0, #63, LBB0_23
; %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_23
; %bb.2:
	mov	x20, x2
	mov	x21, x1
	mov	x0, x19
	bl	___exi_wait
Lloh6:
	adrp	x8, _EXI_DEVICE_0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EXI_DEVICE_0@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, __ioCardFreq@GOTPAGE
Lloh10:
	ldr	x8, [x8, __ioCardFreq@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_EXI_Select
	cbz	x0, LBB0_22
; %bb.3:
Lloh12:
	adrp	x8, _CARDIO_ERROR_READY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CARDIO_ERROR_READY@GOTPAGEOFF]
Lloh14:
	ldr	x23, [x8]
Lloh15:
	adrp	x24, __ioClrFlag@GOTPAGE
Lloh16:
	ldr	x24, [x24, __ioClrFlag@GOTPAGEOFF]
	cbz	x20, LBB0_10
; %bb.4:
	cmp	x20, #16
	b.lo	LBB0_7
; %bb.5:
	add	x8, x24, #4
	cmp	x21, x8
	b.hs	LBB0_27
; %bb.6:
	add	x8, x21, x20, lsl #2
	cmp	x8, x24
	b.ls	LBB0_27
LBB0_7:
	mov	x8, #0
LBB0_8:
	sub	x9, x20, x8
	add	x8, x21, x8, lsl #2
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x24]
	str	w10, [x8], #4
	subs	x9, x9, #1
	b.ne	LBB0_9
LBB0_10:
Lloh17:
	adrp	x25, _EXI_READWRITE@GOTPAGE
Lloh18:
	ldr	x25, [x25, _EXI_READWRITE@GOTPAGEOFF]
	ldr	w3, [x25]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_21
; %bb.11:
	bl	_gettick
	mov	x22, x0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21]
	cmp	w8, #254
	b.eq	LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x24]
	str	w8, [x21]
	ldr	w3, [x25]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_21
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x21]
	cmp	w8, #254
	b.eq	LBB0_18
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	w2, #1500
	bl	___card_checktimeout
	cbz	x0, LBB0_12
; %bb.16:
	ldr	w8, [x24]
	str	w8, [x21]
	ldr	w3, [x25]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_21
; %bb.17:
	ldr	w8, [x21]
Lloh19:
	adrp	x9, _CARDIO_ERROR_IOTIMEOUT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _CARDIO_ERROR_IOTIMEOUT@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	w8, #254
	csel	x23, x23, x9, eq
LBB0_18:
	ldr	w8, [x24]
	str	w8, [x21]
	ldr	w3, [x25]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_EXI_ImmEx
	cbz	x0, LBB0_21
; %bb.19:
	mov	w0, #1
	bl	_usleep
	ldr	w8, [x24]
	stp	w8, w8, [sp]
	ldr	w3, [x25]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #2
	bl	_EXI_ImmEx
	cbz	x0, LBB0_21
; %bb.20:
	ldr	w8, [sp]
	ldrb	w22, [sp, #4]
	bfi	w22, w8, #8, #8
	mov	x0, x19
	bl	_EXI_Deselect
	mov	x0, x19
	bl	_EXI_Unlock
	mov	x0, x21
	mov	x1, x20
	bl	___make_crc16
Lloh22:
	adrp	x8, _CARDIO_OP_IOERR_CRC@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CARDIO_OP_IOERR_CRC@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cmp	w0, w22
	csel	x0, x23, x8, eq
	b	LBB0_25
LBB0_21:
	mov	x0, x19
	bl	_EXI_Deselect
	mov	x0, x19
	bl	_EXI_Unlock
Lloh25:
	adrp	x8, _CARDIO_ERROR_IOERROR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CARDIO_ERROR_IOERROR@GOTPAGEOFF]
	b	LBB0_24
LBB0_22:
	mov	x0, x19
	bl	_EXI_Unlock
LBB0_23:
Lloh27:
	adrp	x8, _CARDIO_ERROR_NOCARD@GOTPAGE
Lloh28:
	ldr	x8, [x8, _CARDIO_ERROR_NOCARD@GOTPAGEOFF]
LBB0_24:
	ldr	x0, [x8]
LBB0_25:
	ldr	x8, [sp, #8]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_30
; %bb.26:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_27:
	and	x8, x20, #0xfffffffffffffff0
	ld1r.4s	{ v0 }, [x24]
	add	x9, x21, #32
	mov	x10, x8
LBB0_28:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x9, #-32]
	stp	q0, q0, [x9], #64
	subs	x10, x10, #16
	b.ne	LBB0_28
; %bb.29:
	cmp	x8, x20
	b.eq	LBB0_10
	b	LBB0_8
LBB0_30:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_DRIVE,8,3                  ; @MAX_DRIVE
	.comm	_CARDIO_ERROR_NOCARD,8,3        ; @CARDIO_ERROR_NOCARD
	.comm	_EXI_DEVICE_0,4,2               ; @EXI_DEVICE_0
	.comm	__ioCardFreq,4,2                ; @_ioCardFreq
	.comm	_CARDIO_ERROR_READY,8,3         ; @CARDIO_ERROR_READY
	.comm	__ioClrFlag,4,2                 ; @_ioClrFlag
	.comm	_EXI_READWRITE,4,2              ; @EXI_READWRITE
	.comm	_CARDIO_ERROR_IOERROR,8,3       ; @CARDIO_ERROR_IOERROR
	.comm	_CARDIO_ERROR_IOTIMEOUT,8,3     ; @CARDIO_ERROR_IOTIMEOUT
	.comm	_CARDIO_OP_IOERR_CRC,8,3        ; @CARDIO_OP_IOERR_CRC
	.no_dead_strip	___card_dataread
.subsections_via_symbols
