	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_Init                      ## -- Begin function CARD_Init
	.p2align	4, 0x90
_CARD_Init:                             ## @CARD_Init
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_card_inited@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jne	LBB0_8
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_strlen
	cmpl	$4, %eax
	jg	LBB0_4
## %bb.3:
	movq	_card_gamecode@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	movl	$4, %edx
	callq	_memcpy
LBB0_4:
	testq	%r14, %r14
	je	LBB0_7
## %bb.5:
	movq	%r14, %rdi
	callq	_strlen
	cmpl	$2, %eax
	jg	LBB0_7
## %bb.6:
	movq	_card_company@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	movl	$2, %edx
	callq	_memcpy
LBB0_7:
	callq	__CPU_ISR_Disable
	xorl	%eax, %eax
	callq	_DSP_Init
	movq	_cardmap@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_CARD_ERROR_NOCARD@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movq	(%rbx), %rdi
	movl	%eax, 8(%rdi)
	addq	$4, %rdi
	callq	_LWP_InitQueue
	movq	(%rbx), %rdi
	callq	_SYS_CreateAlarm
	movl	(%r14), %eax
	movq	(%rbx), %rdi
	movl	%eax, 20(%rdi)
	addq	$16, %rdi
	callq	_LWP_InitQueue
	movq	(%rbx), %rdi
	addq	$12, %rdi
	callq	_SYS_CreateAlarm
	movq	_card_resetinfo@GOTPCREL(%rip), %rdi
	callq	_SYS_RegisterResetFunc
	movl	$1, (%r15)
	callq	__CPU_ISR_Restore
LBB0_8:
	movq	_CARD_ERROR_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_card_inited,4,2                ## @card_inited
	.comm	_CARD_ERROR_READY,4,2           ## @CARD_ERROR_READY
	.comm	_card_gamecode,4,2              ## @card_gamecode
	.comm	_card_company,4,2               ## @card_company
	.comm	_cardmap,8,3                    ## @cardmap
	.comm	_CARD_ERROR_NOCARD,4,2          ## @CARD_ERROR_NOCARD
	.comm	_card_resetinfo,4,2             ## @card_resetinfo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_Init                      ; -- Begin function CARD_Init
	.p2align	2
_CARD_Init:                             ; @CARD_Init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x21, _card_inited@GOTPAGE
Lloh1:
	ldr	x21, [x21, _card_inited@GOTPAGEOFF]
	ldr	w8, [x21]
	cbnz	w8, LBB0_8
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_strlen
	cmp	w0, #4
	b.gt	LBB0_4
; %bb.3:
Lloh2:
	adrp	x8, _card_gamecode@GOTPAGE
Lloh3:
	ldr	x8, [x8, _card_gamecode@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x20
	mov	w2, #4
	bl	_memcpy
LBB0_4:
	cbz	x19, LBB0_7
; %bb.5:
	mov	x0, x19
	bl	_strlen
	cmp	w0, #2
	b.gt	LBB0_7
; %bb.6:
Lloh5:
	adrp	x8, _card_company@GOTPAGE
Lloh6:
	ldr	x8, [x8, _card_company@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x19
	mov	w2, #2
	bl	_memcpy
LBB0_7:
	bl	__CPU_ISR_Disable
	bl	_DSP_Init
Lloh8:
	adrp	x19, _cardmap@GOTPAGE
Lloh9:
	ldr	x19, [x19, _cardmap@GOTPAGEOFF]
	ldr	x0, [x19]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh10:
	adrp	x20, _CARD_ERROR_NOCARD@GOTPAGE
Lloh11:
	ldr	x20, [x20, _CARD_ERROR_NOCARD@GOTPAGEOFF]
	ldr	w8, [x20]
	ldr	x9, [x19]
	str	w8, [x9, #8]
	add	x0, x9, #4
	bl	_LWP_InitQueue
	ldr	x0, [x19]
	bl	_SYS_CreateAlarm
	ldr	w8, [x20]
	ldr	x9, [x19]
	str	w8, [x9, #20]
	add	x0, x9, #16
	bl	_LWP_InitQueue
	ldr	x8, [x19]
	add	x0, x8, #12
	bl	_SYS_CreateAlarm
Lloh12:
	adrp	x0, _card_resetinfo@GOTPAGE
Lloh13:
	ldr	x0, [x0, _card_resetinfo@GOTPAGEOFF]
	bl	_SYS_RegisterResetFunc
	mov	w8, #1
	str	w8, [x21]
	bl	__CPU_ISR_Restore
LBB0_8:
Lloh14:
	adrp	x8, _CARD_ERROR_READY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CARD_ERROR_READY@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_card_inited,4,2                ; @card_inited
	.comm	_CARD_ERROR_READY,4,2           ; @CARD_ERROR_READY
	.comm	_card_gamecode,4,2              ; @card_gamecode
	.comm	_card_company,4,2               ; @card_company
	.comm	_cardmap,8,3                    ; @cardmap
	.comm	_CARD_ERROR_NOCARD,4,2          ; @CARD_ERROR_NOCARD
	.comm	_card_resetinfo,4,2             ; @card_resetinfo
.subsections_via_symbols
