	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spinand_wait
_spinand_wait:                          ## @spinand_wait
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	_jiffies@GOTPCREL(%rip), %r14
	movq	(%r14), %r12
	movl	$400, %edi                      ## imm = 0x190
	callq	_msecs_to_jiffies
	movq	%rax, %rbx
	addq	%r12, %rbx
	leaq	-44(%rbp), %r12
	movq	_STATUS_BUSY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_spinand_read_status
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r13), %eax
	testl	%eax, -44(%rbp)
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_1
## %bb.4:
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdi
	callq	_spinand_read_status
	testl	%eax, %eax
	jne	LBB0_8
LBB0_5:
	movl	-44(%rbp), %ecx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	%ecx, (%rax)
LBB0_7:
	andl	(%r13), %ecx
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	subl	(%rdx), %eax
	testl	%ecx, %ecx
	cmovel	%ecx, %eax
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_STATUS_BUSY,4,2                ## @STATUS_BUSY
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_spinand_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spinand_wait
_spinand_wait:                          ; @spinand_wait
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x23, _jiffies@GOTPAGE
Lloh1:
	ldr	x23, [x23, _jiffies@GOTPAGEOFF]
	ldr	x21, [x23]
	mov	w0, #400
	bl	_msecs_to_jiffies
	add	x21, x0, x21
Lloh2:
	adrp	x22, _STATUS_BUSY@GOTPAGE
Lloh3:
	ldr	x22, [x22, _STATUS_BUSY@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #12
	mov	x0, x20
	bl	_spinand_read_status
	cbnz	w0, LBB0_8
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x23]
	mov	x1, x21
	bl	_time_before
	cbnz	x0, LBB0_1
; %bb.4:
	add	x1, sp, #12
	mov	x0, x20
	bl	_spinand_read_status
	cbnz	w0, LBB0_8
LBB0_5:
	ldr	w8, [sp, #12]
	cbz	x19, LBB0_7
; %bb.6:
	str	w8, [x19]
LBB0_7:
	ldr	w9, [x22]
Lloh4:
	adrp	x10, _ETIMEDOUT@GOTPAGE
Lloh5:
	ldr	x10, [x10, _ETIMEDOUT@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	tst	w9, w8
	csneg	w0, wzr, w10, eq
LBB0_8:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_STATUS_BUSY,4,2                ; @STATUS_BUSY
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_spinand_wait
.subsections_via_symbols
