	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm47xxnflash_ops_bcm4706_read
_bcm47xxnflash_ops_bcm4706_read:        ## @bcm47xxnflash_ops_bcm4706_read
	.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	%edx, %r14d
	movq	%rsi, %r15
	callq	_mtd_to_nand
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %rbx
	movl	(%r12), %edi
	notl	%edi
	andl	(%rax), %edi
	callq	_BUG_ON
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	testl	%r14d, %r14d
	jne	LBB0_1
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	addl	%r12d, 4(%rbx)
	subl	%r12d, -44(%rbp)                ## 4-byte Folded Spill
	je	LBB0_9
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$512, %esi                      ## imm = 0x200
	callq	_min
	movl	%eax, %r12d
	movl	4(%rbx), %edx
	movl	8(%rbx), %edi
	movq	_BCMA_CC_NFLASH_COL_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bcma_cc_write32
	movl	(%rbx), %edx
	movl	8(%rbx), %edi
	movq	_BCMA_CC_NFLASH_ROW_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bcma_cc_write32
	movq	_NCTL_CMD1W@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_NCTL_CSA@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_NCTL_ROW@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_NCTL_COL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_NCTL_CMD0@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_NAND_CMD_READSTART@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	shll	$8, %esi
	orl	%eax, %esi
	movl	8(%rbx), %edi
	callq	_bcm47xxnflash_ops_bcm4706_ctl_cmd
	testq	%rax, %rax
	jne	LBB0_9
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	8(%rbx), %edi
	callq	_bcm47xxnflash_ops_bcm4706_poll
	testq	%rax, %rax
	jne	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%r12d, %r12d
	jle	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	-4(%r12), %r14d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_NCTL_CSA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NCTL_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%esi, %eax
	orl	$805306368, %eax                ## imm = 0x30000000
	cmpl	%r13d, %r14d
	notl	%esi
	movl	$-1, %ecx
	cmovnel	%ecx, %esi
	andl	%eax, %esi
	movl	8(%rbx), %edi
	callq	_bcm47xxnflash_ops_bcm4706_ctl_cmd
	testq	%rax, %rax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movl	8(%rbx), %edi
	movq	_BCMA_CC_NFLASH_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bcma_cc_read32
	movl	%eax, (%r15,%r13)
	addq	$4, %r13
	cmpl	%r12d, %r13d
	jl	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	addq	%r13, %r15
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_BCMA_CC_NFLASH_COL_ADDR,4,2    ## @BCMA_CC_NFLASH_COL_ADDR
	.comm	_BCMA_CC_NFLASH_ROW_ADDR,4,2    ## @BCMA_CC_NFLASH_ROW_ADDR
	.comm	_NCTL_CSA,4,2                   ## @NCTL_CSA
	.comm	_NCTL_CMD1W,4,2                 ## @NCTL_CMD1W
	.comm	_NCTL_ROW,4,2                   ## @NCTL_ROW
	.comm	_NCTL_COL,4,2                   ## @NCTL_COL
	.comm	_NCTL_CMD0,4,2                  ## @NCTL_CMD0
	.comm	_NAND_CMD_READSTART,4,2         ## @NAND_CMD_READSTART
	.comm	_NCTL_READ,4,2                  ## @NCTL_READ
	.comm	_BCMA_CC_NFLASH_DATA,4,2        ## @BCMA_CC_NFLASH_DATA
	.no_dead_strip	_bcm47xxnflash_ops_bcm4706_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm47xxnflash_ops_bcm4706_read
_bcm47xxnflash_ops_bcm4706_read:        ; @bcm47xxnflash_ops_bcm4706_read
	.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, x2
	mov	x20, x1
	bl	_mtd_to_nand
	mov	x22, x0
	bl	_nand_get_controller_data
	mov	x21, x0
	ldr	w8, [x0]
	ldr	w9, [x22]
	bic	w0, w8, w9
	bl	_BUG_ON
	cbz	w19, LBB0_10
; %bb.1:
Lloh0:
	adrp	x25, _NCTL_CSA@GOTPAGE
Lloh1:
	ldr	x25, [x25, _NCTL_CSA@GOTPAGEOFF]
Lloh2:
	adrp	x26, _NCTL_READ@GOTPAGE
Lloh3:
	ldr	x26, [x26, _NCTL_READ@GOTPAGEOFF]
	mov	w27, #-1
Lloh4:
	adrp	x28, _BCMA_CC_NFLASH_DATA@GOTPAGE
Lloh5:
	ldr	x28, [x28, _BCMA_CC_NFLASH_DATA@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x21, #4]
	add	w8, w8, w22
	str	w8, [x21, #4]
	subs	w19, w19, w22
	b.eq	LBB0_10
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	x0, x19
	mov	w1, #512
	bl	_min
	mov	x22, x0
Lloh6:
	adrp	x8, _BCMA_CC_NFLASH_COL_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BCMA_CC_NFLASH_COL_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldp	w2, w0, [x21, #4]
	bl	_bcma_cc_write32
	ldr	w0, [x21, #8]
Lloh9:
	adrp	x8, _BCMA_CC_NFLASH_ROW_ADDR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BCMA_CC_NFLASH_ROW_ADDR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	ldr	w2, [x21]
	bl	_bcma_cc_write32
	ldr	w8, [x25]
Lloh12:
	adrp	x9, _NCTL_CMD1W@GOTPAGE
Lloh13:
	ldr	x9, [x9, _NCTL_CMD1W@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _NCTL_ROW@GOTPAGE
Lloh16:
	ldr	x9, [x9, _NCTL_ROW@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh18:
	adrp	x9, _NCTL_COL@GOTPAGE
Lloh19:
	ldr	x9, [x9, _NCTL_COL@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh21:
	adrp	x9, _NCTL_CMD0@GOTPAGE
Lloh22:
	ldr	x9, [x9, _NCTL_CMD0@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh24:
	adrp	x9, _NAND_CMD_READSTART@GOTPAGE
Lloh25:
	ldr	x9, [x9, _NAND_CMD_READSTART@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w1, w8, w9, lsl #8
	ldr	w0, [x21, #8]
	bl	_bcm47xxnflash_ops_bcm4706_ctl_cmd
	cbnz	x0, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21, #8]
	bl	_bcm47xxnflash_ops_bcm4706_poll
	cbnz	x0, LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w22, #1
	b.lt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, #0
	sub	w24, w22, #4
LBB0_7:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w9, w8, w9
	orr	w9, w9, #0x30000000
	cmp	w24, w23
	csinv	w8, w27, w8, ne
	and	w1, w9, w8
	ldr	w0, [x21, #8]
	bl	_bcm47xxnflash_ops_bcm4706_ctl_cmd
	cbnz	x0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	w0, [x21, #8]
	ldr	w1, [x28]
	bl	_bcma_cc_read32
	str	w0, [x20, x23]
	add	x23, x23, #4
	cmp	w23, w22
	b.lt	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x20, x20, x23
	b	LBB0_2
LBB0_10:
	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
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_BCMA_CC_NFLASH_COL_ADDR,4,2    ; @BCMA_CC_NFLASH_COL_ADDR
	.comm	_BCMA_CC_NFLASH_ROW_ADDR,4,2    ; @BCMA_CC_NFLASH_ROW_ADDR
	.comm	_NCTL_CSA,4,2                   ; @NCTL_CSA
	.comm	_NCTL_CMD1W,4,2                 ; @NCTL_CMD1W
	.comm	_NCTL_ROW,4,2                   ; @NCTL_ROW
	.comm	_NCTL_COL,4,2                   ; @NCTL_COL
	.comm	_NCTL_CMD0,4,2                  ; @NCTL_CMD0
	.comm	_NAND_CMD_READSTART,4,2         ; @NAND_CMD_READSTART
	.comm	_NCTL_READ,4,2                  ; @NCTL_READ
	.comm	_BCMA_CC_NFLASH_DATA,4,2        ; @BCMA_CC_NFLASH_DATA
	.no_dead_strip	_bcm47xxnflash_ops_bcm4706_read
.subsections_via_symbols
