	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function be_flash_skyhawk
_be_flash_skyhawk:                      ## @be_flash_skyhawk
	.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
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdx
	movq	%rdi, %rbx
	leal	4(,%rcx,4), %esi
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	callq	_get_fsec_info
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %r13
	movl	8(%rax), %edi
	callq	_le32_to_cpu
	testl	%eax, %eax
	jle	LBB0_10
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r14
	movl	8(%r13), %edi
	callq	_le32_to_cpu
	cltq
	addq	$12, %r15
	cmpq	%rax, %r14
	jge	LBB0_10
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movl	8(%rax,%r15), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	movq	(%r13), %rax
	movl	4(%rax,%r15), %edi
	callq	_le32_to_cpu
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	(%r13), %rax
	movl	(%rax,%r15), %edi
	callq	_le32_to_cpu
	addl	$-128, %eax
	cmpl	$6, %eax
	ja	LBB0_3
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cltq
	leaq	l_switch.table.be_flash_skyhawk(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %ebx
	movq	_OPTYPE_REDBOOT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_be_flash_redboot
	testl	%eax, %eax
	je	LBB0_3
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	8(%rdx), %rax
	addl	-44(%rbp), %r12d                ## 4-byte Folded Reload
	movslq	%r12d, %rcx
	leaq	(%rax,%rcx,4), %rsi
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	movslq	%r8d, %rcx
	leaq	(%rsi,%rcx,4), %rcx
	movslq	(%rdx), %rdx
	leaq	(%rax,%rdx,4), %rax
	cmpq	%rax, %rcx
	ja	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%ebx, %ecx
	callq	_be_flash
	testl	%eax, %eax
	je	LBB0_3
## %bb.9:
	movl	%eax, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	(%r13), %rax
	movl	(%rax,%r15), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_13
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_11:
	movq	(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_12:
	movl	$-1, %ebx
LBB0_13:
	movl	%ebx, %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	"Invalid Cookie. UFI corrupted ?\n"

	.comm	_OPTYPE_ISCSI_ACTIVE,4,2        ## @OPTYPE_ISCSI_ACTIVE
	.comm	_OPTYPE_REDBOOT,4,2             ## @OPTYPE_REDBOOT
	.comm	_OPTYPE_BIOS,4,2                ## @OPTYPE_BIOS
	.comm	_OPTYPE_PXE_BIOS,4,2            ## @OPTYPE_PXE_BIOS
	.comm	_OPTYPE_FCOE_BIOS,4,2           ## @OPTYPE_FCOE_BIOS
	.comm	_OPTYPE_ISCSI_BACKUP,4,2        ## @OPTYPE_ISCSI_BACKUP
	.comm	_OPTYPE_NCSI_FW,4,2             ## @OPTYPE_NCSI_FW
L_.str.1:                               ## @.str.1
	.asciz	"Flashing section type %d failed.\n"

	.no_dead_strip	_be_flash_skyhawk
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.be_flash_skyhawk
l_switch.table.be_flash_skyhawk:
	.quad	_OPTYPE_PXE_BIOS
	.quad	_OPTYPE_BIOS
	.quad	_OPTYPE_FCOE_BIOS
	.quad	_OPTYPE_NCSI_FW
	.quad	_OPTYPE_ISCSI_ACTIVE
	.quad	_OPTYPE_ISCSI_BACKUP
	.quad	_OPTYPE_REDBOOT

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function be_flash_skyhawk
_be_flash_skyhawk:                      ; @be_flash_skyhawk
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	lsl	w8, w3, #2
	add	w22, w8, #4
	mov	x1, x22
	mov	x2, x21
	bl	_get_fsec_info
	cbz	x0, LBB0_11
; %bb.1:
	mov	x23, x0
	ldr	w0, [x0, #8]
	bl	_le32_to_cpu
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.2:
	mov	x27, #0
	mov	x28, #0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x28, x28, #1
	ldr	w0, [x23, #8]
	bl	_le32_to_cpu
	add	x27, x27, #12
	cmp	x28, w0, sxtw
	b.ge	LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	add	x8, x8, x27
	ldr	w0, [x8, #8]
	bl	_le32_to_cpu
	mov	x25, x0
	ldr	x8, [x23]
	add	x8, x8, x27
	ldr	w0, [x8, #4]
	bl	_le32_to_cpu
	mov	x24, x0
	ldr	x8, [x23]
	ldr	w0, [x8, x27]
	bl	_le32_to_cpu
	sub	w8, w0, #128
	cmp	w8, #6
	b.hi	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh0:
	adrp	x9, l_switch.table.be_flash_skyhawk@PAGE
Lloh1:
	add	x9, x9, l_switch.table.be_flash_skyhawk@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w26, [x8]
Lloh2:
	adrp	x8, _OPTYPE_REDBOOT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OPTYPE_REDBOOT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w26, w8
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x1, [x21, #8]
	mov	x0, x19
	mov	x2, x25
	mov	x3, x24
	mov	x4, x22
	bl	_be_flash_redboot
	cbz	w0, LBB0_3
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x21, #8]
	add	w9, w22, w25
	add	x1, x8, w9, sxtw #2
	add	x9, x1, w24, sxtw #2
	ldrsw	x10, [x21]
	add	x8, x8, x10, lsl #2
	cmp	x9, x8
	b.hi	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x2, x20
	mov	x3, x26
	mov	x4, x24
	bl	_be_flash
	cbz	w0, LBB0_3
; %bb.9:
	mov	x24, x0
	ldr	x0, [x19]
	ldr	x8, [x23]
	ldr	w8, [x8, x27]
	str	x8, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_13
LBB0_10:
	mov	w24, #0
	b	LBB0_13
LBB0_11:
	ldr	x0, [x19]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_12:
	mov	w24, #-1
LBB0_13:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid Cookie. UFI corrupted ?\n"

	.comm	_OPTYPE_ISCSI_ACTIVE,4,2        ; @OPTYPE_ISCSI_ACTIVE
	.comm	_OPTYPE_REDBOOT,4,2             ; @OPTYPE_REDBOOT
	.comm	_OPTYPE_BIOS,4,2                ; @OPTYPE_BIOS
	.comm	_OPTYPE_PXE_BIOS,4,2            ; @OPTYPE_PXE_BIOS
	.comm	_OPTYPE_FCOE_BIOS,4,2           ; @OPTYPE_FCOE_BIOS
	.comm	_OPTYPE_ISCSI_BACKUP,4,2        ; @OPTYPE_ISCSI_BACKUP
	.comm	_OPTYPE_NCSI_FW,4,2             ; @OPTYPE_NCSI_FW
l_.str.1:                               ; @.str.1
	.asciz	"Flashing section type %d failed.\n"

	.no_dead_strip	_be_flash_skyhawk
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.be_flash_skyhawk
l_switch.table.be_flash_skyhawk:
	.quad	_OPTYPE_PXE_BIOS
	.quad	_OPTYPE_BIOS
	.quad	_OPTYPE_FCOE_BIOS
	.quad	_OPTYPE_NCSI_FW
	.quad	_OPTYPE_ISCSI_ACTIVE
	.quad	_OPTYPE_ISCSI_BACKUP
	.quad	_OPTYPE_REDBOOT

.subsections_via_symbols
