	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qed_calc_hw_mode
_qed_calc_hw_mode:                      ## @qed_calc_hw_mode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %rdi
	callq	_QED_IS_BB_B0
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_MODE_BB@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	8(%r14), %rdi
	callq	_QED_IS_AH
	testq	%rax, %rax
	je	LBB0_17
## %bb.3:
	movq	_MODE_K2@GOTPCREL(%rip), %rax
LBB0_4:
	movb	(%rax), %cl
	movl	$1, %ebx
	shll	%cl, %ebx
	movq	8(%r14), %rsi
	movl	4(%rsi), %edx
	cmpl	$1, %edx
	je	LBB0_5
## %bb.6:
	cmpl	$4, %edx
	je	LBB0_11
## %bb.7:
	cmpl	$2, %edx
	jne	LBB0_9
## %bb.8:
	movq	_MODE_PORTS_PER_ENG_2@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_5:
	movq	_MODE_PORTS_PER_ENG_1@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_MODE_PORTS_PER_ENG_4@GOTPCREL(%rip), %rax
LBB0_12:
	movb	(%rax), %al
	btsl	%eax, %ebx
	movq	_QED_MF_OVLAN_CLSS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$12, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_13
## %bb.14:
	movq	_MODE_MF_SI@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_13:
	movq	_MODE_MF_SD@GOTPCREL(%rip), %rax
LBB0_15:
	movb	(%rax), %al
	btsl	%eax, %ebx
	movq	_MODE_ASIC@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	btsl	%eax, %ebx
	movq	8(%r14), %rdx
	movq	_MODE_100G@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$1, %eax
	shll	%cl, %eax
	xorl	%r15d, %r15d
	cmpl	$2, 8(%rdx)
	cmovll	%r15d, %eax
	orl	%ebx, %eax
	movl	%eax, (%r14)
	movq	_NETIF_MSG_PROBE@GOTPCREL(%rip), %rcx
	movq	_NETIF_MSG_IFUP@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	movl	%eax, %ecx
	callq	_DP_VERBOSE
	jmp	LBB0_16
LBB0_9:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_10
LBB0_17:
	movq	8(%r14), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
LBB0_10:
	movq	%r14, %rdi
	callq	_DP_NOTICE
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_16:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MODE_BB,4,2                    ## @MODE_BB
	.comm	_MODE_K2,4,2                    ## @MODE_K2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unknown chip type %#x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MODE_PORTS_PER_ENG_1,4,2       ## @MODE_PORTS_PER_ENG_1
	.comm	_MODE_PORTS_PER_ENG_2,4,2       ## @MODE_PORTS_PER_ENG_2
	.comm	_MODE_PORTS_PER_ENG_4,4,2       ## @MODE_PORTS_PER_ENG_4
L_.str.1:                               ## @.str.1
	.asciz	"num_ports_in_engine = %d not supported\n"

	.comm	_QED_MF_OVLAN_CLSS,4,2          ## @QED_MF_OVLAN_CLSS
	.comm	_MODE_MF_SD,4,2                 ## @MODE_MF_SD
	.comm	_MODE_MF_SI,4,2                 ## @MODE_MF_SI
	.comm	_MODE_ASIC,4,2                  ## @MODE_ASIC
	.comm	_MODE_100G,4,2                  ## @MODE_100G
	.comm	_NETIF_MSG_PROBE,4,2            ## @NETIF_MSG_PROBE
	.comm	_NETIF_MSG_IFUP,4,2             ## @NETIF_MSG_IFUP
L_.str.2:                               ## @.str.2
	.asciz	"Configuring function for hw_mode: 0x%08x\n"

	.no_dead_strip	_qed_calc_hw_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qed_calc_hw_mode
_qed_calc_hw_mode:                      ; @qed_calc_hw_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	ldr	x0, [x0, #8]
	bl	_QED_IS_BB_B0
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _MODE_BB@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MODE_BB@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	ldr	x0, [x19, #8]
	bl	_QED_IS_AH
	cbz	x0, LBB0_12
; %bb.3:
Lloh2:
	adrp	x8, _MODE_K2@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MODE_K2@GOTPAGEOFF]
LBB0_4:
	ldr	w9, [x8]
	ldr	x8, [x19, #8]
	ldr	w2, [x8, #4]
	cmp	w2, #1
	b.eq	LBB0_8
; %bb.5:
	cmp	w2, #4
	b.eq	LBB0_9
; %bb.6:
	cmp	w2, #2
	b.ne	LBB0_11
; %bb.7:
Lloh4:
	adrp	x10, _MODE_PORTS_PER_ENG_2@GOTPAGE
Lloh5:
	ldr	x10, [x10, _MODE_PORTS_PER_ENG_2@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
Lloh6:
	adrp	x10, _MODE_PORTS_PER_ENG_1@GOTPAGE
Lloh7:
	ldr	x10, [x10, _MODE_PORTS_PER_ENG_1@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh8:
	adrp	x10, _MODE_PORTS_PER_ENG_4@GOTPAGE
Lloh9:
	ldr	x10, [x10, _MODE_PORTS_PER_ENG_4@GOTPAGEOFF]
LBB0_10:
	mov	w20, #1
	lsl	w9, w20, w9
	ldr	w10, [x10]
	lsl	w10, w20, w10
	orr	w21, w10, w9
Lloh10:
	adrp	x9, _QED_MF_OVLAN_CLSS@GOTPAGE
Lloh11:
	ldr	x9, [x9, _QED_MF_OVLAN_CLSS@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x9]
	add	x1, x8, #12
	bl	_test_bit
Lloh13:
	adrp	x8, _MODE_MF_SI@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MODE_MF_SI@GOTPAGEOFF]
Lloh15:
	adrp	x9, _MODE_MF_SD@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MODE_MF_SD@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	lsl	w8, w20, w8
	orr	w8, w21, w8
Lloh17:
	adrp	x9, _MODE_ASIC@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MODE_ASIC@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	lsl	w9, w20, w9
	orr	w8, w8, w9
	ldr	x9, [x19, #8]
	ldr	w9, [x9, #8]
Lloh20:
	adrp	x10, _MODE_100G@GOTPAGE
Lloh21:
	ldr	x10, [x10, _MODE_100G@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	lsl	w10, w20, w10
	cmp	w9, #1
	csel	w9, w10, wzr, gt
	orr	w3, w8, w9
Lloh23:
	adrp	x8, _NETIF_MSG_PROBE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _NETIF_MSG_PROBE@GOTPAGEOFF]
	str	w3, [x19]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _NETIF_MSG_IFUP@GOTPAGE
Lloh27:
	ldr	x9, [x9, _NETIF_MSG_IFUP@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh29:
	adrp	x2, l_.str.2@PAGE
Lloh30:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_DP_VERBOSE
	mov	w0, #0
	b	LBB0_14
LBB0_11:
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_13
LBB0_12:
	ldr	x8, [x19, #8]
	ldr	w2, [x8]
Lloh33:
	adrp	x1, l_.str@PAGE
Lloh34:
	add	x1, x1, l_.str@PAGEOFF
LBB0_13:
	mov	x0, x19
	bl	_DP_NOTICE
Lloh35:
	adrp	x8, _EINVAL@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_MODE_BB,4,2                    ; @MODE_BB
	.comm	_MODE_K2,4,2                    ; @MODE_K2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unknown chip type %#x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MODE_PORTS_PER_ENG_1,4,2       ; @MODE_PORTS_PER_ENG_1
	.comm	_MODE_PORTS_PER_ENG_2,4,2       ; @MODE_PORTS_PER_ENG_2
	.comm	_MODE_PORTS_PER_ENG_4,4,2       ; @MODE_PORTS_PER_ENG_4
l_.str.1:                               ; @.str.1
	.asciz	"num_ports_in_engine = %d not supported\n"

	.comm	_QED_MF_OVLAN_CLSS,4,2          ; @QED_MF_OVLAN_CLSS
	.comm	_MODE_MF_SD,4,2                 ; @MODE_MF_SD
	.comm	_MODE_MF_SI,4,2                 ; @MODE_MF_SI
	.comm	_MODE_ASIC,4,2                  ; @MODE_ASIC
	.comm	_MODE_100G,4,2                  ; @MODE_100G
	.comm	_NETIF_MSG_PROBE,4,2            ; @NETIF_MSG_PROBE
	.comm	_NETIF_MSG_IFUP,4,2             ; @NETIF_MSG_IFUP
l_.str.2:                               ; @.str.2
	.asciz	"Configuring function for hw_mode: 0x%08x\n"

	.no_dead_strip	_qed_calc_hw_mode
.subsections_via_symbols
