	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_SetStatusAsync            ## -- Begin function CARD_SetStatusAsync
	.p2align	4, 0x90
_CARD_SetStatusAsync:                   ## @CARD_SetStatusAsync
	.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	$0, -48(%rbp)
	movq	_EXI_CHANNEL_0@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jg	LBB0_8
## %bb.1:
	movq	%rdi, %r13
	movq	_EXI_CHANNEL_2@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jle	LBB0_8
## %bb.2:
	movq	%rsi, %r12
	testq	%rsi, %rsi
	js	LBB0_7
## %bb.3:
	movq	_CARD_MAXFILES@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	jle	LBB0_7
## %bb.4:
	movl	%ecx, %r14d
	movq	%rdx, %r15
	movl	(%rdx), %eax
	cmpl	$-1, %eax
	je	LBB0_6
## %bb.5:
	movq	_CARD_READSIZE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_7
LBB0_6:
	cmpl	$8129, 4(%r15)                  ## imm = 0x1FC1
	jl	LBB0_11
LBB0_7:
	movq	_CARD_ERROR_FATAL_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_CARD_ERROR_NOCARD@GOTPCREL(%rip), %rax
LBB0_9:
	movq	(%rax), %rbx
LBB0_10:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdi
	callq	___card_getcntrlblock
	testq	%rax, %rax
	js	LBB0_17
## %bb.12:
	movq	_CARD_ERROR_BROKEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	-48(%rbp), %rdi
	callq	___card_getdirblock
	testq	%rax, %rax
	je	LBB0_16
## %bb.13:
	movq	(%rax), %rcx
	leaq	(%r12,%r12,2), %rbx
	leaq	(%rcx,%rbx,8), %rdi
	movl	16(%r15), %eax
	movl	%eax, 20(%rcx,%rbx,8)
	movl	(%r15), %eax
	movl	%eax, (%rcx,%rbx,8)
	movl	8(%r15), %eax
	movl	%eax, 4(%rcx,%rbx,8)
	movl	12(%r15), %eax
	movl	%eax, 16(%rcx,%rbx,8)
	movl	4(%r15), %eax
	movl	%eax, 8(%rcx,%rbx,8)
	movq	%r15, %rsi
	movq	%rcx, %r15
	callq	___card_updateiconoffsets
	cmpl	$-1, (%r15,%rbx,8)
	jne	LBB0_15
## %bb.14:
	leaq	(%r15,%rbx,8), %rax
	addq	$4, %rax
	movq	_CARD_ICON_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	(%rax), %ecx
	movq	_CARD_ICON_CI@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, (%rax)
LBB0_15:
	xorl	%edi, %edi
	callq	_time
	movl	%eax, 12(%r15,%rbx,8)
	movq	%r13, %rdi
	movl	%r14d, %esi
	callq	___card_updatedir
	movq	%rax, %rbx
	testq	%rax, %rax
	jns	LBB0_10
LBB0_16:
	movq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	callq	___card_putcntrlblock
LBB0_17:
	movq	%rax, %rbx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_EXI_CHANNEL_0,8,3              ## @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,8,3              ## @EXI_CHANNEL_2
	.comm	_CARD_ERROR_NOCARD,8,3          ## @CARD_ERROR_NOCARD
	.comm	_CARD_MAXFILES,8,3              ## @CARD_MAXFILES
	.comm	_CARD_ERROR_FATAL_ERROR,8,3     ## @CARD_ERROR_FATAL_ERROR
	.comm	_CARD_READSIZE,4,2              ## @CARD_READSIZE
	.comm	_CARD_ERROR_BROKEN,8,3          ## @CARD_ERROR_BROKEN
	.comm	_CARD_ICON_MASK,4,2             ## @CARD_ICON_MASK
	.comm	_CARD_ICON_CI,4,2               ## @CARD_ICON_CI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_SetStatusAsync            ; -- Begin function CARD_SetStatusAsync
	.p2align	2
_CARD_SetStatusAsync:                   ; @CARD_SetStatusAsync
	.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
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _EXI_CHANNEL_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXI_CHANNEL_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EXI_CHANNEL_2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EXI_CHANNEL_2@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x0
	ccmp	x9, x0, #4, le
	b.gt	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _CARD_ERROR_NOCARD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CARD_ERROR_NOCARD@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
	mov	x21, x1
	tbnz	x1, #63, LBB0_6
; %bb.3:
Lloh8:
	adrp	x8, _CARD_MAXFILES@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CARD_MAXFILES@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x8, x21
	b.le	LBB0_6
; %bb.4:
	mov	x22, x2
	ldr	w8, [x2]
Lloh11:
	adrp	x9, _CARD_READSIZE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CARD_READSIZE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmn	w8, #1
	ccmp	w8, w9, #4, ne
	b.gt	LBB0_6
; %bb.5:
	ldr	w8, [x22, #4]
	mov	w9, #8129
	cmp	w8, w9
	b.lt	LBB0_9
LBB0_6:
Lloh14:
	adrp	x8, _CARD_ERROR_FATAL_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CARD_ERROR_FATAL_ERROR@GOTPAGEOFF]
LBB0_7:
	ldr	x23, [x8]
LBB0_8:
	mov	x0, x23
	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_9:
	mov	x19, x3
	mov	x20, x0
	add	x1, sp, #8
	bl	___card_getcntrlblock
	tbnz	x0, #63, LBB0_15
; %bb.10:
Lloh16:
	adrp	x8, _CARD_ERROR_BROKEN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CARD_ERROR_BROKEN@GOTPAGEOFF]
Lloh18:
	ldr	x23, [x8]
	ldr	x0, [sp, #8]
	bl	___card_getdirblock
	cbz	x0, LBB0_14
; %bb.11:
	ldr	x24, [x0]
	mov	w8, #24
	madd	x23, x21, x8, x24
	ldr	w8, [x22]
	str	w8, [x23]
	ldur	d0, [x22, #12]
	str	d0, [x23, #16]
	ldur	d0, [x22, #4]
	rev64.2s	v0, v0
	mov	x25, x23
	str	d0, [x25, #4]!
	mov	x0, x23
	mov	x1, x22
	bl	___card_updateiconoffsets
	ldr	w8, [x23]
	cmn	w8, #1
	b.ne	LBB0_13
; %bb.12:
	ldr	w8, [x25]
Lloh19:
	adrp	x9, _CARD_ICON_MASK@GOTPAGE
Lloh20:
	ldr	x9, [x9, _CARD_ICON_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh22:
	adrp	x9, _CARD_ICON_CI@GOTPAGE
Lloh23:
	ldr	x9, [x9, _CARD_ICON_CI@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x25]
LBB0_13:
	mov	x0, #0
	bl	_time
	mov	w8, #24
	madd	x8, x21, x8, x24
	str	w0, [x8, #12]
	mov	x0, x20
	mov	x1, x19
	bl	___card_updatedir
	mov	x23, x0
	tbz	x0, #63, LBB0_8
LBB0_14:
	ldr	x0, [sp, #8]
	mov	x1, x23
	bl	___card_putcntrlblock
LBB0_15:
	mov	x23, x0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EXI_CHANNEL_0,8,3              ; @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,8,3              ; @EXI_CHANNEL_2
	.comm	_CARD_ERROR_NOCARD,8,3          ; @CARD_ERROR_NOCARD
	.comm	_CARD_MAXFILES,8,3              ; @CARD_MAXFILES
	.comm	_CARD_ERROR_FATAL_ERROR,8,3     ; @CARD_ERROR_FATAL_ERROR
	.comm	_CARD_READSIZE,4,2              ; @CARD_READSIZE
	.comm	_CARD_ERROR_BROKEN,8,3          ; @CARD_ERROR_BROKEN
	.comm	_CARD_ICON_MASK,4,2             ; @CARD_ICON_MASK
	.comm	_CARD_ICON_CI,4,2               ; @CARD_ICON_CI
.subsections_via_symbols
