	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmio_nand_wait
_tmio_nand_wait:                        ## @tmio_nand_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	callq	_mtd_to_tmio
	movq	%rax, %r13
	movq	_FCR_ISR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r13), %rsi
	movl	$15, %edi
	callq	_tmio_iowrite8
	movq	_FCR_IMR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r13), %rsi
	movl	$129, %edi
	callq	_tmio_iowrite8
	movq	24(%r15), %rax
	movl	(%rax), %r12d
	movq	%r14, %rdi
	callq	_tmio_nand_dev_ready
	movl	%eax, %ebx
	movq	(%r15), %rax
	movq	_FL_ERASING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$400, %eax                      ## imm = 0x190
	movl	$20, %edi
	cmovel	%eax, %edi
	callq	_msecs_to_jiffies
	movl	%r12d, %edi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_wait_event_timeout
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_tmio_nand_dev_ready
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_FCR_IMR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r13), %rsi
	xorl	%edi, %edi
	callq	_tmio_iowrite8
	movq	(%r13), %rdi
	movq	%r15, %rbx
	movq	(%r15), %rax
	movq	_FL_ERASING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rdx
	cmoveq	%rax, %rdx
	movl	$20, %ecx
	movl	$400, %eax                      ## imm = 0x190
	cmovel	%eax, %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_4
LBB0_2:
	movq	%r15, %rbx
	xorl	%edi, %edi
	testq	%r12, %r12
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_FCR_IMR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r13), %rsi
	xorl	%edi, %edi
	callq	_tmio_iowrite8
	movq	(%r13), %rdi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_4:
	movq	_NAND_CMD_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$-1, %edx
	movl	$-1, %ecx
	callq	*16(%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*8(%rax)                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FCR_ISR,8,3                    ## @FCR_ISR
	.comm	_FCR_IMR,8,3                    ## @FCR_IMR
	.comm	_FL_ERASING,8,3                 ## @FL_ERASING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"still busy with %s after %d ms\n"

L_.str.1:                               ## @.str.1
	.asciz	"erase"

L_.str.2:                               ## @.str.2
	.asciz	"program"

L_.str.3:                               ## @.str.3
	.asciz	"timeout waiting for interrupt\n"

	.comm	_NAND_CMD_STATUS,4,2            ## @NAND_CMD_STATUS
	.no_dead_strip	_tmio_nand_wait
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tmio_nand_wait
_tmio_nand_wait:                        ; @tmio_nand_wait
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_mtd_to_tmio
	mov	x21, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _FCR_ISR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FCR_ISR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #15
	bl	_tmio_iowrite8
	ldr	x8, [x21, #8]
Lloh3:
	adrp	x24, _FCR_IMR@GOTPAGE
Lloh4:
	ldr	x24, [x24, _FCR_IMR@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x1, x9, x8
	mov	w0, #129
	bl	_tmio_iowrite8
	ldr	x8, [x20, #24]
	ldr	w22, [x8]
	mov	x0, x19
	bl	_tmio_nand_dev_ready
	mov	x23, x0
Lloh5:
	adrp	x25, _FL_ERASING@GOTPAGE
Lloh6:
	ldr	x25, [x25, _FL_ERASING@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x9, [x25]
	cmp	x8, x9
	mov	w8, #20
	mov	w9, #400
	csel	w0, w9, w8, eq
	bl	_msecs_to_jiffies
	mov	x2, x0
	mov	x0, x22
	mov	x1, x23
	bl	_wait_event_timeout
	mov	x22, x0
	mov	x0, x19
	bl	_tmio_nand_dev_ready
	cmp	w0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x21, #8]
	ldr	x9, [x24]
	add	x1, x9, x8
	mov	w0, #0
	bl	_tmio_iowrite8
	ldr	x0, [x21]
	ldr	x8, [x20]
Lloh7:
	adrp	x9, l_.str.2@PAGE
Lloh8:
	add	x9, x9, l_.str.2@PAGEOFF
Lloh9:
	adrp	x10, l_.str.1@PAGE
Lloh10:
	add	x10, x10, l_.str.1@PAGEOFF
	ldr	x11, [x25]
	cmp	x8, x11
	csel	x8, x10, x9, eq
	mov	w9, #20
	mov	w10, #400
	csel	x9, x10, x9, eq
	stp	x8, x9, [sp]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	cmp	x22, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x8, [x21, #8]
	ldr	x9, [x24]
	add	x1, x9, x8
	mov	w0, #0
	bl	_tmio_iowrite8
	ldr	x0, [x21]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_4:
	bl	_dev_warn
LBB0_5:
	ldr	x8, [x20, #16]
Lloh15:
	adrp	x9, _NAND_CMD_STATUS@GOTPAGE
Lloh16:
	ldr	x9, [x9, _NAND_CMD_STATUS@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x9]
	mov	x0, x19
	mov	w2, #-1
	mov	w3, #-1
	blr	x8
	ldr	x1, [x20, #8]
	mov	x0, x19
	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
	add	sp, sp, #96
	br	x1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_FCR_ISR,8,3                    ; @FCR_ISR
	.comm	_FCR_IMR,8,3                    ; @FCR_IMR
	.comm	_FL_ERASING,8,3                 ; @FL_ERASING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"still busy with %s after %d ms\n"

l_.str.1:                               ; @.str.1
	.asciz	"erase"

l_.str.2:                               ; @.str.2
	.asciz	"program"

l_.str.3:                               ; @.str.3
	.asciz	"timeout waiting for interrupt\n"

	.comm	_NAND_CMD_STATUS,4,2            ; @NAND_CMD_STATUS
	.no_dead_strip	_tmio_nand_wait
.subsections_via_symbols
