	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_CreateAsync               ## -- Begin function CARD_CreateAsync
	.p2align	4, 0x90
_CARD_CreateAsync:                      ## @CARD_CreateAsync
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movl	%edi, %r14d
	movq	$0, -48(%rbp)
	movq	%rsi, %rdi
	callq	_strlen
	movq	%rax, %r15
	movq	_CARD_FILENAMELEN@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jle	LBB0_2
## %bb.1:
	movq	_CARD_ERROR_NAMETOOLONG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_36
LBB0_2:
	leaq	-48(%rbp), %rsi
	movl	%r14d, %edi
	callq	___card_getcntrlblock
	testl	%eax, %eax
	js	LBB0_36
## %bb.3:
	testq	%rbx, %rbx
	jle	LBB0_8
## %bb.4:
	movq	-48(%rbp), %rdi
	movq	(%rdi), %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_5
## %bb.6:
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	LBB0_9
LBB0_8:
	movq	_CARD_ERROR_FATAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_36
LBB0_5:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	testq	%rdx, %rdx
	jne	LBB0_8
LBB0_9:
	callq	___card_getdirblock
	movq	_CARD_MAXFILES@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	jle	LBB0_15
## %bb.10:
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movq	(%rax), %r14
	movl	$-1, %ebx
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_11 Depth=1
	cmpl	$-1, %ebx
	cmovel	%r12d, %ebx
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r12
	addq	$32, %r14
	movq	_CARD_MAXFILES@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jge	LBB0_14
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	cmpl	$255, (%rax)
	je	LBB0_12
## %bb.16:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	8(%r14), %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_13
## %bb.17:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_card_gamecode@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpl	$255, (%rsi)
	je	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_card_company@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	$255, (%rax)
	je	LBB0_22
## %bb.19:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	(%r14), %rdi
	movl	$4, %edx
	xorl	%eax, %eax
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_13
## %bb.20:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_card_company@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	cmpl	$255, (%rsi)
	je	LBB0_13
## %bb.21:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	16(%r14), %rdi
	movl	$2, %edx
	xorl	%eax, %eax
	callq	_memcmp
	testq	%rax, %rax
	jne	LBB0_13
LBB0_22:
	movq	-48(%rbp), %rdi
	movq	_CARD_ERROR_EXIST@GOTPCREL(%rip), %rbx
	jmp	LBB0_25
LBB0_14:
	cmpl	$-1, %ebx
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_15
## %bb.23:
	movq	-48(%rbp), %rdi
	callq	___card_getbatblock
	movq	-48(%rbp), %rdi
	movq	(%rdi), %rcx
	movq	(%rax), %rax
	imulq	%rcx, %rax
	cmpq	%r14, %rax
	jge	LBB0_26
## %bb.24:
	movq	_CARD_ERROR_INSSPACE@GOTPCREL(%rip), %rbx
	jmp	LBB0_25
LBB0_15:
	movq	-48(%rbp), %rdi
	movq	_CARD_ERROR_NOENT@GOTPCREL(%rip), %rbx
LBB0_25:
	movl	(%rbx), %esi
	callq	___card_putcntrlblock
	movl	(%rbx), %eax
LBB0_36:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	jne	LBB0_28
## %bb.27:
	movq	___card_defaultapicallback@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_28:
	movq	%rax, 16(%rdi)
	movq	%r14, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_29
## %bb.30:
	movq	%r14, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_31
LBB0_29:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_31:
	movq	_CARD_FILENAMELEN@GOTPCREL(%rip), %rcx
	movslq	%ebx, %r14
	shlq	$5, %r14
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%rax, 24(%r12,%r14)
	movq	8(%r12,%r14), %rdi
	movq	(%rcx), %rdx
	xorl	%esi, %esi
	callq	_memset
	movq	8(%r12,%r14), %rdi
	incq	%r15
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_memcpy
	movq	-48(%rbp), %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, 8(%rax)
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, (%rcx)
	movl	%ebx, 4(%rcx)
	movq	(%rax), %rcx
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	%rdx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	movq	%rdx, %rax
	je	LBB0_32
## %bb.33:
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	jmp	LBB0_34
LBB0_32:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %esi
LBB0_34:
	movq	___card_createfatcallback@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	___card_allocblock
	movl	%eax, %ebx
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jns	LBB0_36
## %bb.35:
	movq	-48(%rbp), %rdi
	movl	%ebx, %esi
	callq	___card_putcntrlblock
	movl	%ebx, %eax
	jmp	LBB0_36
	.cfi_endproc
                                        ## -- End function
	.comm	_CARD_FILENAMELEN,8,3           ## @CARD_FILENAMELEN
	.comm	_CARD_ERROR_NAMETOOLONG,4,2     ## @CARD_ERROR_NAMETOOLONG
	.comm	_CARD_ERROR_FATAL_ERROR,4,2     ## @CARD_ERROR_FATAL_ERROR
	.comm	_CARD_MAXFILES,8,3              ## @CARD_MAXFILES
	.comm	_card_gamecode,8,3              ## @card_gamecode
	.comm	_card_company,8,3               ## @card_company
	.comm	_CARD_ERROR_EXIST,4,2           ## @CARD_ERROR_EXIST
	.comm	_CARD_ERROR_NOENT,4,2           ## @CARD_ERROR_NOENT
	.comm	_CARD_ERROR_INSSPACE,4,2        ## @CARD_ERROR_INSSPACE
	.comm	___card_defaultapicallback,8,3  ## @__card_defaultapicallback
	.comm	___card_createfatcallback,4,2   ## @__card_createfatcallback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_CreateAsync               ; -- Begin function CARD_CreateAsync
	.p2align	2
_CARD_CreateAsync:                      ; @CARD_CreateAsync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x4
	mov	x21, x3
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	str	xzr, [sp, #24]
	mov	x0, x1
	bl	_strlen
Lloh0:
	adrp	x25, _CARD_FILENAMELEN@GOTPAGE
Lloh1:
	ldr	x25, [x25, _CARD_FILENAMELEN@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.le	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _CARD_ERROR_NAMETOOLONG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CARD_ERROR_NAMETOOLONG@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	b	LBB0_23
LBB0_2:
	mov	x23, x0
	add	x1, sp, #24
	mov	x0, x20
	bl	___card_getcntrlblock
	tbnz	w0, #31, LBB0_23
; %bb.3:
	cmp	x19, #1
	b.lt	LBB0_5
; %bb.4:
	ldr	x0, [sp, #24]
	ldr	x8, [x0]
	sdiv	x9, x19, x8
	msub	x8, x9, x8, x19
	cbz	x8, LBB0_6
LBB0_5:
Lloh5:
	adrp	x8, _CARD_ERROR_FATAL_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CARD_ERROR_FATAL_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_23
LBB0_6:
	bl	___card_getdirblock
Lloh8:
	adrp	x8, _CARD_MAXFILES@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CARD_MAXFILES@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x8, #1
	b.lt	LBB0_21
; %bb.7:
	mov	x27, #0
	ldr	x28, [x0]
	mov	w26, #-1
	str	x28, [sp, #16]                  ; 8-byte Folded Spill
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=1
	cmn	w26, #1
	csel	w26, w27, w26, eq
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x27, x27, #1
Lloh11:
	adrp	x8, _CARD_MAXFILES@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CARD_MAXFILES@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	add	x28, x28, #32
	cmp	x27, x8
	b.ge	LBB0_18
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x28]
	ldr	w8, [x8]
	cmp	w8, #255
	b.eq	LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x0, [x28, #8]
	stp	x22, x23, [sp]
	bl	_memcmp
	cbnz	x0, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
Lloh14:
	adrp	x8, _card_gamecode@GOTPAGE
Lloh15:
	ldr	x8, [x8, _card_gamecode@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	ldr	w9, [x8]
	cmp	w9, #255
	b.eq	LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
Lloh17:
	adrp	x9, _card_company@GOTPAGE
Lloh18:
	ldr	x9, [x9, _card_company@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	ldr	w9, [x9]
	cmp	w9, #255
	b.eq	LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x0, [x28]
	mov	w9, #4
	stp	x8, x9, [sp]
	bl	_memcmp
	cbnz	x0, LBB0_9
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=1
Lloh20:
	adrp	x8, _card_company@GOTPAGE
Lloh21:
	ldr	x8, [x8, _card_company@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	ldr	w9, [x8]
	cmp	w9, #255
	b.eq	LBB0_9
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x0, [x28, #16]
	mov	w9, #2
	stp	x8, x9, [sp]
	bl	_memcmp
	cbnz	x0, LBB0_9
LBB0_17:
	ldr	x0, [sp, #24]
Lloh23:
	adrp	x19, _CARD_ERROR_EXIST@GOTPAGE
Lloh24:
	ldr	x19, [x19, _CARD_ERROR_EXIST@GOTPAGEOFF]
	b	LBB0_22
LBB0_18:
	cmn	w26, #1
	b.eq	LBB0_21
; %bb.19:
	ldr	x0, [sp, #24]
	bl	___card_getbatblock
	ldr	x9, [x0]
	ldr	x0, [sp, #24]
	ldr	x8, [x0]
	mul	x9, x8, x9
	cmp	x9, x19
	b.ge	LBB0_24
; %bb.20:
Lloh25:
	adrp	x19, _CARD_ERROR_INSSPACE@GOTPAGE
Lloh26:
	ldr	x19, [x19, _CARD_ERROR_INSSPACE@GOTPAGEOFF]
	b	LBB0_22
LBB0_21:
	ldr	x0, [sp, #24]
Lloh27:
	adrp	x19, _CARD_ERROR_NOENT@GOTPAGE
Lloh28:
	ldr	x19, [x19, _CARD_ERROR_NOENT@GOTPAGEOFF]
LBB0_22:
	ldr	w1, [x19]
	bl	___card_putcntrlblock
	ldr	w0, [x19]
LBB0_23:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_24:
Lloh29:
	adrp	x9, ___card_defaultapicallback@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___card_defaultapicallback@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x24, #0
	csel	x9, x9, x24, eq
	str	x9, [x0, #16]
	sdiv	x8, x19, x8
	sxtw	x9, w26
	ldr	x10, [sp, #16]                  ; 8-byte Folded Reload
	add	x24, x10, x9, lsl #5
	str	x8, [x24, #24]
	ldr	x0, [x24, #8]
	ldr	x2, [x25]
	mov	w1, #0
	bl	_memset
	ldr	x0, [x24, #8]
	add	x2, x23, #1
	mov	x1, x22
	bl	_memcpy
	ldr	x8, [sp, #24]
	str	x21, [x8, #8]
	stp	w20, w26, [x21]
	ldr	x8, [x8]
Lloh32:
	adrp	x9, ___card_createfatcallback@GOTPAGE
Lloh33:
	ldr	x9, [x9, ___card_createfatcallback@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x9]
	sdiv	x1, x19, x8
	mov	x0, x20
	bl	___card_allocblock
	mov	x19, x0
	mov	w0, #0
	tbz	w19, #31, LBB0_23
; %bb.25:
	ldr	x0, [sp, #24]
	mov	x1, x19
	bl	___card_putcntrlblock
	mov	x0, x19
	b	LBB0_23
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_CARD_FILENAMELEN,8,3           ; @CARD_FILENAMELEN
	.comm	_CARD_ERROR_NAMETOOLONG,4,2     ; @CARD_ERROR_NAMETOOLONG
	.comm	_CARD_ERROR_FATAL_ERROR,4,2     ; @CARD_ERROR_FATAL_ERROR
	.comm	_CARD_MAXFILES,8,3              ; @CARD_MAXFILES
	.comm	_card_gamecode,8,3              ; @card_gamecode
	.comm	_card_company,8,3               ; @card_company
	.comm	_CARD_ERROR_EXIST,4,2           ; @CARD_ERROR_EXIST
	.comm	_CARD_ERROR_NOENT,4,2           ; @CARD_ERROR_NOENT
	.comm	_CARD_ERROR_INSSPACE,4,2        ; @CARD_ERROR_INSSPACE
	.comm	___card_defaultapicallback,8,3  ; @__card_defaultapicallback
	.comm	___card_createfatcallback,4,2   ; @__card_createfatcallback
.subsections_via_symbols
