	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmf_pcie_download_fw_nvram
_brcmf_pcie_download_fw_nvram:          ## @brcmf_pcie_download_fw_nvram
	.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
	movq	%rcx, %r15
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	24(%rdi), %rdi
	callq	_dev_get_drvdata
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_PCIE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_brcmf_dbg
	movq	%r12, %rdi
	callq	_brcmf_pcie_enter_download_state
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	movl	(%rbx), %edi
	movq	(%r12), %rdx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_brcmf_dbg
	movq	16(%r12), %rax
	movq	(%rax), %rsi
	movq	(%r14), %rcx
	movq	8(%r14), %rdx
	movq	%r12, %rdi
	callq	_brcmf_pcie_copy_mem_todev
	movq	8(%r14), %rdi
	callq	_get_unaligned_le32
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_release_firmware
	movq	16(%r12), %rax
	movq	8(%rax), %rsi
	addq	$-4, %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_brcmf_pcie_write_ram32
	movl	(%rbx), %edi
	movq	8(%r12), %rdx
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	movq	%rbx, %r14
	je	LBB0_3
## %bb.2:
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_brcmf_dbg
	movq	16(%r12), %rax
	movq	(%rax), %rsi
	subq	%r15, %rsi
	addq	8(%rax), %rsi
	movq	%r12, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_brcmf_pcie_copy_mem_todev
	movq	%rbx, %rdi
	callq	_brcmf_fw_nvram_free
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_brcmf_dbg
LBB0_4:
	movq	16(%r12), %rax
	movq	8(%rax), %rsi
	addq	$-4, %rsi
	movq	%r12, %rdi
	callq	_brcmf_pcie_read_ram32
	movq	%rax, %r15
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_brcmf_dbg
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_brcmf_pcie_exit_download_state
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.5:
	movl	(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_brcmf_dbg
	movq	_BRCMF_PCIE_FW_UP_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	49(%rax), %ecx
	cmpl	$99, %ecx
	jb	LBB0_10
## %bb.6:
	cltq
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$36, %rax
	addl	%ecx, %eax
	movslq	%eax, %rbx
	decq	%rbx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	$50, %edi
	callq	_msleep
	movq	16(%r12), %rax
	movq	8(%rax), %rsi
	addq	$-4, %rsi
	movq	%r12, %rdi
	callq	_brcmf_pcie_read_ram32
	movq	%rax, %r14
	addq	$-1, %rbx
	setb	%al
	cmpq	%r15, %r14
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	testb	%al, %al
	jne	LBB0_7
LBB0_9:
	cmpq	%r15, %r14
	jne	LBB0_13
LBB0_10:
	leaq	L_.str.6(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_brcmf_err
	jmp	LBB0_11
LBB0_13:
	movq	16(%r12), %rax
	movq	(%rax), %rcx
	cmpq	%rcx, %r14
	jl	LBB0_15
## %bb.14:
	addq	8(%rax), %rcx
	cmpq	%rcx, %r14
	jge	LBB0_15
## %bb.16:
	movq	_PCIE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.8(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_brcmf_dbg
	movq	%r12, %rdi
	movq	%r14, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_brcmf_pcie_init_share_ram_info ## TAILCALL
LBB0_15:
	leaq	L_.str.7(%rip), %rsi
	xorl	%r13d, %r13d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_brcmf_err
LBB0_11:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCIE,4,2                       ## @PCIE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Halt ARM.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Download FW %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"Download NVRAM %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"No matching NVRAM file found %s\n"

L_.str.4:                               ## @.str.4
	.asciz	"Bring ARM in running state\n"

L_.str.5:                               ## @.str.5
	.asciz	"Wait for FW init\n"

	.comm	_BRCMF_PCIE_FW_UP_TIMEOUT,4,2   ## @BRCMF_PCIE_FW_UP_TIMEOUT
L_.str.6:                               ## @.str.6
	.asciz	"FW failed to initialize\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.7:                               ## @.str.7
	.asciz	"Invalid shared RAM address 0x%08x\n"

L_.str.8:                               ## @.str.8
	.asciz	"Shared RAM addr: 0x%08x\n"

	.no_dead_strip	_brcmf_pcie_download_fw_nvram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmf_pcie_download_fw_nvram
_brcmf_pcie_download_fw_nvram:          ; @brcmf_pcie_download_fw_nvram
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x22, x3
	mov	x21, x2
	mov	x24, x1
	mov	x19, x0
	ldr	x0, [x0, #24]
	bl	_dev_get_drvdata
	mov	x20, x0
Lloh0:
	adrp	x25, _PCIE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _PCIE@GOTPAGEOFF]
	ldr	w0, [x25]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_brcmf_dbg
	mov	x0, x19
	bl	_brcmf_pcie_enter_download_state
	cbnz	w0, LBB0_16
; %bb.1:
	ldr	w0, [x25]
	ldr	x8, [x19]
	str	x8, [sp]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_brcmf_dbg
	ldr	x8, [x19, #16]
	ldr	x1, [x8]
	ldp	x3, x2, [x24]
	mov	x0, x19
	bl	_brcmf_pcie_copy_mem_todev
	ldr	x0, [x24, #8]
	bl	_get_unaligned_le32
	mov	x23, x0
	mov	x0, x24
	bl	_release_firmware
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	sub	x1, x8, #4
	mov	x0, x19
	mov	w2, #0
	bl	_brcmf_pcie_write_ram32
	ldr	w0, [x25]
	ldr	x8, [x19, #8]
	cbz	x21, LBB0_3
; %bb.2:
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_brcmf_dbg
	ldr	x8, [x19, #16]
	ldp	x9, x8, [x8]
	sub	x9, x9, x22
	add	x1, x9, x8
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	bl	_brcmf_pcie_copy_mem_todev
	mov	x0, x21
	bl	_brcmf_fw_nvram_free
	b	LBB0_4
LBB0_3:
	str	x8, [sp]
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_brcmf_dbg
LBB0_4:
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	sub	x1, x8, #4
	mov	x0, x19
	bl	_brcmf_pcie_read_ram32
	mov	x21, x0
	ldr	w0, [x25]
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_brcmf_dbg
	mov	x0, x19
	mov	x1, x23
	bl	_brcmf_pcie_exit_download_state
	cbnz	w0, LBB0_16
; %bb.5:
	ldr	w0, [x25]
Lloh12:
	adrp	x1, l_.str.5@PAGE
Lloh13:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_brcmf_dbg
Lloh14:
	adrp	x8, _BRCMF_PCIE_FW_UP_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BRCMF_PCIE_FW_UP_TIMEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	add	w9, w8, #49
	cmp	w9, #99
	b.lo	LBB0_10
; %bb.6:
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #36
	add	w8, w8, w9
	sxtw	x8, w8
	sub	x23, x8, #1
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #50
	bl	_msleep
	ldr	x8, [x19, #16]
	ldr	x8, [x8, #8]
	sub	x1, x8, #4
	mov	x0, x19
	bl	_brcmf_pcie_read_ram32
	mov	x22, x0
	subs	x23, x23, #1
	cset	w8, hs
	cmp	x0, x21
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	tbnz	w8, #0, LBB0_7
LBB0_9:
	cmp	x22, x21
	b.ne	LBB0_11
LBB0_10:
Lloh17:
	adrp	x1, l_.str.6@PAGE
Lloh18:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_15
LBB0_11:
	ldr	x8, [x19, #16]
	ldr	x9, [x8]
	cmp	x22, x9
	b.lt	LBB0_14
; %bb.12:
	ldr	x8, [x8, #8]
	add	x8, x8, x9
	cmp	x22, x8
	b.ge	LBB0_14
; %bb.13:
	ldr	w0, [x25]
	str	x22, [sp]
Lloh19:
	adrp	x1, l_.str.8@PAGE
Lloh20:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_brcmf_dbg
	mov	x0, x19
	mov	x1, x22
	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
	add	sp, sp, #96
	b	_brcmf_pcie_init_share_ram_info
LBB0_14:
	str	x22, [sp]
Lloh21:
	adrp	x1, l_.str.7@PAGE
Lloh22:
	add	x1, x1, l_.str.7@PAGEOFF
LBB0_15:
	mov	x0, x20
	bl	_brcmf_err
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIE,4,2                       ; @PCIE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Halt ARM.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Download FW %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"Download NVRAM %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"No matching NVRAM file found %s\n"

l_.str.4:                               ; @.str.4
	.asciz	"Bring ARM in running state\n"

l_.str.5:                               ; @.str.5
	.asciz	"Wait for FW init\n"

	.comm	_BRCMF_PCIE_FW_UP_TIMEOUT,4,2   ; @BRCMF_PCIE_FW_UP_TIMEOUT
l_.str.6:                               ; @.str.6
	.asciz	"FW failed to initialize\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.7:                               ; @.str.7
	.asciz	"Invalid shared RAM address 0x%08x\n"

l_.str.8:                               ; @.str.8
	.asciz	"Shared RAM addr: 0x%08x\n"

	.no_dead_strip	_brcmf_pcie_download_fw_nvram
.subsections_via_symbols
