	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_be_fw_download                 ## -- Begin function be_fw_download
	.p2align	4, 0x90
_be_fw_download:                        ## @be_fw_download
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	(%rdi), %r12
	movq	(%rsi), %r14
	movq	%r14, %rsi
	callq	_be_check_ufi_compatibility
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	$4, -56(%rbp)
	leaq	-52(%rbp), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_dma_alloc_coherent
	movl	%eax, -48(%rbp)
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	(%r14), %edi
	callq	_le32_to_cpu
	testl	%eax, %eax
	jle	LBB0_6
## %bb.7:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %eax
	shlq	$2, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	xorl	%r13d, %r13d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_be_flash_BEx
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %r13d
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	addq	$4, %r12
	cmpq	%r12, -72(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_15
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %r14
	movq	%rbx, %rdi
	callq	_BE2_chip
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	4(%r12,%r14), %edi
	callq	_le32_to_cpu
	cmpl	$1, %eax
	jne	LBB0_14
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%rbx, %rdi
	callq	_skyhawk_chip
	movq	%rbx, %rdi
	movq	%r15, %rsi
	leaq	-56(%rbp), %rdx
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_be_flash_skyhawk
	jmp	LBB0_13
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_17
LBB0_6:
	xorl	%r13d, %r13d
LBB0_15:
	movl	-48(%rbp), %edx
	movl	-56(%rbp), %esi
	movl	-52(%rbp), %ecx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_dma_free_coherent
	testl	%r13d, %r13d
	jne	LBB0_17
## %bb.16:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dev_info
	xorl	%r13d, %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Flash image is not compatible with adapter\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Firmware flashed successfully\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_be_fw_download                 ; -- Begin function be_fw_download
	.p2align	2
_be_fw_download:                        ; @be_fw_download
	.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	x20, x1
	mov	x21, x0
	ldr	x19, [x0]
	ldr	x22, [x1]
	mov	x1, x22
	bl	_be_check_ufi_compatibility
	cbz	w0, LBB0_11
; %bb.1:
	mov	w8, #4
	str	w8, [sp]
	mov	x8, sp
	orr	x2, x8, #0x4
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #4
	bl	_dma_alloc_coherent
	str	w0, [sp, #8]
	cbz	w0, LBB0_12
; %bb.2:
	ldr	w0, [x22]
	bl	_le32_to_cpu
	cmp	w0, #1
	b.lt	LBB0_14
; %bb.3:
	mov	x22, x0
	mov	x24, #0
	mov	w23, #0
	mov	w8, w0
	lsl	x25, x8, #2
	b	LBB0_7
LBB0_4:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	mov	x1, x20
	mov	x3, x22
	bl	_be_flash_BEx
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x23, x0
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x24, x24, #4
	cmp	x25, x24
	b.eq	LBB0_15
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x26, [x20]
	mov	x0, x21
	bl	_BE2_chip
	cbnz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x8, x24, x26
	ldr	w0, [x8, #4]
	bl	_le32_to_cpu
	cmp	w0, #1
	b.ne	LBB0_6
LBB0_9:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	bl	_skyhawk_chip
	mov	x2, sp
	cbz	x0, LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x21
	mov	x1, x20
	mov	x3, x22
	bl	_be_flash_skyhawk
	b	LBB0_5
LBB0_11:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_17
LBB0_14:
	mov	w23, #0
LBB0_15:
	ldp	w3, w2, [sp, #4]
	ldr	w1, [sp]
	mov	x0, x19
	bl	_dma_free_coherent
	cbnz	w23, LBB0_17
; %bb.16:
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_info
LBB0_17:
	mov	x0, x23
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Flash image is not compatible with adapter\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Firmware flashed successfully\n"

.subsections_via_symbols
