	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reset_card
_reset_card:                            ## @reset_card
	.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	%rbx, %rdi
	testl	%esi, %esi
	je	LBB0_3
## %bb.1:
	callq	_down_interruptible
	movq	%rax, %rcx
	movl	$-1, %eax
	testq	%rcx, %rcx
	jne	LBB0_5
## %bb.2:
	movq	%rbx, %rdi
	callq	_waitbusy
	movq	_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CMD_SOFTRESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_OUT4500
	movl	$200, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_waitbusy
	movl	$200, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_up
	jmp	LBB0_4
LBB0_3:
	callq	_waitbusy
	movq	_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CMD_SOFTRESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_OUT4500
	movl	$200, %edi
	callq	_msleep
	movq	%rbx, %rdi
	callq	_waitbusy
	movl	$200, %edi
	callq	_msleep
LBB0_4:
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COMMAND,4,2                    ## @COMMAND
	.comm	_CMD_SOFTRESET,4,2              ## @CMD_SOFTRESET
	.no_dead_strip	_reset_card
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reset_card
_reset_card:                            ; @reset_card
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x19, [x0]
	mov	x0, x19
	cbz	w1, LBB0_3
; %bb.1:
	bl	_down_interruptible
	cbz	x0, LBB0_4
; %bb.2:
	mov	w0, #-1
	b	LBB0_6
LBB0_3:
	bl	_waitbusy
Lloh0:
	adrp	x8, _COMMAND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _COMMAND@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _CMD_SOFTRESET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CMD_SOFTRESET@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_OUT4500
	mov	w0, #200
	bl	_msleep
	mov	x0, x19
	bl	_waitbusy
	mov	w0, #200
	bl	_msleep
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_waitbusy
Lloh6:
	adrp	x8, _COMMAND@GOTPAGE
Lloh7:
	ldr	x8, [x8, _COMMAND@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _CMD_SOFTRESET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CMD_SOFTRESET@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_OUT4500
	mov	w0, #200
	bl	_msleep
	mov	x0, x19
	bl	_waitbusy
	mov	w0, #200
	bl	_msleep
	mov	x0, x19
	bl	_up
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_COMMAND,4,2                    ; @COMMAND
	.comm	_CMD_SOFTRESET,4,2              ; @CMD_SOFTRESET
	.no_dead_strip	_reset_card
.subsections_via_symbols
