	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bfa_ioc_download_fw
_bfa_ioc_download_fw:                   ## @bfa_ioc_download_fw
	.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	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	callq	_bfa_ioc_asic_gen
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_bfa_cb_image_get_chunk
	movq	%rax, %rbx
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_bfa_ioc_smem_pgnum
	movq	(%r13), %rsi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_writel
	movq	%r13, %rdi
	callq	_bfa_ioc_asic_gen
	movl	%eax, %edi
	callq	_bfa_cb_image_get_size
	testq	%rax, %rax
	jle	LBB0_7
## %bb.1:
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_BFA_IOC_FLASH_OFFSET_IN_CHUNK
	movq	(%rbx,%rax,8), %rdi
	callq	_swab32
	movq	8(%r13), %rsi
	addq	%r15, %rsi
	movq	%rax, %rdi
	callq	_writel
	addq	$8, %r15
	movq	%r15, %rdi
	callq	_PSS_SMEM_PGOFF
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_5
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movq	%r13, %rdi
	callq	_bfa_ioc_asic_gen
	movl	%eax, %edi
	callq	_bfa_cb_image_get_size
	cmpq	%rax, %r14
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_BFA_IOC_FLASH_CHUNK_NO
	cmpq	%r12, %rax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	callq	_BFA_IOC_FLASH_CHUNK_NO
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_bfa_ioc_asic_gen
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_BFA_IOC_FLASH_CHUNK_ADDR
	movl	%ebx, %edi
	movq	%rax, %rsi
	callq	_bfa_cb_image_get_chunk
	movq	%rax, %rbx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	incq	%rdi
	movq	(%r13), %rsi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_writel
	jmp	LBB0_6
LBB0_7:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_bfa_ioc_smem_pgnum
	movq	(%r13), %rsi
	movq	%rax, %rdi
	callq	_writel
	movl	28(%r13), %edi
	movl	24(%r13), %esi
	movl	16(%r13), %ecx
	movl	20(%r13), %edx
	callq	_BFI_FWBOOT_DEVMODE
	movq	_BFI_FWBOOT_DEVMODE_OFF@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	8(%r13), %rsi
	movq	%rax, %rdi
	callq	_writel
	movq	_BFI_FWBOOT_TYPE_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r13), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_writel
	movq	_BFI_FWBOOT_ENV_OFF@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	8(%r13), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BFI_FWBOOT_DEVMODE_OFF,8,3     ## @BFI_FWBOOT_DEVMODE_OFF
	.comm	_BFI_FWBOOT_TYPE_OFF,8,3        ## @BFI_FWBOOT_TYPE_OFF
	.comm	_BFI_FWBOOT_ENV_OFF,8,3         ## @BFI_FWBOOT_ENV_OFF
	.no_dead_strip	_bfa_ioc_download_fw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bfa_ioc_download_fw
_bfa_ioc_download_fw:                   ; @bfa_ioc_download_fw
	.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	x19, x2
	mov	x21, x1
	mov	x20, x0
	bl	_bfa_ioc_asic_gen
	mov	x1, #0
	bl	_bfa_cb_image_get_chunk
	mov	x23, x0
	mov	x0, x20
	mov	x1, #0
	bl	_bfa_ioc_smem_pgnum
	mov	x22, x0
	ldr	x1, [x20]
	bl	_writel
	mov	x0, x20
	bl	_bfa_ioc_asic_gen
	bl	_bfa_cb_image_get_size
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x24, #0
	mov	x25, #0
	mov	x26, #0
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_BFA_IOC_FLASH_OFFSET_IN_CHUNK
	ldr	x0, [x23, x0, lsl #3]
	bl	_swab32
	ldr	x8, [x20, #8]
	add	x1, x8, x26
	bl	_writel
	add	x0, x26, #8
	bl	_PSS_SMEM_PGOFF
	mov	x26, x0
	cbz	x0, LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	mov	x0, x20
	bl	_bfa_ioc_asic_gen
	bl	_bfa_cb_image_get_size
	cmp	x24, x0
	b.ge	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_BFA_IOC_FLASH_CHUNK_NO
	cmp	x0, x25
	b.eq	LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_BFA_IOC_FLASH_CHUNK_NO
	mov	x25, x0
	mov	x0, x20
	bl	_bfa_ioc_asic_gen
	mov	x23, x0
	mov	x0, x25
	bl	_BFA_IOC_FLASH_CHUNK_ADDR
	mov	x1, x0
	mov	x0, x23
	bl	_bfa_cb_image_get_chunk
	mov	x23, x0
	b	LBB0_2
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #1
	ldr	x1, [x20]
	mov	x0, x22
	bl	_writel
	b	LBB0_3
LBB0_7:
	mov	x0, x20
	mov	x1, #0
	bl	_bfa_ioc_smem_pgnum
	ldr	x1, [x20]
	bl	_writel
	ldp	w1, w0, [x20, #24]
	ldp	w3, w2, [x20, #16]
	bl	_BFI_FWBOOT_DEVMODE
	ldr	x8, [x20, #8]
Lloh0:
	adrp	x9, _BFI_FWBOOT_DEVMODE_OFF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BFI_FWBOOT_DEVMODE_OFF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	x8, [x20, #8]
Lloh3:
	adrp	x9, _BFI_FWBOOT_TYPE_OFF@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BFI_FWBOOT_TYPE_OFF@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x21
	bl	_writel
	ldr	x8, [x20, #8]
Lloh6:
	adrp	x9, _BFI_FWBOOT_ENV_OFF@GOTPAGE
Lloh7:
	ldr	x9, [x9, _BFI_FWBOOT_ENV_OFF@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x19
	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
	b	_writel
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BFI_FWBOOT_DEVMODE_OFF,8,3     ; @BFI_FWBOOT_DEVMODE_OFF
	.comm	_BFI_FWBOOT_TYPE_OFF,8,3        ; @BFI_FWBOOT_TYPE_OFF
	.comm	_BFI_FWBOOT_ENV_OFF,8,3         ; @BFI_FWBOOT_ENV_OFF
	.no_dead_strip	_bfa_ioc_download_fw
.subsections_via_symbols
