	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm47xxsflash_write_at
_bcm47xxsflash_write_at:                ## @bcm47xxsflash_write_at
	.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, %r12
	movq	%rdx, %r14
	movq	(%rdi), %r13
	movslq	(%r13), %rax
	leal	-1(%rax), %r15d
	movl	%eax, %ebx
	negl	%ebx
	andl	%esi, %ebx
	addl	%ebx, %ebx
	andl	%esi, %r15d
	jne	LBB0_2
## %bb.1:
	cmpq	%r14, %rax
	jbe	LBB0_4
LBB0_2:
	movq	_BCMA_CC_FLASHADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	*8(%r13)
	movq	_OPCODE_AT_BUF1_LOAD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_bcm47xxsflash_cmd
	movq	_HZ@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$274877907, %rax, %rsi          ## imm = 0x10624DD3
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$38, %rsi
	addl	%eax, %esi
	movq	%r13, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_bcm47xxsflash_poll
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %ebx
	callq	_pr_err
	movl	%ebx, %r14d
	jmp	LBB0_12
LBB0_4:
	testq	%r14, %r14
	je	LBB0_5
## %bb.6:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	leaq	(%r15,%rbx), %rdx
	cmpl	(%r13), %edx
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_BCMA_CC_FLASHADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	*8(%r13)
	movq	_BCMA_CC_FLASHDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12,%rbx,4), %edx
	movq	%r13, %rdi
	callq	*8(%r13)
	movq	_OPCODE_AT_BUF1_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_bcm47xxsflash_cmd
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_7
	jmp	LBB0_10
LBB0_5:
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_9:
	movl	%ebx, %r14d
LBB0_10:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_11:
	movq	_BCMA_CC_FLASHADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	*8(%r13)
	movq	_OPCODE_AT_BUF1_PROGRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_bcm47xxsflash_cmd
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BCMA_CC_FLASHADDR,4,2          ## @BCMA_CC_FLASHADDR
	.comm	_OPCODE_AT_BUF1_LOAD,4,2        ## @OPCODE_AT_BUF1_LOAD
	.comm	_HZ,4,2                         ## @HZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timeout reading page 0x%X info buffer\n"

	.comm	_BCMA_CC_FLASHDATA,4,2          ## @BCMA_CC_FLASHDATA
	.comm	_OPCODE_AT_BUF1_WRITE,4,2       ## @OPCODE_AT_BUF1_WRITE
	.comm	_OPCODE_AT_BUF1_PROGRAM,4,2     ## @OPCODE_AT_BUF1_PROGRAM
	.no_dead_strip	_bcm47xxsflash_write_at
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm47xxsflash_write_at
_bcm47xxsflash_write_at:                ; @bcm47xxsflash_write_at
	.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	x22, x3
	mov	x19, x2
	ldr	x20, [x0]
	ldrsw	x8, [x20]
	sub	w9, w8, #1
	neg	w10, w8
	and	w10, w10, w1
	lsl	w21, w10, #1
	and	w25, w9, w1
	cmp	w25, #0
	ccmp	x8, x2, #2, eq
Lloh0:
	adrp	x24, _BCMA_CC_FLASHADDR@GOTPAGE
Lloh1:
	ldr	x24, [x24, _BCMA_CC_FLASHADDR@GOTPAGEOFF]
	b.ls	LBB0_3
; %bb.1:
	ldr	x8, [x20, #8]
	ldr	w1, [x24]
	mov	x0, x20
	mov	x2, x21
	blr	x8
Lloh2:
	adrp	x8, _OPCODE_AT_BUF1_LOAD@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OPCODE_AT_BUF1_LOAD@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_bcm47xxsflash_cmd
Lloh5:
	adrp	x8, _HZ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh7:
	ldrsw	x8, [x8]
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w1, w8, w9
	mov	x0, x20
	bl	_bcm47xxsflash_poll
	cbz	w0, LBB0_3
; %bb.2:
	mov	x23, x0
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_pr_err
	mov	x19, x23
	b	LBB0_9
LBB0_3:
	cbz	x19, LBB0_8
; %bb.4:
	mov	x23, #0
Lloh10:
	adrp	x26, _BCMA_CC_FLASHDATA@GOTPAGE
Lloh11:
	ldr	x26, [x26, _BCMA_CC_FLASHDATA@GOTPAGEOFF]
Lloh12:
	adrp	x27, _OPCODE_AT_BUF1_WRITE@GOTPAGE
Lloh13:
	ldr	x27, [x27, _OPCODE_AT_BUF1_WRITE@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x20]
	add	x2, x25, x23
	cmp	w2, w8
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, #8]
	ldr	w1, [x24]
	mov	x0, x20
                                        ; kill: def $w2 killed $w2 killed $x2
	blr	x8
	ldr	x8, [x20, #8]
	ldr	w1, [x26]
	ldr	w2, [x22, x23, lsl #2]
	mov	x0, x20
	blr	x8
	ldr	w1, [x27]
	mov	x0, x20
	bl	_bcm47xxsflash_cmd
	add	x23, x23, #1
	cmp	x19, x23
	b.ne	LBB0_5
	b	LBB0_8
LBB0_7:
	mov	x19, x23
LBB0_8:
	ldr	x8, [x20, #8]
	ldr	w1, [x24]
	mov	x0, x20
	mov	x2, x21
	blr	x8
Lloh14:
	adrp	x8, _OPCODE_AT_BUF1_PROGRAM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _OPCODE_AT_BUF1_PROGRAM@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_bcm47xxsflash_cmd
LBB0_9:
	mov	x0, x19
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_BCMA_CC_FLASHADDR,4,2          ; @BCMA_CC_FLASHADDR
	.comm	_OPCODE_AT_BUF1_LOAD,4,2        ; @OPCODE_AT_BUF1_LOAD
	.comm	_HZ,4,2                         ; @HZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timeout reading page 0x%X info buffer\n"

	.comm	_BCMA_CC_FLASHDATA,4,2          ; @BCMA_CC_FLASHDATA
	.comm	_OPCODE_AT_BUF1_WRITE,4,2       ; @OPCODE_AT_BUF1_WRITE
	.comm	_OPCODE_AT_BUF1_PROGRAM,4,2     ; @OPCODE_AT_BUF1_PROGRAM
	.no_dead_strip	_bcm47xxsflash_write_at
.subsections_via_symbols
