	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm47xxnflash_ops_bcm4706_ctl_cmd
_bcm47xxnflash_ops_bcm4706_ctl_cmd:     ## @bcm47xxnflash_ops_bcm4706_ctl_cmd
	.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	%esi, %edx
	movq	%rdi, %rbx
	movq	_BCMA_CC_NFLASH_CTL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_NCTL_START@GOTPCREL(%rip), %r12
	orl	(%r12), %edx
	callq	_bcma_cc_write32
	movq	_NFLASH_READY_RETRIES@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.1:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_bcma_cc_read32
	testl	%eax, (%r12)
	je	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%r13d
	cmpl	(%r14), %r13d
	jl	LBB0_2
## %bb.4:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movl	$0, %eax
	jle	LBB0_8
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_8
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BCMA_CC_NFLASH_CTL,4,2         ## @BCMA_CC_NFLASH_CTL
	.comm	_NCTL_START,4,2                 ## @NCTL_START
	.comm	_NFLASH_READY_RETRIES,4,2       ## @NFLASH_READY_RETRIES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"NFLASH control command not ready!\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_bcm47xxnflash_ops_bcm4706_ctl_cmd
.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_ctl_cmd
_bcm47xxnflash_ops_bcm4706_ctl_cmd:     ; @bcm47xxnflash_ops_bcm4706_ctl_cmd
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
Lloh0:
	adrp	x20, _BCMA_CC_NFLASH_CTL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _BCMA_CC_NFLASH_CTL@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh2:
	adrp	x21, _NCTL_START@GOTPAGE
Lloh3:
	ldr	x21, [x21, _NCTL_START@GOTPAGEOFF]
	ldr	w9, [x21]
	orr	w2, w9, w1
	mov	x1, x8
	bl	_bcma_cc_write32
Lloh4:
	adrp	x23, _NFLASH_READY_RETRIES@GOTPAGE
Lloh5:
	ldr	x23, [x23, _NFLASH_READY_RETRIES@GOTPAGEOFF]
	ldr	w22, [x23]
	cmp	w22, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w24, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20]
	mov	x0, x19
	bl	_bcma_cc_read32
	ldr	w8, [x21]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w24, w24, #1
	ldr	w8, [x23]
	cmp	w24, w8
	b.lt	LBB0_2
; %bb.4:
	cmp	w22, #1
	b.lt	LBB0_6
; %bb.5:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh8:
	adrp	x8, _EBUSY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_BCMA_CC_NFLASH_CTL,4,2         ; @BCMA_CC_NFLASH_CTL
	.comm	_NCTL_START,4,2                 ; @NCTL_START
	.comm	_NFLASH_READY_RETRIES,4,2       ; @NFLASH_READY_RETRIES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"NFLASH control command not ready!\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_bcm47xxnflash_ops_bcm4706_ctl_cmd
.subsections_via_symbols
