	.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	%rdi, %r14
	callq	_nand_to_mtd
	movl	%eax, %edi
	callq	_mtd_to_tmio
	movq	%rax, %r12
	movq	_FCR_ISR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r12), %rsi
	movl	$15, %edi
	callq	_tmio_iowrite8
	leaq	16(%r12), %rbx
	movq	%rbx, %rdi
	callq	_reinit_completion
	movq	_FCR_IMR@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	addq	8(%r12), %rsi
	movl	$129, %edi
	callq	_tmio_iowrite8
	movl	$400, %edi                      ## imm = 0x190
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	movq	%rax, %r15
	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:
	leaq	L_.str(%rip), %r15
	jmp	LBB0_4
LBB0_2:
	xorl	%edi, %edi
	testq	%r15, %r15
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	leaq	L_.str.1(%rip), %r15
LBB0_4:
	movq	(%r13), %rsi
	addq	8(%r12), %rsi
	xorl	%edi, %edi
	callq	_tmio_iowrite8
	movq	(%r12), %rdi
	movq	%r15, %rsi
	callq	_dev_warn
LBB0_5:
	leaq	-44(%rbp), %rsi
	movq	%r14, %rdi
	callq	_nand_status_op
	movl	-44(%rbp), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FCR_ISR,8,3                    ## @FCR_ISR
	.comm	_FCR_IMR,8,3                    ## @FCR_IMR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"still busy after 400 ms\n"

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

	.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, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	bl	_nand_to_mtd
	bl	_mtd_to_tmio
	mov	x20, 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
	add	x21, x20, #16
	mov	x0, x21
	bl	_reinit_completion
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x22, _FCR_IMR@GOTPAGE
Lloh4:
	ldr	x22, [x22, _FCR_IMR@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	w0, #129
	bl	_tmio_iowrite8
	mov	w0, #400
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_timeout
	mov	x21, x0
	mov	x0, x19
	bl	_tmio_nand_dev_ready
	cmp	w0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x21, l_.str@PAGE
Lloh6:
	add	x21, x21, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	cmp	x21, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_5
; %bb.3:
Lloh7:
	adrp	x21, l_.str.1@PAGE
Lloh8:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_4:
	ldr	x8, [x20, #8]
	ldr	x9, [x22]
	add	x1, x9, x8
	mov	w0, #0
	bl	_tmio_iowrite8
	ldr	x0, [x20]
	mov	x1, x21
	bl	_dev_warn
LBB0_5:
	add	x1, sp, #12
	mov	x0, x19
	bl	_nand_status_op
	ldr	w0, [sp, #12]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_FCR_ISR,8,3                    ; @FCR_ISR
	.comm	_FCR_IMR,8,3                    ; @FCR_IMR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"still busy after 400 ms\n"

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

	.no_dead_strip	_tmio_nand_wait
.subsections_via_symbols
