	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_Close                     ## -- Begin function CARD_Close
	.p2align	4, 0x90
_CARD_Close:                            ## @CARD_Close
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	$0, -16(%rbp)
	movl	(%rdi), %edi
	movq	_EXI_CHANNEL_0@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jl	LBB0_6
## %bb.1:
	movq	_EXI_CHANNEL_2@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jge	LBB0_6
## %bb.2:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	js	LBB0_7
## %bb.3:
	movq	_CARD_MAXFILES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_7
## %bb.4:
	leaq	-16(%rbp), %rsi
	callq	___card_getcntrlblock
	testl	%eax, %eax
	js	LBB0_9
## %bb.5:
	movl	$-1, (%rbx)
	movq	-16(%rbp), %rdi
	movq	_CARD_ERROR_READY@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	___card_putcntrlblock
	movl	(%rbx), %eax
	jmp	LBB0_9
LBB0_6:
	movq	_CARD_ERROR_NOCARD@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_CARD_ERROR_NOFILE@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EXI_CHANNEL_0,4,2              ## @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,4,2              ## @EXI_CHANNEL_2
	.comm	_CARD_ERROR_NOCARD,4,2          ## @CARD_ERROR_NOCARD
	.comm	_CARD_MAXFILES,8,3              ## @CARD_MAXFILES
	.comm	_CARD_ERROR_NOFILE,4,2          ## @CARD_ERROR_NOFILE
	.comm	_CARD_ERROR_READY,4,2           ## @CARD_ERROR_READY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_Close                     ; -- Begin function CARD_Close
	.p2align	2
_CARD_Close:                            ; @CARD_Close
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	str	xzr, [sp, #8]
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _EXI_CHANNEL_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXI_CHANNEL_0@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _EXI_CHANNEL_2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EXI_CHANNEL_2@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w0, w8
	ccmp	w0, w9, #0, ge
	b.lt	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _CARD_ERROR_NOCARD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CARD_ERROR_NOCARD@GOTPAGEOFF]
	b	LBB0_7
LBB0_2:
	ldr	x8, [x19, #8]
	tbnz	x8, #63, LBB0_6
; %bb.3:
Lloh8:
	adrp	x9, _CARD_MAXFILES@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CARD_MAXFILES@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_6
; %bb.4:
	add	x1, sp, #8
	bl	___card_getcntrlblock
	tbnz	w0, #31, LBB0_8
; %bb.5:
	mov	w8, #-1
	str	w8, [x19]
	ldr	x0, [sp, #8]
Lloh11:
	adrp	x19, _CARD_ERROR_READY@GOTPAGE
Lloh12:
	ldr	x19, [x19, _CARD_ERROR_READY@GOTPAGEOFF]
	ldr	w1, [x19]
	bl	___card_putcntrlblock
	ldr	w0, [x19]
	b	LBB0_8
LBB0_6:
Lloh13:
	adrp	x8, _CARD_ERROR_NOFILE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CARD_ERROR_NOFILE@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EXI_CHANNEL_0,4,2              ; @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,4,2              ; @EXI_CHANNEL_2
	.comm	_CARD_ERROR_NOCARD,4,2          ; @CARD_ERROR_NOCARD
	.comm	_CARD_MAXFILES,8,3              ; @CARD_MAXFILES
	.comm	_CARD_ERROR_NOFILE,4,2          ; @CARD_ERROR_NOFILE
	.comm	_CARD_ERROR_READY,4,2           ; @CARD_ERROR_READY
.subsections_via_symbols
