	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm47xxsflash_write_st
_bcm47xxsflash_write_st:                ## @bcm47xxsflash_write_st
	.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	%rcx, %r15
	movq	%rdx, %r13
	movl	%esi, %r12d
	movq	(%rdi), %r14
	movq	_OPCODE_ST_WREN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bcm47xxsflash_cmd
	movq	_BCMA_CC_FLASHADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r12d, %edx
	callq	*(%r14)
	movq	_BCMA_CC_FLASHDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	*(%r14)
	movq	8(%r14), %rax
	movq	(%rax), %rax
	cmpl	$19, (%rax)
	jg	LBB0_2
## %bb.1:
	movq	_OPCODE_ST_PP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bcm47xxsflash_cmd
	movl	$1, %ebx
	jmp	LBB0_9
LBB0_2:
	movq	_OPCODE_ST_CSA@GOTPCREL(%rip), %rcx
	movq	_OPCODE_ST_PP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%rcx), %esi
	movq	%r14, %rdi
	callq	_bcm47xxsflash_cmd
	movl	$1, %ebx
	cmpq	$1, %r13
	je	LBB0_7
## %bb.3:
	leal	1(%r12), %eax
	movzbl	%al, %eax
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:
	addl	$2, %r12d
	movq	%r13, %rax
	movl	$2, %r13d
	subq	%rax, %r13
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rbx,4), %esi
	movq	_OPCODE_ST_CSA@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r14, %rdi
	callq	_bcm47xxsflash_cmd
	leaq	(%rbx,%r13), %rax
	incq	%rbx
	cmpq	$1, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movzbl	%r12b, %eax
	leal	1(%r12), %ecx
	movl	%ecx, %r12d
	testl	%eax, %eax
	jne	LBB0_5
LBB0_7:
	movq	_BCMA_CC_FLASHCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	*(%r14)
	movl	$1, %edi
	callq	_udelay
	movq	_HZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1717986919, %rax, %rsi         ## imm = 0x66666667
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$34, %rsi
	addl	%eax, %esi
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_bcm47xxsflash_poll
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OPCODE_ST_WREN,4,2             ## @OPCODE_ST_WREN
	.comm	_BCMA_CC_FLASHADDR,4,2          ## @BCMA_CC_FLASHADDR
	.comm	_BCMA_CC_FLASHDATA,4,2          ## @BCMA_CC_FLASHDATA
	.comm	_OPCODE_ST_PP,4,2               ## @OPCODE_ST_PP
	.comm	_OPCODE_ST_CSA,4,2              ## @OPCODE_ST_CSA
	.comm	_BCMA_CC_FLASHCTL,4,2           ## @BCMA_CC_FLASHCTL
	.comm	_HZ,4,2                         ## @HZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Flash rejected dropping CSA\n"

	.no_dead_strip	_bcm47xxsflash_write_st
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm47xxsflash_write_st
_bcm47xxsflash_write_st:                ; @bcm47xxsflash_write_st
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x3
	mov	x22, x2
	mov	x23, x1
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _OPCODE_ST_WREN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OPCODE_ST_WREN@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bcm47xxsflash_cmd
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _BCMA_CC_FLASHADDR@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BCMA_CC_FLASHADDR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x9]
	mov	x0, x19
	mov	x2, x23
	blr	x8
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _BCMA_CC_FLASHDATA@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BCMA_CC_FLASHDATA@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x9]
	ldr	w2, [x21]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w8, [x8]
	cmp	w8, #19
	b.gt	LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _OPCODE_ST_PP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _OPCODE_ST_PP@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_bcm47xxsflash_cmd
	mov	w20, #1
	b	LBB0_10
LBB0_2:
Lloh12:
	adrp	x24, _OPCODE_ST_CSA@GOTPAGE
Lloh13:
	ldr	x24, [x24, _OPCODE_ST_CSA@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh14:
	adrp	x9, _OPCODE_ST_PP@GOTPAGE
Lloh15:
	ldr	x9, [x9, _OPCODE_ST_PP@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_bcm47xxsflash_cmd
	mov	w20, #1
	cmp	x22, #1
	b.eq	LBB0_8
; %bb.3:
	add	w8, w23, #1
	and	w8, w8, #0xff
	cbz	w8, LBB0_8
; %bb.4:
	mov	x25, #0
	add	w20, w23, #2
	sub	x22, x22, #2
	add	x21, x21, #4
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	ldr	w9, [x21, x25, lsl #2]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_bcm47xxsflash_cmd
	add	x8, x25, #1
	cmp	x22, x25
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w9, w20, w25
	mov	x25, x8
	and	w9, w9, #0xff
	cbnz	w9, LBB0_5
LBB0_7:
	add	w20, w8, #1
LBB0_8:
	ldr	x8, [x19]
Lloh17:
	adrp	x9, _BCMA_CC_FLASHCTL@GOTPAGE
Lloh18:
	ldr	x9, [x9, _BCMA_CC_FLASHCTL@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x9]
	mov	x0, x19
	mov	w2, #0
	blr	x8
	mov	w0, #1
	bl	_udelay
Lloh20:
	adrp	x8, _HZ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh22:
	ldrsw	x8, [x8]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w1, w8, w9
	mov	x0, x19
	bl	_bcm47xxsflash_poll
	cbz	x0, LBB0_10
; %bb.9:
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_OPCODE_ST_WREN,4,2             ; @OPCODE_ST_WREN
	.comm	_BCMA_CC_FLASHADDR,4,2          ; @BCMA_CC_FLASHADDR
	.comm	_BCMA_CC_FLASHDATA,4,2          ; @BCMA_CC_FLASHDATA
	.comm	_OPCODE_ST_PP,4,2               ; @OPCODE_ST_PP
	.comm	_OPCODE_ST_CSA,4,2              ; @OPCODE_ST_CSA
	.comm	_BCMA_CC_FLASHCTL,4,2           ; @BCMA_CC_FLASHCTL
	.comm	_HZ,4,2                         ; @HZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Flash rejected dropping CSA\n"

	.no_dead_strip	_bcm47xxsflash_write_st
.subsections_via_symbols
