	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qlcnic_validate_firmware
_qlcnic_validate_firmware:              ## @qlcnic_validate_firmware
	.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	%rdi, %rbx
	movq	16(%rdi), %r14
	movq	(%rdi), %rax
	movq	8(%rdi), %r15
	movq	(%rax), %r12
	movq	_QLCNIC_UNIFIED_ROMIMAGE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jne	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_qlcnic_validate_unified_romimage
	testq	%rax, %rax
	jne	LBB0_6
## %bb.2:
	movq	_QLCNIC_UNI_FW_MIN_SIZE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	8(%r15), %rax
	movq	_QLCNIC_FW_MAGIC_OFFSET@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_le32_to_cpu
	movq	_QLCNIC_BDINFO_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	movq	_QLCNIC_FW_MIN_SIZE@GOTPCREL(%rip), %rax
LBB0_5:
	movq	(%r15), %rcx
	cmpq	(%rax), %rcx
	jge	LBB0_9
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_7:
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%rbx, %rdi
	callq	_qlcnic_get_fw_version
	movq	%rax, %rdi
	callq	_QLCNIC_DECODE_VERSION
	movq	%rax, %r15
	movq	_QLCNIC_MIN_FW_VERSION@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	jge	LBB0_11
## %bb.10:
	movq	_fw_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r12,4), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	__major
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	__minor
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	__build
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r13d, %ecx
	movl	%r12d, %r8d
	movl	%eax, %r9d
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_14
LBB0_11:
	movq	%rbx, %rdi
	callq	_qlcnic_get_bios_version
	movq	%rax, %r15
	movq	_QLCNIC_BIOS_VERSION_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_qlcnic_rom_fast_read
	cmpq	-56(%rbp), %r15
	jne	LBB0_13
## %bb.12:
	movq	_QLCNIC_FW_IMG_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_QLCNIC_BDINFO_MAGIC@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%rbx, %rdi
	callq	_QLC_SHARED_REG_WR32
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_13:
	movq	_fw_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%r12,4), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_QLCNIC_UNIFIED_ROMIMAGE,8,3    ## @QLCNIC_UNIFIED_ROMIMAGE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_QLCNIC_UNI_FW_MIN_SIZE,8,3     ## @QLCNIC_UNI_FW_MIN_SIZE
	.comm	_QLCNIC_FW_MAGIC_OFFSET,8,3     ## @QLCNIC_FW_MAGIC_OFFSET
	.comm	_QLCNIC_BDINFO_MAGIC,8,3        ## @QLCNIC_BDINFO_MAGIC
	.comm	_QLCNIC_FW_MIN_SIZE,8,3         ## @QLCNIC_FW_MIN_SIZE
	.comm	_QLCNIC_MIN_FW_VERSION,8,3      ## @QLCNIC_MIN_FW_VERSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: firmware version %d.%d.%d unsupported\n"

	.comm	_fw_name,8,3                    ## @fw_name
	.comm	_QLCNIC_BIOS_VERSION_OFFSET,4,2 ## @QLCNIC_BIOS_VERSION_OFFSET
L_.str.1:                               ## @.str.1
	.asciz	"%s: firmware bios is incompatible\n"

	.comm	_QLCNIC_FW_IMG_VALID,4,2        ## @QLCNIC_FW_IMG_VALID
	.no_dead_strip	_qlcnic_validate_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qlcnic_validate_firmware
_qlcnic_validate_firmware:              ; @qlcnic_validate_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x0
	ldp	x21, x19, [x0, #8]
	ldr	x8, [x0]
	ldr	x22, [x8]
Lloh0:
	adrp	x8, _QLCNIC_UNIFIED_ROMIMAGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QLCNIC_UNIFIED_ROMIMAGE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x22, x8
	b.ne	LBB0_3
; %bb.1:
	mov	x0, x20
	bl	_qlcnic_validate_unified_romimage
	cbnz	x0, LBB0_12
; %bb.2:
Lloh3:
	adrp	x8, _QLCNIC_UNI_FW_MIN_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _QLCNIC_UNI_FW_MIN_SIZE@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
	ldr	x8, [x21, #8]
Lloh5:
	adrp	x9, _QLCNIC_FW_MAGIC_OFFSET@GOTPAGE
Lloh6:
	ldr	x9, [x9, _QLCNIC_FW_MAGIC_OFFSET@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	ldr	w0, [x8, x9, lsl #2]
	bl	_le32_to_cpu
Lloh8:
	adrp	x8, _QLCNIC_BDINFO_MAGIC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _QLCNIC_BDINFO_MAGIC@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.4:
Lloh11:
	adrp	x8, _QLCNIC_FW_MIN_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _QLCNIC_FW_MIN_SIZE@GOTPAGEOFF]
LBB0_5:
	ldr	x8, [x8]
	ldr	x9, [x21]
	cmp	x9, x8
	b.lt	LBB0_12
; %bb.6:
	mov	x0, x20
	bl	_qlcnic_get_fw_version
	bl	_QLCNIC_DECODE_VERSION
Lloh13:
	adrp	x8, _QLCNIC_MIN_FW_VERSION@GOTPAGE
Lloh14:
	ldr	x8, [x8, _QLCNIC_MIN_FW_VERSION@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ge	LBB0_8
; %bb.7:
	mov	x21, x0
Lloh16:
	adrp	x8, _fw_name@GOTPAGE
Lloh17:
	ldr	x8, [x8, _fw_name@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	w20, [x8, x22, lsl #2]
	bl	__major
	mov	x22, x0
	mov	x0, x21
	bl	__minor
	mov	x23, x0
	mov	x0, x21
	bl	__build
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x23, x0, [sp, #8]
	str	x22, [sp]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	b	LBB0_11
LBB0_8:
	mov	x0, x20
	bl	_qlcnic_get_bios_version
	mov	x21, x0
Lloh21:
	adrp	x8, _QLCNIC_BIOS_VERSION_OFFSET@GOTPAGE
Lloh22:
	ldr	x8, [x8, _QLCNIC_BIOS_VERSION_OFFSET@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x20
	bl	_qlcnic_rom_fast_read
	ldr	x8, [sp, #24]
	cmp	x21, x8
	b.ne	LBB0_10
; %bb.9:
Lloh24:
	adrp	x8, _QLCNIC_FW_IMG_VALID@GOTPAGE
Lloh25:
	ldr	x8, [x8, _QLCNIC_FW_IMG_VALID@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x8, _QLCNIC_BDINFO_MAGIC@GOTPAGE
Lloh28:
	ldr	x8, [x8, _QLCNIC_BDINFO_MAGIC@GOTPAGEOFF]
Lloh29:
	ldr	x2, [x8]
	mov	x0, x20
	bl	_QLC_SHARED_REG_WR32
	mov	w0, #0
	b	LBB0_13
LBB0_10:
Lloh30:
	adrp	x8, _fw_name@GOTPAGE
Lloh31:
	ldr	x8, [x8, _fw_name@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	ldr	w2, [x8, x22, lsl #2]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
LBB0_11:
	bl	_dev_err
LBB0_12:
Lloh35:
	adrp	x8, _EINVAL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_QLCNIC_UNIFIED_ROMIMAGE,8,3    ; @QLCNIC_UNIFIED_ROMIMAGE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_QLCNIC_UNI_FW_MIN_SIZE,8,3     ; @QLCNIC_UNI_FW_MIN_SIZE
	.comm	_QLCNIC_FW_MAGIC_OFFSET,8,3     ; @QLCNIC_FW_MAGIC_OFFSET
	.comm	_QLCNIC_BDINFO_MAGIC,8,3        ; @QLCNIC_BDINFO_MAGIC
	.comm	_QLCNIC_FW_MIN_SIZE,8,3         ; @QLCNIC_FW_MIN_SIZE
	.comm	_QLCNIC_MIN_FW_VERSION,8,3      ; @QLCNIC_MIN_FW_VERSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: firmware version %d.%d.%d unsupported\n"

	.comm	_fw_name,8,3                    ; @fw_name
	.comm	_QLCNIC_BIOS_VERSION_OFFSET,4,2 ; @QLCNIC_BIOS_VERSION_OFFSET
l_.str.1:                               ; @.str.1
	.asciz	"%s: firmware bios is incompatible\n"

	.comm	_QLCNIC_FW_IMG_VALID,4,2        ; @QLCNIC_FW_IMG_VALID
	.no_dead_strip	_qlcnic_validate_firmware
.subsections_via_symbols
