	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_sp_fw_rev_validate
_mlxsw_sp_fw_rev_validate:              ## @mlxsw_sp_fw_rev_validate
	.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	24(%rdi), %r12
	testq	%r12, %r12
	je	LBB0_6
## %bb.1:
	movq	%rdi, %r15
	movq	(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_6
## %bb.2:
	movq	8(%r15), %r13
	movl	16(%r15), %edi
	callq	_priv_to_devlink
	movq	_DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-56(%rbp), %rdx
	movl	%eax, %edi
	callq	_devlink_param_driverinit_value_get
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.3:
	movq	-56(%rbp), %rax
	movq	_DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
LBB0_6:
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	8(%r13), %rdx
	movq	(%r12), %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_12
## %bb.9:
	movq	16(%r13), %rdi
	callq	_MLXSW_SP_FWREV_MINOR_TO_BRANCH
	movq	%rax, %rbx
	movq	8(%r12), %rdi
	callq	_MLXSW_SP_FWREV_MINOR_TO_BRANCH
	movq	16(%r13), %rcx
	cmpq	%rax, %rbx
	jne	LBB0_15
## %bb.10:
	cmpq	8(%r12), %rcx
	jg	LBB0_6
## %bb.13:
	jne	LBB0_15
## %bb.14:
	movq	24(%r13), %rax
	movl	$0, %ebx
	cmpq	16(%r12), %rax
	jge	LBB0_7
LBB0_15:
	movq	8(%r15), %rax
	movl	(%rax), %edi
	movq	8(%r13), %rdx
	movq	24(%r13), %r8
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_info
	movq	8(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_dev_info
	movq	8(%r15), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rdi
	movq	%r14, %rsi
	callq	_request_firmware_direct
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movl	%eax, %ebx
	movq	8(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_7
LBB0_12:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_WARN
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_17:
	movq	-48(%rbp), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_mlxsw_sp_firmware_flash
	movl	%eax, %r14d
	movq	-48(%rbp), %rdi
	callq	_release_firmware
	testl	%r14d, %r14d
	je	LBB0_19
## %bb.18:
	movq	8(%r15), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_19:
	movq	16(%r13), %rax
	cmpq	24(%r12), %rax
	jl	LBB0_7
## %bb.20:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testl	%r14d, %r14d
	cmovnel	%r14d, %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY,4,2 ## @DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY
	.comm	_DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,8,3 ## @DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Mismatch in major FW version [%d:%d] is never expected; Please contact support\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"The firmware version %d.%d.%d is incompatible with the driver\n"

L_.str.2:                               ## @.str.2
	.asciz	"Flashing firmware using file %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"Could not request firmware file %s\n"

L_.str.4:                               ## @.str.4
	.asciz	"Could not upgrade firmware\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_mlxsw_sp_fw_rev_validate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_sp_fw_rev_validate
_mlxsw_sp_fw_rev_validate:              ; @mlxsw_sp_fw_rev_validate
	.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
	ldr	x22, [x0, #24]
	ldr	x20, [x0]
	cmp	x22, #0
	ccmp	x20, #0, #4, ne
	b.ne	LBB0_2
LBB0_1:
	mov	w21, #0
	b	LBB0_3
LBB0_2:
	mov	x19, x0
	ldr	x23, [x0, #8]
	ldr	w0, [x0, #16]
	bl	_priv_to_devlink
Lloh0:
	adrp	x8, _DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #24
	bl	_devlink_param_driverinit_value_get
	mov	x21, x0
	cbz	w0, LBB0_4
LBB0_3:
	mov	x0, x21
	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
LBB0_4:
	ldr	x8, [sp, #24]
Lloh3:
	adrp	x9, _DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_1
; %bb.5:
	ldr	x2, [x23, #8]
	ldr	x3, [x22]
	cmp	x2, x3
	b.ne	LBB0_12
; %bb.6:
	ldr	x0, [x23, #16]
	bl	_MLXSW_SP_FWREV_MINOR_TO_BRANCH
	mov	x21, x0
	ldr	x0, [x22, #8]
	bl	_MLXSW_SP_FWREV_MINOR_TO_BRANCH
	ldr	x8, [x23, #16]
	cmp	x21, x0
	b.ne	LBB0_10
; %bb.7:
	ldr	x9, [x22, #8]
	cmp	x8, x9
	b.gt	LBB0_1
; %bb.8:
	b.ne	LBB0_10
; %bb.9:
	ldr	x9, [x23, #24]
	ldr	x10, [x22, #16]
	cmp	x9, x10
	b.ge	LBB0_1
LBB0_10:
	ldr	x9, [x19, #8]
	ldr	w0, [x9]
	ldr	x2, [x23, #8]
	ldr	x9, [x23, #24]
	stp	x8, x9, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_dev_info
	ldr	x8, [x19, #8]
	ldr	w2, [x8]
	add	x0, sp, #16
	mov	x1, x20
	bl	_request_firmware_direct
	cbz	w0, LBB0_13
; %bb.11:
	mov	x21, x0
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	str	x20, [sp]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	b	LBB0_3
LBB0_12:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_WARN
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_3
LBB0_13:
	ldr	x1, [sp, #16]
	mov	x0, x19
	mov	x2, #0
	bl	_mlxsw_sp_firmware_flash
	mov	x20, x0
	ldr	x0, [sp, #16]
	bl	_release_firmware
	cbz	w20, LBB0_15
; %bb.14:
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
Lloh17:
	adrp	x1, l_.str.4@PAGE
Lloh18:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
LBB0_15:
	ldr	x8, [x23, #16]
	ldr	x9, [x22, #24]
	cmp	x8, x9
	b.lt	LBB0_1
; %bb.16:
Lloh19:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w20, #0
	csneg	w21, w20, w8, ne
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY,4,2 ; @DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY
	.comm	_DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH,8,3 ; @DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Mismatch in major FW version [%d:%d] is never expected; Please contact support\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"The firmware version %d.%d.%d is incompatible with the driver\n"

l_.str.2:                               ; @.str.2
	.asciz	"Flashing firmware using file %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"Could not request firmware file %s\n"

l_.str.4:                               ; @.str.4
	.asciz	"Could not upgrade firmware\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_mlxsw_sp_fw_rev_validate
.subsections_via_symbols
