	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qed_hw_init_pf_doorbell_bar
_qed_hw_init_pf_doorbell_bar:           ## @qed_hw_init_pf_doorbell_bar
	.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, %r15
	movq	_BAR_ID_1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	callq	_qed_hw_bar_size
	movl	%eax, %r13d
	movq	40(%r15), %rax
	cmpl	$2, (%rax)
	jl	LBB0_2
## %bb.1:
	movl	%r13d, %eax
	shrl	$31, %eax
	addl	%r13d, %eax
	sarl	%eax
	movl	%eax, %r13d
LBB0_2:
	movq	_PROTOCOLID_CORE@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_qed_cxt_get_proto_cid_start
	movl	%eax, %ebx
	movl	(%r14), %esi
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_qed_cxt_get_proto_cid_count
	addl	%eax, %ebx
	movq	_PROTOCOLID_ETH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_qed_cxt_get_proto_cid_count
	addl	%eax, %ebx
	movq	_QED_PF_DEMS_SIZE@GOTPCREL(%rip), %rax
	imull	(%rax), %ebx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_roundup
	movl	%eax, %r12d
	leal	4095(%r12), %edx
	testl	%eax, %eax
	cmovnsl	%eax, %edx
	movl	%r13d, %ebx
	subl	%eax, %ebx
	jge	LBB0_6
## %bb.3:
	movq	40(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	jmp	LBB0_4
LBB0_6:
	movq	_QED_MIN_PWM_REGION@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, %ebx
	jge	LBB0_8
## %bb.7:
	movq	40(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	movl	%ebx, %edx
	movl	%r13d, %r8d
	movl	%r12d, %r9d
	xorl	%eax, %eax
	callq	_DP_ERR
	jmp	LBB0_5
LBB0_8:
	movl	12(%r15), %r14d
	movq	_QED_ROCE_EDPM_MODE_ENABLE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	je	LBB0_11
## %bb.9:
	movq	_QED_ROCE_EDPM_MODE_FORCE_ON@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_11
## %bb.10:
	xorl	%eax, %eax
	movl	$1, %r13d
	jmp	LBB0_13
LBB0_11:
	xorl	%eax, %eax
	callq	_num_present_cpus
	movl	%eax, %r13d
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_qed_hw_init_dpi_size
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movq	_QED_ROCE_EDPM_MODE_ENABLE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r14d
	je	LBB0_16
LBB0_13:
	movq	_QED_ROCE_EDPM_MODE_DISABLE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r14d
	jne	LBB0_14
LBB0_16:
	movl	$1, %r13d
	movq	%r15, %rdi
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	%ebx, %edx
	movl	$1, %ecx
	callq	_qed_hw_init_dpi_size
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_qed_rdma_dpm_bar
	jmp	LBB0_17
LBB0_14:
	cmpq	$0, 32(%r15)
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	je	LBB0_17
## %bb.15:
	movl	$1, %r13d
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	$1, %ecx
	callq	_qed_hw_init_dpi_size
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_17:
	movslq	%r13d, %rax
	movq	%rax, 24(%r15)
	movl	4(%r15), %r13d
	movl	20(%r15), %r14d
	movq	%r15, %rdi
	callq	_qed_edpm_enabled
	testl	%eax, %eax
	leaq	L_.str.3(%rip), %rcx
	leaq	L_.str.4(%rip), %rax
	cmoveq	%rcx, %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	movl	%r14d, %r8d
	movl	%r13d, %r9d
	pushq	%r10
	pushq	%rax
	callq	_DP_INFO
	addq	$16, %rsp
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_19
## %bb.18:
	movl	4(%r15), %edx
	movl	16(%r15), %ecx
	leaq	L_.str.5(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r15, %rdi
LBB0_4:
	xorl	%eax, %eax
	callq	_DP_ERR
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_20:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	sarl	$12, %r14d
	movl	%r12d, 8(%r15)
	movq	_QED_PF_DEMS_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	3(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$2, %edi
	callq	_ilog2
	movq	_DORQ_REG_PF_ICID_BIT_SHIFT_NORM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r15, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%eax, %ecx
	callq	_qed_wr
	movq	_DORQ_REG_PF_MIN_ADDR_REG1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%r14d, %ecx
	callq	_qed_wr
	xorl	%r14d, %r14d
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_BAR_ID_1,4,2                   ## @BAR_ID_1
	.comm	_PROTOCOLID_CORE,4,2            ## @PROTOCOLID_CORE
	.comm	_PROTOCOLID_ETH,4,2             ## @PROTOCOLID_ETH
	.comm	_QED_PF_DEMS_SIZE,4,2           ## @QED_PF_DEMS_SIZE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Doorbell BAR size 0x%x is too small (normal region is 0x%0x )\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_QED_MIN_PWM_REGION,4,2         ## @QED_MIN_PWM_REGION
L_.str.1:                               ## @.str.1
	.asciz	"PWM region size 0x%0x is too small. Should be at least 0x%0x (Doorbell BAR size is 0x%x and normal region size is 0x%0x)\n"

	.comm	_QED_ROCE_EDPM_MODE_ENABLE,4,2  ## @QED_ROCE_EDPM_MODE_ENABLE
	.comm	_QED_ROCE_EDPM_MODE_FORCE_ON,4,2 ## @QED_ROCE_EDPM_MODE_FORCE_ON
	.comm	_QED_ROCE_EDPM_MODE_DISABLE,4,2 ## @QED_ROCE_EDPM_MODE_DISABLE
L_.str.2:                               ## @.str.2
	.asciz	"doorbell bar: normal_region_size=%d, pwm_region_size=%d, dpi_size=%d, dpi_count=%d, roce_edpm=%s, page_size=%lu\n"

L_.str.3:                               ## @.str.3
	.asciz	"disabled"

L_.str.4:                               ## @.str.4
	.asciz	"enabled"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to allocate enough DPIs. Allocated %d but the current minimum is %d.\n"

	.comm	_DORQ_REG_PF_ICID_BIT_SHIFT_NORM,4,2 ## @DORQ_REG_PF_ICID_BIT_SHIFT_NORM
	.comm	_DORQ_REG_PF_MIN_ADDR_REG1,4,2  ## @DORQ_REG_PF_MIN_ADDR_REG1
	.no_dead_strip	_qed_hw_init_pf_doorbell_bar
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qed_hw_init_pf_doorbell_bar
_qed_hw_init_pf_doorbell_bar:           ; @qed_hw_init_pf_doorbell_bar
	.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, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _BAR_ID_1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BAR_ID_1@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_qed_hw_bar_size
	ldr	x8, [x19, #40]
	ldr	w8, [x8]
	cmp	w0, #0
	cinc	w9, w0, lt
	asr	w9, w9, #1
	cmp	w8, #1
	csel	w23, w9, w0, gt
Lloh3:
	adrp	x22, _PROTOCOLID_CORE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PROTOCOLID_CORE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_qed_cxt_get_proto_cid_start
	mov	x21, x0
	ldr	w1, [x22]
	mov	x0, x19
	mov	x2, #0
	bl	_qed_cxt_get_proto_cid_count
	add	w21, w0, w21
Lloh5:
	adrp	x8, _PROTOCOLID_ETH@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PROTOCOLID_ETH@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_qed_cxt_get_proto_cid_count
Lloh8:
	adrp	x9, _QED_PF_DEMS_SIZE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _QED_PF_DEMS_SIZE@GOTPAGEOFF]
	add	w8, w21, w0
Lloh10:
	ldr	w9, [x9]
	mul	w0, w9, w8
Lloh11:
	adrp	x28, _PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x28, [x28, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x28]
	bl	_roundup
	mov	x21, x0
	add	w8, w0, #4095
	cmp	w0, #0
	csel	w27, w8, w0, lt
	subs	w22, w23, w0
	b.ge	LBB0_2
; %bb.1:
	ldr	x0, [x19, #40]
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x23
	mov	x3, x21
	b	LBB0_14
LBB0_2:
Lloh15:
	adrp	x8, _QED_MIN_PWM_REGION@GOTPAGE
Lloh16:
	ldr	x8, [x8, _QED_MIN_PWM_REGION@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	cmp	w22, w3
	b.ge	LBB0_4
; %bb.3:
	ldr	x0, [x19, #40]
	stp	x23, x21, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	b	LBB0_14
LBB0_4:
	ldr	w25, [x19, #12]
Lloh20:
	adrp	x26, _QED_ROCE_EDPM_MODE_ENABLE@GOTPAGE
Lloh21:
	ldr	x26, [x26, _QED_ROCE_EDPM_MODE_ENABLE@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh22:
	adrp	x9, _QED_ROCE_EDPM_MODE_FORCE_ON@GOTPAGE
Lloh23:
	ldr	x9, [x9, _QED_ROCE_EDPM_MODE_FORCE_ON@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	cmp	w25, w8
	ccmp	w25, w9, #4, ne
	b.ne	LBB0_7
; %bb.5:
	bl	_num_present_cpus
	mov	x24, x0
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	x3, x24
	bl	_qed_hw_init_dpi_size
	ldr	w8, [x26]
	cmp	w0, #0
	ccmp	w25, w8, #0, ne
	b.eq	LBB0_9
; %bb.6:
	mov	x23, x0
	b	LBB0_8
LBB0_7:
	mov	w23, #0
	mov	w24, #1
LBB0_8:
Lloh25:
	adrp	x8, _QED_ROCE_EDPM_MODE_DISABLE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _QED_ROCE_EDPM_MODE_DISABLE@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w25, w8
	b.ne	LBB0_10
LBB0_9:
	mov	w24, #1
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	w3, #1
	bl	_qed_hw_init_dpi_size
	mov	x23, x0
	mov	x0, x19
	mov	x1, x20
	bl	_qed_rdma_dpm_bar
	b	LBB0_12
LBB0_10:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_12
; %bb.11:
	mov	w24, #1
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	w3, #1
	bl	_qed_hw_init_dpi_size
	mov	x23, x0
LBB0_12:
	sxtw	x8, w24
	str	x8, [x19, #24]
	ldr	w24, [x19, #20]
	ldr	w25, [x19, #4]
	mov	x0, x19
	bl	_qed_edpm_enabled
Lloh28:
	adrp	x8, l_.str.4@PAGE
Lloh29:
	add	x8, x8, l_.str.4@PAGEOFF
Lloh30:
	adrp	x9, l_.str.3@PAGE
Lloh31:
	add	x9, x9, l_.str.3@PAGEOFF
	cmp	w0, #0
	csel	x6, x9, x8, eq
	ldr	w7, [x28]
Lloh32:
	adrp	x1, l_.str.2@PAGE
Lloh33:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	mov	x4, x24
	mov	x5, x25
	bl	_DP_INFO
	cbz	w23, LBB0_16
; %bb.13:
	ldr	w2, [x19, #4]
	ldr	w3, [x19, #16]
Lloh34:
	adrp	x1, l_.str.5@PAGE
Lloh35:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
LBB0_14:
	bl	_DP_ERR
Lloh36:
	adrp	x8, _EINVAL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	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
LBB0_16:
	asr	w22, w27, #12
	str	w21, [x19, #8]
Lloh39:
	adrp	x8, _QED_PF_DEMS_SIZE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _QED_PF_DEMS_SIZE@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w0, w8, #2
	bl	_ilog2
	mov	x3, x0
Lloh42:
	adrp	x8, _DORQ_REG_PF_ICID_BIT_SHIFT_NORM@GOTPAGE
Lloh43:
	ldr	x8, [x8, _DORQ_REG_PF_ICID_BIT_SHIFT_NORM@GOTPAGEOFF]
Lloh44:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_qed_wr
Lloh45:
	adrp	x8, _DORQ_REG_PF_MIN_ADDR_REG1@GOTPAGE
Lloh46:
	ldr	x8, [x8, _DORQ_REG_PF_MIN_ADDR_REG1@GOTPAGEOFF]
Lloh47:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	mov	x3, x22
	bl	_qed_wr
	mov	w0, #0
	b	LBB0_15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_BAR_ID_1,4,2                   ; @BAR_ID_1
	.comm	_PROTOCOLID_CORE,4,2            ; @PROTOCOLID_CORE
	.comm	_PROTOCOLID_ETH,4,2             ; @PROTOCOLID_ETH
	.comm	_QED_PF_DEMS_SIZE,4,2           ; @QED_PF_DEMS_SIZE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Doorbell BAR size 0x%x is too small (normal region is 0x%0x )\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_QED_MIN_PWM_REGION,4,2         ; @QED_MIN_PWM_REGION
l_.str.1:                               ; @.str.1
	.asciz	"PWM region size 0x%0x is too small. Should be at least 0x%0x (Doorbell BAR size is 0x%x and normal region size is 0x%0x)\n"

	.comm	_QED_ROCE_EDPM_MODE_ENABLE,4,2  ; @QED_ROCE_EDPM_MODE_ENABLE
	.comm	_QED_ROCE_EDPM_MODE_FORCE_ON,4,2 ; @QED_ROCE_EDPM_MODE_FORCE_ON
	.comm	_QED_ROCE_EDPM_MODE_DISABLE,4,2 ; @QED_ROCE_EDPM_MODE_DISABLE
l_.str.2:                               ; @.str.2
	.asciz	"doorbell bar: normal_region_size=%d, pwm_region_size=%d, dpi_size=%d, dpi_count=%d, roce_edpm=%s, page_size=%lu\n"

l_.str.3:                               ; @.str.3
	.asciz	"disabled"

l_.str.4:                               ; @.str.4
	.asciz	"enabled"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to allocate enough DPIs. Allocated %d but the current minimum is %d.\n"

	.comm	_DORQ_REG_PF_ICID_BIT_SHIFT_NORM,4,2 ; @DORQ_REG_PF_ICID_BIT_SHIFT_NORM
	.comm	_DORQ_REG_PF_MIN_ADDR_REG1,4,2  ; @DORQ_REG_PF_MIN_ADDR_REG1
	.no_dead_strip	_qed_hw_init_pf_doorbell_bar
.subsections_via_symbols
