	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __card_multiwritestop
___card_multiwritestop:                 ## @__card_multiwritestop
	.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	$136, %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_19
## %bb.1:
	movq	%rdi, %rbx
	movq	_MAX_DRIVE@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jle	LBB0_19
## %bb.2:
	movq	__ioClrFlag@GOTPCREL(%rip), %r13
	movd	(%r13), %xmm0                   ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movdqa	%xmm0, -176(%rbp)
	movdqa	%xmm0, -160(%rbp)
	movdqa	%xmm0, -144(%rbp)
	movdqa	%xmm0, -128(%rbp)
	movdqa	%xmm0, -112(%rbp)
	movdqa	%xmm0, -96(%rbp)
	movdqa	%xmm0, -80(%rbp)
	movdqa	%xmm0, -64(%rbp)
	movq	%rbx, %rdi
	callq	___exi_wait
	movq	_EXI_DEVICE_0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	__ioCardFreq@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_EXI_Select
	testq	%rax, %rax
	je	LBB0_18
## %bb.3:
	movq	__ioWPFlag@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movl	$253, %eax
	movl	$2, %ecx
	cmovel	%eax, %ecx
	movl	%ecx, -176(%rbp)
	movq	_EXI_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-176(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_17
## %bb.4:
	movl	(%r13), %eax
	movl	%eax, -176(%rbp)
	movq	_EXI_READWRITE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leaq	-176(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_17
## %bb.5:
	movl	(%r13), %eax
	movl	%eax, -176(%rbp)
	movl	(%r12), %ecx
	leaq	-176(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_17
## %bb.6:
	movl	(%r13), %eax
	movl	%eax, -176(%rbp)
	movl	(%r12), %ecx
	leaq	-176(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_17
## %bb.7:
	movl	(%r13), %eax
	movl	%eax, -176(%rbp)
	movl	(%r12), %ecx
	leaq	-176(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_17
## %bb.8:
	xorl	%eax, %eax
	callq	_gettick
	movq	%rax, %r15
	movq	_CARDIO_ERROR_READY@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, -176(%rbp)
	jne	LBB0_16
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movl	(%r13), %eax
	movl	%eax, -176(%rbp)
	movl	(%r12), %ecx
	movq	%rbx, %rdi
	leaq	-176(%rbp), %rsi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	cmpl	$0, -176(%rbp)
	jne	LBB0_16
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$1500, %edx                     ## imm = 0x5DC
	callq	___card_checktimeout
	testq	%rax, %rax
	je	LBB0_9
## %bb.13:
	movl	(%r13), %eax
	movl	%eax, -176(%rbp)
	movl	(%r12), %ecx
	leaq	-176(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_EXI_ImmEx
	testq	%rax, %rax
	je	LBB0_17
## %bb.14:
	cmpl	$0, -176(%rbp)
	jne	LBB0_16
## %bb.15:
	movq	_CARDIO_ERROR_IOTIMEOUT@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
LBB0_16:
	movq	%rbx, %rdi
	callq	_EXI_Deselect
	movq	%rbx, %rdi
	callq	_EXI_Unlock
	jmp	LBB0_21
LBB0_17:
	movq	%rbx, %rdi
	callq	_EXI_Deselect
	movq	%rbx, %rdi
	callq	_EXI_Unlock
	movq	_CARDIO_ERROR_IOERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_18:
	movq	%rbx, %rdi
	callq	_EXI_Unlock
LBB0_19:
	movq	_CARDIO_ERROR_NOCARD@GOTPCREL(%rip), %rax
LBB0_20:
	movq	(%rax), %r14
LBB0_21:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_23
## %bb.22:
	movq	%r14, %rax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_23:
	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	__ioClrFlag,4,2                 ## @_ioClrFlag
	.comm	_EXI_DEVICE_0,4,2               ## @EXI_DEVICE_0
	.comm	__ioCardFreq,4,2                ## @_ioCardFreq
	.comm	_CARDIO_ERROR_READY,8,3         ## @CARDIO_ERROR_READY
	.comm	__ioWPFlag,8,3                  ## @_ioWPFlag
	.comm	_EXI_WRITE,4,2                  ## @EXI_WRITE
	.comm	_CARDIO_ERROR_IOERROR,8,3       ## @CARDIO_ERROR_IOERROR
	.comm	_EXI_READWRITE,4,2              ## @EXI_READWRITE
	.comm	_CARDIO_ERROR_IOTIMEOUT,8,3     ## @CARDIO_ERROR_IOTIMEOUT
	.no_dead_strip	___card_multiwritestop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __card_multiwritestop
___card_multiwritestop:                 ; @__card_multiwritestop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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]
	stur	x8, [x29, #-56]
	tbnz	x0, #63, LBB0_18
; %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_18
; %bb.2:
Lloh6:
	adrp	x22, __ioClrFlag@GOTPAGE
Lloh7:
	ldr	x22, [x22, __ioClrFlag@GOTPAGEOFF]
	ld1r.4s	{ v0 }, [x22]
	stp	q0, q0, [sp]
	stp	q0, q0, [sp, #32]
	stp	q0, q0, [sp, #64]
	stp	q0, q0, [sp, #96]
	mov	x0, x19
	bl	___exi_wait
Lloh8:
	adrp	x8, _EXI_DEVICE_0@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EXI_DEVICE_0@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, __ioCardFreq@GOTPAGE
Lloh12:
	ldr	x8, [x8, __ioCardFreq@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_EXI_Select
	cbz	x0, LBB0_17
; %bb.3:
Lloh14:
	adrp	x8, __ioWPFlag@GOTPAGE
Lloh15:
	ldr	x8, [x8, __ioWPFlag@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x8, #0
	mov	w8, #2
	mov	w9, #253
	csel	w8, w9, w8, eq
	str	w8, [sp]
Lloh17:
	adrp	x8, _EXI_WRITE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EXI_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_16
; %bb.4:
	ldr	w8, [x22]
	str	w8, [sp]
Lloh20:
	adrp	x23, _EXI_READWRITE@GOTPAGE
Lloh21:
	ldr	x23, [x23, _EXI_READWRITE@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_16
; %bb.5:
	ldr	w8, [x22]
	str	w8, [sp]
	ldr	w3, [x23]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_16
; %bb.6:
	ldr	w8, [x22]
	str	w8, [sp]
	ldr	w3, [x23]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_16
; %bb.7:
	ldr	w8, [x22]
	str	w8, [sp]
	ldr	w3, [x23]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_16
; %bb.8:
	bl	_gettick
	mov	x21, x0
Lloh22:
	adrp	x8, _CARDIO_ERROR_READY@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CARDIO_ERROR_READY@GOTPAGEOFF]
Lloh24:
	ldr	x20, [x8]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp]
	cbnz	w8, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x22]
	str	w8, [sp]
	ldr	w3, [x23]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_16
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [sp]
	cbnz	w8, LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1500
	bl	___card_checktimeout
	cbz	x0, LBB0_9
; %bb.13:
	ldr	w8, [x22]
	str	w8, [sp]
	ldr	w3, [x23]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #1
	bl	_EXI_ImmEx
	cbz	x0, LBB0_16
; %bb.14:
	ldr	w8, [sp]
Lloh25:
	adrp	x9, _CARDIO_ERROR_IOTIMEOUT@GOTPAGE
Lloh26:
	ldr	x9, [x9, _CARDIO_ERROR_IOTIMEOUT@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	w8, #0
	csel	x20, x9, x20, eq
LBB0_15:
	mov	x0, x19
	bl	_EXI_Deselect
	mov	x0, x19
	bl	_EXI_Unlock
	b	LBB0_20
LBB0_16:
	mov	x0, x19
	bl	_EXI_Deselect
	mov	x0, x19
	bl	_EXI_Unlock
Lloh28:
	adrp	x8, _CARDIO_ERROR_IOERROR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _CARDIO_ERROR_IOERROR@GOTPAGEOFF]
	b	LBB0_19
LBB0_17:
	mov	x0, x19
	bl	_EXI_Unlock
LBB0_18:
Lloh30:
	adrp	x8, _CARDIO_ERROR_NOCARD@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CARDIO_ERROR_NOCARD@GOTPAGEOFF]
LBB0_19:
	ldr	x20, [x8]
LBB0_20:
	ldur	x8, [x29, #-56]
Lloh32:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	mov	x0, x20
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_DRIVE,8,3                  ; @MAX_DRIVE
	.comm	_CARDIO_ERROR_NOCARD,8,3        ; @CARDIO_ERROR_NOCARD
	.comm	__ioClrFlag,4,2                 ; @_ioClrFlag
	.comm	_EXI_DEVICE_0,4,2               ; @EXI_DEVICE_0
	.comm	__ioCardFreq,4,2                ; @_ioCardFreq
	.comm	_CARDIO_ERROR_READY,8,3         ; @CARDIO_ERROR_READY
	.comm	__ioWPFlag,8,3                  ; @_ioWPFlag
	.comm	_EXI_WRITE,4,2                  ; @EXI_WRITE
	.comm	_CARDIO_ERROR_IOERROR,8,3       ; @CARDIO_ERROR_IOERROR
	.comm	_EXI_READWRITE,4,2              ; @EXI_READWRITE
	.comm	_CARDIO_ERROR_IOTIMEOUT,8,3     ; @CARDIO_ERROR_IOTIMEOUT
	.no_dead_strip	___card_multiwritestop
.subsections_via_symbols
