	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cafe_nand_cmdfunc
_cafe_nand_cmdfunc:                     ## @cafe_nand_cmdfunc
	.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
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movq	16(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_cafe_dev_dbg
	leal	-137(%r13), %eax
	cmpl	$1, %eax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	ja	LBB0_2
## %bb.1:
	movl	(%r14), %esi
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	orl	%r13d, %esi
	orl	$256, %esi                      ## imm = 0x100
	movq	_NAND_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cafe_writel
	movl	4(%r14), %r12d
	andb	$-65, 3(%r14)
	movq	16(%r14), %rdi
	movl	32(%r14), %ecx
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_cafe_dev_dbg
	jmp	LBB0_30
LBB0_2:
	movq	_NAND_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_cafe_writel
	movq	%r13, %rdi
	movl	(%rbx), %eax
	cmpl	$513, %eax                      ## imm = 0x201
	setge	%cl
	movq	_NAND_CMD_READOOB@GOTPCREL(%rip), %rdx
	cmpl	%edi, (%rdx)
	sete	%dl
	movq	_NAND_CMD_READ0@GOTPCREL(%rip), %r13
	testb	%dl, %cl
	movl	$0, %esi
	je	LBB0_4
## %bb.3:
	movl	(%r13), %edi
	movl	%eax, %esi
LBB0_4:
	addl	%r15d, %esi
	cmpl	$-1, %esi
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_7
## %bb.5:
	movq	%rdi, %r15
	movq	_NAND_ADDR1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cafe_writel
	movl	$4, %ebx
	cmpl	$-1, %r12d
	jne	LBB0_10
## %bb.6:
	movl	$2, %eax
	jmp	LBB0_11
LBB0_7:
	cmpl	$-1, %r12d
	je	LBB0_8
## %bb.9:
	movq	%rdi, %r15
	movzwl	%r12w, %esi
	movq	_NAND_ADDR1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cafe_writel
	sarl	$16, %r12d
	movl	$2, %ebx
LBB0_10:
	movq	_NAND_ADDR2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_cafe_writel
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %ecx
	shll	$16, %ecx
	xorl	%eax, %eax
	cmpl	%ecx, 4(%rdx)
	setg	%al
	orl	%ebx, %eax
LBB0_11:
	movq	%r15, %rdi
LBB0_12:
	movq	$0, 8(%r14)
	movq	_CTRL1_CHIPSELECT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	andl	4(%r14), %r12d
	orl	%edi, %r12d
	cmpl	$133, %edi
	je	LBB0_14
## %bb.13:
	movq	_NAND_CMD_READID@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edi
	je	LBB0_14
## %bb.15:
	cmpl	(%r13), %edi
	je	LBB0_19
## %bb.16:
	movq	_NAND_CMD_READ1@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edi
	je	LBB0_19
## %bb.17:
	cmpl	$135, %edi
	je	LBB0_19
## %bb.18:
	movq	_NAND_CMD_READOOB@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edi
	je	LBB0_19
## %bb.20:
	xorl	%edx, %edx
	cmpl	$134, %edi
	sete	%dl
	shll	$25, %edx
	orl	%r12d, %edx
	orl	$-2147483648, %edx              ## imm = 0x80000000
	xorl	%ecx, %ecx
	movl	%edx, %r12d
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_21
LBB0_14:
	movl	$4, 12(%r14)
	orl	$-1006632960, %r12d             ## imm = 0xC4000000
	movl	$4, %ecx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	cmpl	$139, %edi
	jne	LBB0_23
	jmp	LBB0_25
LBB0_19:
	orl	$-2080374784, %r12d             ## imm = 0x84000000
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	(%rsi), %ecx
	subl	-44(%rbp), %ecx                 ## 4-byte Folded Reload
	addl	8(%rsi), %ecx
	movl	%ecx, 12(%r14)
LBB0_21:
	movl	%eax, %edx
	shll	$27, %edx
	addl	$-134217728, %edx               ## imm = 0xF8000000
	orl	$1073741824, %edx               ## imm = 0x40000000
	testl	%eax, %eax
	cmovel	%eax, %edx
	orl	%edx, %r12d
	cmpl	$139, %edi
	je	LBB0_25
LBB0_23:
	cmpl	$135, %edi
	je	LBB0_26
## %bb.24:
	cmpl	$134, %edi
	jne	LBB0_27
LBB0_25:
	movl	%r12d, 4(%r14)
	movq	16(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%r12d, %edx
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cafe_dev_dbg                   ## TAILCALL
LBB0_26:
	movl	(%r14), %esi
	movq	_NAND_CMD_RNDOUTSTART@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	orl	$256, %esi                      ## imm = 0x100
	movq	_NAND_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cafe_writel
	movl	$135, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_30
LBB0_27:
	cmpl	(%r13), %edi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_30
## %bb.28:
	cmpl	$513, (%rsi)                    ## imm = 0x201
	jl	LBB0_30
## %bb.29:
	movl	(%r14), %esi
	movq	_NAND_CMD_READSTART@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	orl	$256, %esi                      ## imm = 0x100
	movq	_NAND_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cafe_writel
LBB0_30:
	movq	16(%r14), %rbx
	movl	12(%r14), %r15d
	movq	_NAND_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cafe_readl
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_cafe_dev_dbg
	movl	12(%r14), %esi
	movq	_NAND_DATA_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cafe_writel
	movq	_NAND_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$-1879048192, %esi              ## imm = 0x90000000
	callq	_cafe_writel
	movq	_usedma@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movl	$-2147483648, -44(%rbp)         ## 4-byte Folded Spill
                                        ## imm = 0x80000000
	je	LBB0_33
## %bb.31:
	movl	%r12d, %eax
	andl	$100663296, %eax                ## imm = 0x6000000
	je	LBB0_33
## %bb.32:
	movl	$-1073741824, %eax              ## imm = 0xC0000000
	addl	12(%r14), %eax
	movl	%r12d, %esi
	andl	$67108864, %esi                 ## imm = 0x4000000
	movl	$-2147483648, %ecx              ## imm = 0x80000000
	movl	$268435456, %edx                ## imm = 0x10000000
	cmovel	%ecx, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	shll	$3, %esi
	orl	%eax, %esi
	movq	_NAND_DMA_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_cafe_writel
LBB0_33:
	movl	$0, 12(%r14)
	movq	_regdebug@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_36
## %bb.34:
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_printk
	movl	$4, %r15d
	leaq	L_.str.5(%rip), %rbx
	.p2align	4, 0x90
LBB0_35:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r14), %rdi
	addq	%r15, %rdi
	callq	_readl
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_printk
	leaq	4(%r15), %rax
	cmpq	$88, %r15
	movq	%rax, %r15
	jb	LBB0_35
LBB0_36:
	movq	_NAND_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_cafe_writel
	movl	$100, %edi
	callq	_ndelay
	movl	$500000, %r13d                  ## imm = 0x7A120
	movl	$-500000, %r12d                 ## imm = 0xFFF85EE0
	jmp	LBB0_37
	.p2align	4, 0x90
LBB0_41:                                ##   in Loop: Header=BB0_37 Depth=1
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_cpu_relax
	incl	%r12d
	decl	%r13d
	je	LBB0_42
LBB0_37:                                ## =>This Inner Loop Header: Depth=1
	movq	_NAND_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cafe_readl
	movl	%eax, %r15d
	testl	%eax, -44(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_38
## %bb.39:                              ##   in Loop: Header=BB0_37 Depth=1
	movl	%r13d, %eax
	shrl	$5, %eax
	imulq	$175921861, %rax, %rax          ## imm = 0xA7C5AC5
	shrq	$39, %rax
	imull	$100000, %eax, %ebx             ## imm = 0x186A0
	addl	%r12d, %ebx
	movl	$1, %edi
	callq	_udelay
	testl	%ebx, %ebx
	jne	LBB0_41
## %bb.40:                              ##   in Loop: Header=BB0_37 Depth=1
	movq	16(%r14), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_cafe_dev_dbg
	jmp	LBB0_41
LBB0_38:
	movl	%r13d, %ebx
LBB0_42:
	movq	_NAND_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_cafe_writel
	movq	16(%r14), %r13
	movl	$500000, %r12d                  ## imm = 0x7A120
	subl	%ebx, %r12d
	movq	_NAND_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cafe_readl
	leaq	L_.str.7(%rip), %rsi
	movq	%r13, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	movl	%eax, %r9d
	xorl	%eax, %eax
	callq	_cafe_dev_dbg
	movl	$1073741824, %edi               ## imm = 0x40000000
	andl	(%r14), %edi
	callq	_WARN_ON
	addl	$-128, %ebx
	cmpl	$13, %ebx
	jbe	LBB0_44
## %bb.43:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_nand_wait_ready
LBB0_44:
	movl	(%r14), %esi
	movq	_NAND_CTRL2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cafe_writel                    ## TAILCALL
LBB0_8:
	xorl	%eax, %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cmdfunc %02x, 0x%x, 0x%x\n"

	.comm	_NAND_CTRL2,4,2                 ## @NAND_CTRL2
L_.str.1:                               ## @.str.1
	.asciz	"Continue command, ctl1 %08x, #data %d\n"

	.comm	_NAND_CMD_READOOB,4,2           ## @NAND_CMD_READOOB
	.comm	_NAND_CMD_READ0,4,2             ## @NAND_CMD_READ0
	.comm	_NAND_ADDR1,4,2                 ## @NAND_ADDR1
	.comm	_NAND_ADDR2,4,2                 ## @NAND_ADDR2
	.comm	_CTRL1_CHIPSELECT,4,2           ## @CTRL1_CHIPSELECT
	.comm	_NAND_CMD_READID,4,2            ## @NAND_CMD_READID
	.comm	_NAND_CMD_READ1,4,2             ## @NAND_CMD_READ1
L_.str.2:                               ## @.str.2
	.asciz	"Setup for delayed command, ctl1 %08x, dlen %x\n"

	.comm	_NAND_CMD_RNDOUTSTART,4,2       ## @NAND_CMD_RNDOUTSTART
	.comm	_NAND_CMD_READSTART,4,2         ## @NAND_CMD_READSTART
L_.str.3:                               ## @.str.3
	.asciz	"dlen %x, ctl1 %x, ctl2 %x\n"

	.comm	_NAND_DATA_LEN,4,2              ## @NAND_DATA_LEN
	.comm	_NAND_IRQ,4,2                   ## @NAND_IRQ
	.comm	_usedma,8,3                     ## @usedma
	.comm	_NAND_DMA_CTRL,4,2              ## @NAND_DMA_CTRL
	.comm	_regdebug,4,2                   ## @regdebug
L_.str.4:                               ## @.str.4
	.asciz	"About to write command %08x to register 0\n"

L_.str.5:                               ## @.str.5
	.asciz	"Register %x: %08x\n"

	.comm	_NAND_CTRL1,4,2                 ## @NAND_CTRL1
L_.str.6:                               ## @.str.6
	.asciz	"Wait for ready, IRQ %x\n"

L_.str.7:                               ## @.str.7
	.asciz	"Command %x completed after %d usec, irqs %x (%x)\n"

	.no_dead_strip	_cafe_nand_cmdfunc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cafe_nand_cmdfunc
_cafe_nand_cmdfunc:                     ; @cafe_nand_cmdfunc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x23, x3
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x19, [x0, #16]
	ldr	x0, [x19, #16]
	stp	x22, x23, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_cafe_dev_dbg
	sub	w8, w21, #137
Lloh2:
	adrp	x27, _NAND_CTRL2@GOTPAGE
Lloh3:
	ldr	x27, [x27, _NAND_CTRL2@GOTPAGEOFF]
	cmp	w8, #1
	b.hi	LBB0_2
; %bb.1:
	str	x20, [sp, #24]                  ; 8-byte Folded Spill
	ldr	w8, [x19]
	orr	w8, w8, w21
	orr	w1, w8, #0x100
	ldr	w2, [x27]
	mov	x0, x19
	bl	_cafe_writel
	ldp	w8, w22, [x19]
	and	w8, w8, #0xbfffffff
	str	w8, [x19]
	ldr	x0, [x19, #16]
	ldr	w8, [x19, #32]
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_cafe_dev_dbg
	b	LBB0_26
LBB0_2:
	ldr	w2, [x27]
	mov	x0, x19
	mov	w1, #0
	bl	_cafe_writel
	ldr	w8, [x20]
	cmp	w8, #512
Lloh6:
	adrp	x25, _NAND_CMD_READOOB@GOTPAGE
Lloh7:
	ldr	x25, [x25, _NAND_CMD_READOOB@GOTPAGEOFF]
	cset	w9, gt
	ldr	w10, [x25]
	cmp	w10, w21
	cset	w10, eq
Lloh8:
	adrp	x24, _NAND_CMD_READ0@GOTPAGE
Lloh9:
	ldr	x24, [x24, _NAND_CMD_READ0@GOTPAGEOFF]
	ldr	w11, [x24]
	tst	w9, w10
	csel	w8, w8, wzr, ne
	add	w22, w8, w22
	csel	w21, w11, w21, ne
	cmn	w22, #1
	b.eq	LBB0_5
; %bb.3:
Lloh10:
	adrp	x8, _NAND_ADDR1@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NAND_ADDR1@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_cafe_writel
	cmn	w23, #1
	b.eq	LBB0_8
; %bb.4:
	mov	w26, #4
	b	LBB0_7
LBB0_5:
	cmn	w23, #1
	b.eq	LBB0_9
; %bb.6:
	and	w1, w23, #0xffff
Lloh13:
	adrp	x8, _NAND_ADDR1@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NAND_ADDR1@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_cafe_writel
	asr	w23, w23, #16
	mov	w26, #2
LBB0_7:
Lloh16:
	adrp	x8, _NAND_ADDR2@GOTPAGE
Lloh17:
	ldr	x8, [x8, _NAND_ADDR2@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x23
	bl	_cafe_writel
	ldp	w9, w8, [x20]
	cmp	w8, w9, lsl #16
	cset	w8, gt
	orr	w8, w26, w8
	b	LBB0_10
LBB0_8:
	mov	w8, #2
	b	LBB0_10
LBB0_9:
	mov	w8, #0
LBB0_10:
	str	xzr, [x19, #8]
	ldr	w9, [x19, #4]
Lloh19:
	adrp	x10, _CTRL1_CHIPSELECT@GOTPAGE
Lloh20:
	ldr	x10, [x10, _CTRL1_CHIPSELECT@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
	and	w9, w10, w9
	orr	w10, w9, w21
Lloh22:
	adrp	x9, _NAND_CMD_READID@GOTPAGE
Lloh23:
	ldr	x9, [x9, _NAND_CMD_READID@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	cmp	w21, #133
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_12
; %bb.11:
	mov	w9, #4
	str	w9, [x19, #12]
	mov	w8, #-1006632960
	b	LBB0_17
LBB0_12:
	ldr	w9, [x24]
Lloh25:
	adrp	x11, _NAND_CMD_READ1@GOTPAGE
Lloh26:
	ldr	x11, [x11, _NAND_CMD_READ1@GOTPAGEOFF]
Lloh27:
	ldr	w11, [x11]
	cmp	w21, w9
	ccmp	w21, w11, #4, ne
	b.eq	LBB0_14
; %bb.13:
	ldr	w9, [x25]
	cmp	w21, #135
	ccmp	w21, w9, #4, ne
	b.ne	LBB0_15
LBB0_14:
	mov	w9, #-2080374784
	orr	w10, w10, w9
	ldr	w9, [x20]
	ldr	w11, [x20, #8]
	sub	w9, w9, w22
	add	w9, w9, w11
	str	w9, [x19, #12]
	b	LBB0_16
LBB0_15:
	mov	w9, #0
	mov	w11, #-2147483648
	mov	w12, #-2113929216
	cmp	w21, #134
	csel	w11, w12, w11, eq
	orr	w10, w10, w11
LBB0_16:
	mov	w11, #-134217728
	add	w11, w11, w8, lsl #27
	orr	w11, w11, #0x40000000
	cmp	w8, #0
	csel	w8, wzr, w11, eq
LBB0_17:
	orr	w22, w10, w8
	cmp	w21, #139
	b.eq	LBB0_20
; %bb.18:
	cmp	w21, #135
	b.eq	LBB0_21
; %bb.19:
	cmp	w21, #134
	b.ne	LBB0_22
LBB0_20:
	str	w22, [x19, #4]
	ldr	x0, [x19, #16]
	str	x9, [sp]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x22
	bl	_cafe_dev_dbg
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_21:
	str	x20, [sp, #24]                  ; 8-byte Folded Spill
	ldr	w8, [x19]
Lloh30:
	adrp	x9, _NAND_CMD_RNDOUTSTART@GOTPAGE
Lloh31:
	ldr	x9, [x9, _NAND_CMD_RNDOUTSTART@GOTPAGEOFF]
	b	LBB0_25
LBB0_22:
	ldr	w8, [x24]
	cmp	w21, w8
	str	x20, [sp, #24]                  ; 8-byte Folded Spill
	b.ne	LBB0_26
; %bb.23:
	ldr	w8, [x20]
	cmp	w8, #513
	b.lt	LBB0_26
; %bb.24:
	ldr	w8, [x19]
Lloh32:
	adrp	x9, _NAND_CMD_READSTART@GOTPAGE
Lloh33:
	ldr	x9, [x9, _NAND_CMD_READSTART@GOTPAGEOFF]
LBB0_25:
	ldr	w9, [x9]
	orr	w8, w8, w9
	orr	w1, w8, #0x100
	ldr	w2, [x27]
	mov	x0, x19
	bl	_cafe_writel
LBB0_26:
	ldr	x23, [x19, #16]
	ldr	w24, [x19, #12]
	ldr	w1, [x27]
	mov	x0, x19
	bl	_cafe_readl
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x22, x0, [sp]
Lloh34:
	adrp	x1, l_.str.3@PAGE
Lloh35:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x23
	mov	x2, x24
	bl	_cafe_dev_dbg
	ldr	w1, [x19, #12]
Lloh36:
	adrp	x8, _NAND_DATA_LEN@GOTPAGE
Lloh37:
	ldr	x8, [x8, _NAND_DATA_LEN@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_cafe_writel
Lloh39:
	adrp	x27, _NAND_IRQ@GOTPAGE
Lloh40:
	ldr	x27, [x27, _NAND_IRQ@GOTPAGEOFF]
	ldr	w2, [x27]
	mov	x0, x19
	mov	w1, #-1879048192
	bl	_cafe_writel
Lloh41:
	adrp	x8, _usedma@GOTPAGE
Lloh42:
	ldr	x8, [x8, _usedma@GOTPAGEOFF]
Lloh43:
	ldr	x8, [x8]
	mov	w23, #-2147483648
	cbz	x8, LBB0_29
; %bb.27:
	and	w8, w22, #0x6000000
	cbz	w8, LBB0_29
; %bb.28:
	ldr	w8, [x19, #12]
	mov	w9, #-1073741824
	add	w8, w8, w9
	ands	w9, w22, #0x4000000
	mov	w10, #268435456
	mov	w11, #-2147483648
	csel	w23, w11, w10, eq
	orr	w1, w8, w9, lsl #3
Lloh44:
	adrp	x8, _NAND_DMA_CTRL@GOTPAGE
Lloh45:
	ldr	x8, [x8, _NAND_DMA_CTRL@GOTPAGEOFF]
Lloh46:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_cafe_writel
LBB0_29:
	str	wzr, [x19, #12]
Lloh47:
	adrp	x8, _regdebug@GOTPAGE
Lloh48:
	ldr	x8, [x8, _regdebug@GOTPAGEOFF]
Lloh49:
	ldr	w0, [x8]
	bl	_unlikely
	cbz	x0, LBB0_32
; %bb.30:
Lloh50:
	adrp	x0, l_.str.4@PAGE
Lloh51:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x22
	bl	_printk
	mov	w24, #4
Lloh52:
	adrp	x25, l_.str.5@PAGE
Lloh53:
	add	x25, x25, l_.str.5@PAGEOFF
LBB0_31:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #24]
	add	x0, x24, x8
	bl	_readl
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x25
	mov	x1, x24
	bl	_printk
	add	x8, x24, #4
	cmp	x24, #88
	mov	x24, x8
	b.lo	LBB0_31
LBB0_32:
	mov	w28, #34464
	movk	w28, #1, lsl #16
Lloh54:
	adrp	x8, _NAND_CTRL1@GOTPAGE
Lloh55:
	ldr	x8, [x8, _NAND_CTRL1@GOTPAGEOFF]
Lloh56:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_cafe_writel
	mov	w0, #100
	bl	_ndelay
	mov	w25, #24288
	movk	w25, #65528, lsl #16
Lloh57:
	adrp	x24, l_.str.6@PAGE
Lloh58:
	add	x24, x24, l_.str.6@PAGEOFF
	mov	w26, #41248
	movk	w26, #7, lsl #16
	b	LBB0_34
LBB0_33:                                ;   in Loop: Header=BB0_34 Depth=1
	bl	_cpu_relax
	add	w25, w25, #1
	subs	w26, w26, #1
	b.eq	LBB0_37
LBB0_34:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x27]
	mov	x0, x19
	bl	_cafe_readl
	mov	x22, x0
	tst	w0, w23
	b.ne	LBB0_37
; %bb.35:                               ;   in Loop: Header=BB0_34 Depth=1
	udiv	w8, w26, w28
	madd	w20, w8, w28, w25
	mov	w0, #1
	bl	_udelay
	cbnz	w20, LBB0_33
; %bb.36:                               ;   in Loop: Header=BB0_34 Depth=1
	ldr	x0, [x19, #16]
	mov	x1, x24
	mov	x2, x22
	bl	_cafe_dev_dbg
	b	LBB0_33
LBB0_37:
Lloh59:
	adrp	x24, _NAND_CTRL2@GOTPAGE
Lloh60:
	ldr	x24, [x24, _NAND_CTRL2@GOTPAGEOFF]
	mov	w20, #41248
	movk	w20, #7, lsl #16
	ldr	w2, [x27]
	mov	x0, x19
	mov	x1, x23
	bl	_cafe_writel
	ldr	x23, [x19, #16]
	sub	w20, w20, w26
	ldr	w1, [x27]
	mov	x0, x19
	bl	_cafe_readl
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x22, x0, [sp, #8]
	str	x20, [sp]
Lloh61:
	adrp	x1, l_.str.7@PAGE
Lloh62:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x23
	mov	x2, x21
	bl	_cafe_dev_dbg
	ldr	w8, [x19]
	and	w0, w8, #0x40000000
	bl	_WARN_ON
	sub	w8, w21, #128
	cmp	w8, #13
	b.ls	LBB0_39
; %bb.38:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	bl	_nand_wait_ready
LBB0_39:
	ldr	w1, [x19]
	ldr	w2, [x24]
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_cafe_writel
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpAdd	Lloh61, Lloh62
	.loh AdrpLdrGot	Lloh59, Lloh60
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cmdfunc %02x, 0x%x, 0x%x\n"

	.comm	_NAND_CTRL2,4,2                 ; @NAND_CTRL2
l_.str.1:                               ; @.str.1
	.asciz	"Continue command, ctl1 %08x, #data %d\n"

	.comm	_NAND_CMD_READOOB,4,2           ; @NAND_CMD_READOOB
	.comm	_NAND_CMD_READ0,4,2             ; @NAND_CMD_READ0
	.comm	_NAND_ADDR1,4,2                 ; @NAND_ADDR1
	.comm	_NAND_ADDR2,4,2                 ; @NAND_ADDR2
	.comm	_CTRL1_CHIPSELECT,4,2           ; @CTRL1_CHIPSELECT
	.comm	_NAND_CMD_READID,4,2            ; @NAND_CMD_READID
	.comm	_NAND_CMD_READ1,4,2             ; @NAND_CMD_READ1
l_.str.2:                               ; @.str.2
	.asciz	"Setup for delayed command, ctl1 %08x, dlen %x\n"

	.comm	_NAND_CMD_RNDOUTSTART,4,2       ; @NAND_CMD_RNDOUTSTART
	.comm	_NAND_CMD_READSTART,4,2         ; @NAND_CMD_READSTART
l_.str.3:                               ; @.str.3
	.asciz	"dlen %x, ctl1 %x, ctl2 %x\n"

	.comm	_NAND_DATA_LEN,4,2              ; @NAND_DATA_LEN
	.comm	_NAND_IRQ,4,2                   ; @NAND_IRQ
	.comm	_usedma,8,3                     ; @usedma
	.comm	_NAND_DMA_CTRL,4,2              ; @NAND_DMA_CTRL
	.comm	_regdebug,4,2                   ; @regdebug
l_.str.4:                               ; @.str.4
	.asciz	"About to write command %08x to register 0\n"

l_.str.5:                               ; @.str.5
	.asciz	"Register %x: %08x\n"

	.comm	_NAND_CTRL1,4,2                 ; @NAND_CTRL1
l_.str.6:                               ; @.str.6
	.asciz	"Wait for ready, IRQ %x\n"

l_.str.7:                               ; @.str.7
	.asciz	"Command %x completed after %d usec, irqs %x (%x)\n"

	.no_dead_strip	_cafe_nand_cmdfunc
.subsections_via_symbols
