	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t4_check_fw_version            ## -- Begin function t4_check_fw_version
	.p2align	4, 0x90
_t4_check_fw_version:                   ## @t4_check_fw_version
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	8(%rdi), %r12
	movl	12(%rdi), %edi
	callq	_CHELSIO_CHIP_VERSION
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_t4_get_fw_version
	movl	%eax, %r13d
	xorl	%ebx, %ebx
	movq	_EBUSY@GOTPCREL(%rip), %r15
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$2, %ebx
	ja	LBB0_4
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_t4_get_fw_version
	movl	%eax, %r13d
	incl	%ebx
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %eax
	addl	%r13d, %eax
	je	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$3, %ebx
	jb	LBB0_8
LBB0_4:
	testl	%r13d, %r13d
	jne	LBB0_17
## %bb.5:
	movl	(%r12), %edi
	callq	_FW_HDR_FW_VER_MAJOR_G
	movl	%eax, %ebx
	movl	(%r12), %edi
	callq	_FW_HDR_FW_VER_MINOR_G
	movl	%eax, %r15d
	movl	(%r12), %edi
	callq	_FW_HDR_FW_VER_MICRO_G
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	addl	$-128, %ecx
	cmpl	$3, %ecx
	jae	LBB0_6
## %bb.9:
	movslq	%ecx, %rcx
	leaq	l_switch.table.t4_check_fw_version(%rip), %rdx
	movq	(%rdx,%rcx,8), %rdx
	leaq	l_switch.table.t4_check_fw_version.2(%rip), %rsi
	movq	(%rsi,%rcx,8), %rsi
	leaq	l_switch.table.t4_check_fw_version.3(%rip), %rdi
	movq	(%rdi,%rcx,8), %rcx
	movl	(%rcx), %r11d
	movl	(%rsi), %r10d
	movl	(%rdx), %r9d
	cmpl	%r9d, %ebx
	jl	LBB0_15
## %bb.10:
	jne	LBB0_12
## %bb.11:
	cmpl	%r10d, %r15d
	jl	LBB0_15
LBB0_12:
	xorl	%r13d, %r13d
	cmpl	%r9d, %ebx
	jne	LBB0_17
## %bb.13:
	cmpl	%r10d, %r15d
	jne	LBB0_17
## %bb.14:
	cmpl	%r11d, %eax
	jge	LBB0_17
LBB0_15:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%ebx, %edx
	movl	%r15d, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	pushq	%r11
	pushq	%r10
	callq	_dev_err
	addq	$16, %rsp
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_6:
	movl	(%r14), %edi
	movl	4(%r14), %edx
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_16:
	subl	(%rax), %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_T4FW_MIN_VERSION_MAJOR,4,2     ## @T4FW_MIN_VERSION_MAJOR
	.comm	_T4FW_MIN_VERSION_MINOR,4,2     ## @T4FW_MIN_VERSION_MINOR
	.comm	_T4FW_MIN_VERSION_MICRO,4,2     ## @T4FW_MIN_VERSION_MICRO
	.comm	_T5FW_MIN_VERSION_MAJOR,4,2     ## @T5FW_MIN_VERSION_MAJOR
	.comm	_T5FW_MIN_VERSION_MINOR,4,2     ## @T5FW_MIN_VERSION_MINOR
	.comm	_T5FW_MIN_VERSION_MICRO,4,2     ## @T5FW_MIN_VERSION_MICRO
	.comm	_T6FW_MIN_VERSION_MAJOR,4,2     ## @T6FW_MIN_VERSION_MAJOR
	.comm	_T6FW_MIN_VERSION_MINOR,4,2     ## @T6FW_MIN_VERSION_MINOR
	.comm	_T6FW_MIN_VERSION_MICRO,4,2     ## @T6FW_MIN_VERSION_MICRO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported chip type, %x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Card has firmware version %u.%u.%u, minimum supported firmware is %u.%u.%u.\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.t4_check_fw_version
l_switch.table.t4_check_fw_version:
	.quad	_T6FW_MIN_VERSION_MAJOR
	.quad	_T5FW_MIN_VERSION_MAJOR
	.quad	_T4FW_MIN_VERSION_MAJOR

	.p2align	3                               ## @switch.table.t4_check_fw_version.2
l_switch.table.t4_check_fw_version.2:
	.quad	_T6FW_MIN_VERSION_MINOR
	.quad	_T5FW_MIN_VERSION_MINOR
	.quad	_T4FW_MIN_VERSION_MINOR

	.p2align	3                               ## @switch.table.t4_check_fw_version.3
l_switch.table.t4_check_fw_version.3:
	.quad	_T6FW_MIN_VERSION_MICRO
	.quad	_T5FW_MIN_VERSION_MICRO
	.quad	_T4FW_MIN_VERSION_MICRO

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t4_check_fw_version            ; -- Begin function t4_check_fw_version
	.p2align	2
_t4_check_fw_version:                   ; @t4_check_fw_version
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x0
	add	x20, x0, #8
	ldr	w0, [x0, #12]
	bl	_CHELSIO_CHIP_VERSION
	mov	x21, x0
	mov	x0, x19
	mov	x1, x20
	bl	_t4_get_fw_version
	mov	w22, #0
Lloh0:
	adrp	x23, _EBUSY@GOTPAGE
Lloh1:
	ldr	x23, [x23, _EBUSY@GOTPAGEOFF]
Lloh2:
	adrp	x24, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x24, [x24, _EAGAIN@GOTPAGEOFF]
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w22, #2
	b.hi	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_t4_get_fw_version
	add	w22, w22, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23]
	cmn	w0, w8
	b.eq	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x24]
	cmn	w0, w8
	ccmp	w22, #3, #2, eq
	b.lo	LBB0_2
LBB0_5:
	cbnz	w0, LBB0_14
; %bb.6:
	ldr	w0, [x20]
	bl	_FW_HDR_FW_VER_MAJOR_G
	mov	x22, x0
	ldr	w0, [x20]
	bl	_FW_HDR_FW_VER_MINOR_G
	mov	x23, x0
	ldr	w0, [x20]
	bl	_FW_HDR_FW_VER_MICRO_G
                                        ; kill: def $w0 killed $w0 def $x0
	sub	w8, w21, #128
	cmp	w8, #3
	b.hs	LBB0_11
; %bb.7:
	sbfiz	x8, x8, #3, #32
Lloh4:
	adrp	x9, l_switch.table.t4_check_fw_version@PAGE
Lloh5:
	add	x9, x9, l_switch.table.t4_check_fw_version@PAGEOFF
	ldr	x9, [x9, x8]
Lloh6:
	adrp	x10, l_switch.table.t4_check_fw_version.2@PAGE
Lloh7:
	add	x10, x10, l_switch.table.t4_check_fw_version.2@PAGEOFF
	ldr	x10, [x10, x8]
Lloh8:
	adrp	x11, l_switch.table.t4_check_fw_version.3@PAGE
Lloh9:
	add	x11, x11, l_switch.table.t4_check_fw_version.3@PAGEOFF
	ldr	x8, [x11, x8]
	ldr	w11, [x8]
	ldr	w10, [x10]
	ldr	w9, [x9]
	cmp	w22, w9
	b.lt	LBB0_12
; %bb.8:
	ccmp	w23, w10, #0, eq
	b.lt	LBB0_12
; %bb.9:
	cmp	w22, w9
	ccmp	w23, w10, #0, eq
	ccmp	w0, w11, #0, eq
	b.lt	LBB0_12
; %bb.10:
	mov	w0, #0
	b	LBB0_14
LBB0_11:
	ldp	w0, w2, [x19]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:
	ldr	w8, [x19]
	stp	x10, x11, [sp, #24]
	stp	x0, x9, [sp, #8]
	str	x23, [sp]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x8
	mov	x2, x22
	bl	_dev_err
Lloh16:
	adrp	x8, _EFAULT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_T4FW_MIN_VERSION_MAJOR,4,2     ; @T4FW_MIN_VERSION_MAJOR
	.comm	_T4FW_MIN_VERSION_MINOR,4,2     ; @T4FW_MIN_VERSION_MINOR
	.comm	_T4FW_MIN_VERSION_MICRO,4,2     ; @T4FW_MIN_VERSION_MICRO
	.comm	_T5FW_MIN_VERSION_MAJOR,4,2     ; @T5FW_MIN_VERSION_MAJOR
	.comm	_T5FW_MIN_VERSION_MINOR,4,2     ; @T5FW_MIN_VERSION_MINOR
	.comm	_T5FW_MIN_VERSION_MICRO,4,2     ; @T5FW_MIN_VERSION_MICRO
	.comm	_T6FW_MIN_VERSION_MAJOR,4,2     ; @T6FW_MIN_VERSION_MAJOR
	.comm	_T6FW_MIN_VERSION_MINOR,4,2     ; @T6FW_MIN_VERSION_MINOR
	.comm	_T6FW_MIN_VERSION_MICRO,4,2     ; @T6FW_MIN_VERSION_MICRO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported chip type, %x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Card has firmware version %u.%u.%u, minimum supported firmware is %u.%u.%u.\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.t4_check_fw_version
l_switch.table.t4_check_fw_version:
	.quad	_T6FW_MIN_VERSION_MAJOR
	.quad	_T5FW_MIN_VERSION_MAJOR
	.quad	_T4FW_MIN_VERSION_MAJOR

	.p2align	3                               ; @switch.table.t4_check_fw_version.2
l_switch.table.t4_check_fw_version.2:
	.quad	_T6FW_MIN_VERSION_MINOR
	.quad	_T5FW_MIN_VERSION_MINOR
	.quad	_T4FW_MIN_VERSION_MINOR

	.p2align	3                               ; @switch.table.t4_check_fw_version.3
l_switch.table.t4_check_fw_version.3:
	.quad	_T6FW_MIN_VERSION_MICRO
	.quad	_T5FW_MIN_VERSION_MICRO
	.quad	_T4FW_MIN_VERSION_MICRO

.subsections_via_symbols
