	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdricoh_query_status
_sdricoh_query_status:                  ## @sdricoh_query_status
	.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
	movl	%esi, %r12d
	movq	%rdi, %r13
	movq	(%rdi), %rdi
	movq	_ETIMEDOUT@GOTPCREL(%rip), %r15
	leaq	L_.str(%rip), %rsi
	testl	%edx, %edx
	je	LBB0_8
## %bb.1:
	movl	%edx, %ebx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	_R2E4_STATUS_RESP@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_R21C_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_sdricoh_readl
	movl	%eax, %r14d
	movl	(%r15), %esi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_sdricoh_writel
	testl	%r12d, %r14d
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	decl	%ebx
	jne	LBB0_2
## %bb.4:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %r15
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_8
LBB0_5:
	testl	%ebx, %ebx
	movq	_ETIMEDOUT@GOTPCREL(%rip), %r15
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
	je	LBB0_8
## %bb.6:
	testl	$8323072, %r14d                 ## imm = 0x7F0000
	je	LBB0_10
## %bb.7:
	movq	_EINVAL@GOTPCREL(%rip), %r15
	leaq	L_.str.1(%rip), %rsi
LBB0_8:
	movl	%r12d, %edx
	callq	_dev_err
	xorl	%eax, %eax
	subl	(%r15), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_R21C_STATUS,4,2                ## @R21C_STATUS
	.comm	_R2E4_STATUS_RESP,4,2           ## @R2E4_STATUS_RESP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"query_status: timeout waiting for %x\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.1:                               ## @.str.1
	.asciz	"waiting for status bit %x failed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_sdricoh_query_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdricoh_query_status
_sdricoh_query_status:                  ; @sdricoh_query_status
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x1
	ldr	x20, [x0]
	cbz	w2, LBB0_7
; %bb.1:
	mov	x22, x2
	mov	x23, x0
Lloh0:
	adrp	x26, _R21C_STATUS@GOTPAGE
Lloh1:
	ldr	x26, [x26, _R21C_STATUS@GOTPAGEOFF]
Lloh2:
	adrp	x27, _R2E4_STATUS_RESP@GOTPAGE
Lloh3:
	ldr	x27, [x27, _R2E4_STATUS_RESP@GOTPAGEOFF]
Lloh4:
	adrp	x21, l_.str@PAGE
Lloh5:
	add	x21, x21, l_.str@PAGEOFF
Lloh6:
	adrp	x25, _ETIMEDOUT@GOTPAGE
Lloh7:
	ldr	x25, [x25, _ETIMEDOUT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x26]
	mov	x0, x23
	bl	_sdricoh_readl
	mov	x24, x0
	ldr	w1, [x27]
	mov	x0, x23
	mov	x2, x24
	bl	_sdricoh_writel
	tst	w24, w19
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	subs	w22, w22, #1
	b.ne	LBB0_2
	b	LBB0_8
LBB0_4:
	cbz	w22, LBB0_7
; %bb.5:
	tst	w24, #0x7f0000
	b.eq	LBB0_10
; %bb.6:
Lloh8:
	adrp	x25, _EINVAL@GOTPAGE
Lloh9:
	ldr	x25, [x25, _EINVAL@GOTPAGEOFF]
Lloh10:
	adrp	x21, l_.str.1@PAGE
Lloh11:
	add	x21, x21, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh12:
	adrp	x25, _ETIMEDOUT@GOTPAGE
Lloh13:
	ldr	x25, [x25, _ETIMEDOUT@GOTPAGEOFF]
Lloh14:
	adrp	x21, l_.str@PAGE
Lloh15:
	add	x21, x21, l_.str@PAGEOFF
LBB0_8:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_dev_err
	ldr	w8, [x25]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	w0, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_R21C_STATUS,4,2                ; @R21C_STATUS
	.comm	_R2E4_STATUS_RESP,4,2           ; @R2E4_STATUS_RESP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"query_status: timeout waiting for %x\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.1:                               ; @.str.1
	.asciz	"waiting for status bit %x failed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_sdricoh_query_status
.subsections_via_symbols
