	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function card_shutdown
_card_shutdown:                         ## @card_shutdown
	.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	%rdi, %r12
	movl	$120000, %edi                   ## imm = 0x1D4C0
	callq	_msecs_to_jiffies
	movq	_jiffies@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	movslq	%eax, %r13
	leaq	-44(%rbp), %r14
	movq	_CARD_STATE_STARTING@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_rsxx_get_card_state
	testl	%eax, %eax
	jne	LBB0_13
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	-44(%rbp), %eax
	cmpl	(%r15), %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	subq	%rbx, %rax
	cmpq	%r13, %rax
	jl	LBB0_1
LBB0_12:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_CARD_STATE_SHUTTING_DOWN@GOTPCREL(%rip), %rcx
	movq	_CARD_STATE_SHUTDOWN@GOTPCREL(%rip), %r15
	cmpl	(%rcx), %eax
	je	LBB0_7
## %bb.5:
	cmpl	(%r15), %eax
	je	LBB0_7
## %bb.6:
	movq	_CARD_CMD_SHUTDOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_rsxx_issue_card_cmd
	testl	%eax, %eax
	jne	LBB0_13
LBB0_7:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	leaq	-44(%rbp), %r14
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_rsxx_get_card_state
	testl	%eax, %eax
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	-44(%rbp), %eax
	cmpl	(%r15), %eax
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	subq	%rbx, %rax
	cmpq	%r13, %rax
	jl	LBB0_8
	jmp	LBB0_12
LBB0_10:
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_CARD_STATE_STARTING,4,2        ## @CARD_STATE_STARTING
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_CARD_STATE_SHUTTING_DOWN,4,2   ## @CARD_STATE_SHUTTING_DOWN
	.comm	_CARD_STATE_SHUTDOWN,4,2        ## @CARD_STATE_SHUTDOWN
	.comm	_CARD_CMD_SHUTDOWN,4,2          ## @CARD_CMD_SHUTDOWN
	.no_dead_strip	_card_shutdown
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function card_shutdown
_card_shutdown:                         ; @card_shutdown
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	mov	w0, #54464
	movk	w0, #1, lsl #16
	bl	_msecs_to_jiffies
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x20, _jiffies@GOTPAGE
Lloh1:
	ldr	x20, [x20, _jiffies@GOTPAGEOFF]
	ldr	x22, [x20]
	sxtw	x21, w0
Lloh2:
	adrp	x23, _CARD_STATE_STARTING@GOTPAGE
Lloh3:
	ldr	x23, [x23, _CARD_STATE_STARTING@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #12
	mov	x0, x19
	bl	_rsxx_get_card_state
	cbnz	w0, LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x20]
	sub	x8, x8, x22
	cmp	x8, x21
	b.lt	LBB0_1
LBB0_4:
Lloh4:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_6:
Lloh7:
	adrp	x9, _CARD_STATE_SHUTTING_DOWN@GOTPAGE
Lloh8:
	ldr	x9, [x9, _CARD_STATE_SHUTTING_DOWN@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
Lloh10:
	adrp	x22, _CARD_STATE_SHUTDOWN@GOTPAGE
Lloh11:
	ldr	x22, [x22, _CARD_STATE_SHUTDOWN@GOTPAGEOFF]
	ldr	w10, [x22]
	cmp	w8, w9
	ccmp	w8, w10, #4, ne
	b.eq	LBB0_8
; %bb.7:
Lloh12:
	adrp	x8, _CARD_CMD_SHUTDOWN@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CARD_CMD_SHUTDOWN@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rsxx_issue_card_cmd
	cbnz	w0, LBB0_5
LBB0_8:
	ldr	x23, [x20]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #12
	mov	x0, x19
	bl	_rsxx_get_card_state
	cbnz	w0, LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	cmp	w8, w9
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x20]
	sub	x8, x8, x23
	cmp	x8, x21
	b.lt	LBB0_9
	b	LBB0_4
LBB0_12:
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_CARD_STATE_STARTING,4,2        ; @CARD_STATE_STARTING
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_CARD_STATE_SHUTTING_DOWN,4,2   ; @CARD_STATE_SHUTTING_DOWN
	.comm	_CARD_STATE_SHUTDOWN,4,2        ; @CARD_STATE_SHUTDOWN
	.comm	_CARD_CMD_SHUTDOWN,4,2          ; @CARD_CMD_SHUTDOWN
	.no_dead_strip	_card_shutdown
.subsections_via_symbols
