	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ixgbe_dcb_calculate_tc_credits ## -- Begin function ixgbe_dcb_calculate_tc_credits
	.p2align	4, 0x90
_ixgbe_dcb_calculate_tc_credits:        ## @ixgbe_dcb_calculate_tc_credits
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movq	_DCB_CREDIT_QUANTUM@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	addl	%esi, %eax
	decl	%eax
	cltd
	idivl	%esi
	movl	%eax, %r11d
	movq	_MAX_TRAFFIC_CLASS@GOTPCREL(%rip), %rax
	movq	(%rax), %r9
	testq	%r9, %r9
	je	LBB0_16
## %bb.3:
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx), %rax
	movq	8(%rdx), %rdi
	movq	(%rax,%rcx,8), %r8
	addq	$8, %rdi
	movl	$100, %ebx
	leaq	(%rcx,%rcx,4), %r15
	movabsq	$2951479051793528259, %r14      ## imm = 0x28F5C28F5C28F5C3
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %r10d
	movq	(%rdi), %rax
	movq	(%rax,%r15,8), %rdx
	movq	8(%rax,%r15,8), %rsi
	imulq	(%r8,%rdx,8), %rsi
	movq	%rsi, %rax
	shrq	$2, %rax
	mulq	%r14
	movq	%rdx, %rbx
	shrq	$2, %rbx
	movl	%r10d, %eax
	cmpq	%rax, %rbx
	cmovael	%r10d, %ebx
	cmpq	$100, %rsi
	cmovbl	%r10d, %ebx
	addq	$16, %rdi
	decq	%r9
	jne	LBB0_4
## %bb.5:
	movl	%r11d, %eax
	cltd
	idivl	%ebx
	incl	%eax
	cltq
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx), %rdx
	testl	%eax, %eax
	cmovel	%eax, %esi
	movq	_ixgbe_mac_82598EB@GOTPCREL(%rip), %rdi
	cmpq	(%rdi), %rdx
	cmovnel	%eax, %esi
	movslq	%esi, %rax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	8(%rdx), %rdx
	movq	%rax, (%rdx,%r14)
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, 32(%r13,%r15,8)
	incq	%r12
	addq	$16, %r14
	movq	_MAX_TRAFFIC_CLASS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r12
	jae	LBB0_16
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	(%rdx), %rax
	movq	8(%rdx), %rdx
	movq	8(%rdx,%r14), %r13
	movq	(%rax,%rcx,8), %rax
	movq	(%r13,%r15,8), %rcx
	movq	8(%r13,%r15,8), %rsi
	movq	(%rax,%rcx,8), %rcx
	imulq	%rsi, %rcx
	movq	%rcx, %rax
	shrq	$2, %rax
	movabsq	$2951479051793528259, %rdx      ## imm = 0x28F5C28F5C28F5C3
	mulq	%rdx
	shrq	$2, %rdx
	cmpq	$100, %rcx
	movq	%rdx, %rbx
	movl	$1, %eax
	cmovbq	%rax, %rbx
	testq	%rsi, %rsi
	cmoveq	%rdx, %rbx
	movq	%rbx, 16(%r13,%r15,8)
	movq	%rbx, %rdi
	imulq	-64(%rbp), %rdi                 ## 8-byte Folded Reload
	movq	_MAX_CREDIT_REFILL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r11d, %r15d
	callq	_min
	movl	%r15d, %r11d
	cmpl	%r15d, %eax
	jg	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%r11d, %eax
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	cltq
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%rax, 24(%r13,%r15,8)
	movq	_MAX_CREDIT@GOTPCREL(%rip), %rax
	imulq	(%rax), %rbx
	shrq	$2, %rbx
	movq	%rbx, %rax
	movabsq	$2951479051793528259, %rcx      ## imm = 0x28F5C28F5C28F5C3
	mulq	%rcx
	shrq	$2, %rdx
	movl	%r11d, %eax
	cmpl	%edx, %r11d
	jg	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%edx, %eax
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	_DCB_TX_CONFIG@GOTPCREL(%rip), %rdx
	cmpq	%rcx, (%rdx)
	jne	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	_MINIMUM_CREDIT_FOR_TSO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%eax, %esi
	cmpl	%edx, %eax
	jg	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	movl	%edx, %esi
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	cltq
	jmp	LBB0_15
LBB0_16:
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_1:
	movq	_DCB_ERR_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DCB_ERR_CONFIG,4,2             ## @DCB_ERR_CONFIG
	.comm	_DCB_CREDIT_QUANTUM,4,2         ## @DCB_CREDIT_QUANTUM
	.comm	_MAX_TRAFFIC_CLASS,8,3          ## @MAX_TRAFFIC_CLASS
	.comm	_MAX_CREDIT_REFILL,4,2          ## @MAX_CREDIT_REFILL
	.comm	_MAX_CREDIT,8,3                 ## @MAX_CREDIT
	.comm	_DCB_TX_CONFIG,8,3              ## @DCB_TX_CONFIG
	.comm	_ixgbe_mac_82598EB,8,3          ## @ixgbe_mac_82598EB
	.comm	_MINIMUM_CREDIT_FOR_TSO,4,2     ## @MINIMUM_CREDIT_FOR_TSO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ixgbe_dcb_calculate_tc_credits ; -- Begin function ixgbe_dcb_calculate_tc_credits
	.p2align	2
_ixgbe_dcb_calculate_tc_credits:        ; @ixgbe_dcb_calculate_tc_credits
	.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
	str	x0, [sp]                        ; 8-byte Folded Spill
	cbz	x1, LBB0_10
; %bb.1:
	cmp	w2, #0
	cinc	w9, w2, lt
Lloh0:
	adrp	x8, _MAX_TRAFFIC_CLASS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_TRAFFIC_CLASS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_9
; %bb.2:
	mov	x19, x3
	mov	x20, x1
Lloh3:
	adrp	x10, _DCB_CREDIT_QUANTUM@GOTPAGE
Lloh4:
	ldr	x10, [x10, _DCB_CREDIT_QUANTUM@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	add	w9, w10, w9, asr #1
	sub	w11, w9, #1
	ldp	x9, x12, [x1]
	ldr	x9, [x9, x3, lsl #3]
	sdiv	w23, w11, w10
	add	x11, x12, #8
	mov	w10, #100
	mov	w12, #40
	mov	x13, #62915
	movk	x13, #23592, lsl #16
	movk	x13, #49807, lsl #32
	movk	x13, #10485, lsl #48
	mov	w14, #99
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x15, [x11], #16
	madd	x15, x19, x12, x15
	ldp	x16, x15, [x15]
	ldr	x16, [x9, x16, lsl #3]
	mul	x15, x15, x16
	lsr	x16, x15, #2
	umulh	x16, x16, x13
	lsr	x16, x16, #2
	cmp	x16, w10, uxtw
	ccmp	x15, x14, #0, lo
	csel	w10, w16, w10, hi
	subs	x8, x8, #1
	b.ne	LBB0_3
; %bb.4:
	mov	x24, #0
	mov	x25, #0
	sdiv	w8, w23, w10
	add	w8, w8, #1
	sxtw	x8, w8
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	mov	w27, #40
	mov	x28, #62915
	movk	x28, #23592, lsl #16
	movk	x28, #49807, lsl #32
	movk	x28, #10485, lsl #48
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [sp]                        ; 8-byte Folded Reload
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _ixgbe_mac_82598EB@GOTPAGE
Lloh7:
	ldr	x10, [x10, _ixgbe_mac_82598EB@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
Lloh9:
	adrp	x11, _MINIMUM_CREDIT_FOR_TSO@GOTPAGE
Lloh10:
	ldr	x11, [x11, _MINIMUM_CREDIT_FOR_TSO@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	cmp	w8, w11
	csel	w11, w8, w11, gt
	cmp	w8, #0
	ccmp	x9, x10, #0, ne
	csel	w8, w11, w8, eq
	sxtw	x8, w8
	ldr	x9, [x20, #8]
	str	x8, [x9, x24]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	madd	x9, x19, x27, x21
	str	x8, [x9, #32]
	add	x25, x25, #1
Lloh12:
	adrp	x8, _MAX_TRAFFIC_CLASS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAX_TRAFFIC_CLASS@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	add	x24, x24, #16
	cmp	x25, x8
	b.hs	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x9, x8, [x20]
	add	x8, x8, x24
	ldr	x21, [x8, #8]
	ldr	x8, [x9, x19, lsl #3]
	madd	x22, x19, x27, x21
	ldp	x9, x10, [x22]
	ldr	x8, [x8, x9, lsl #3]
	mul	x8, x10, x8
	lsr	x9, x8, #2
	umulh	x9, x9, x28
	lsr	x9, x9, #2
	cmp	x8, #100
	ccmp	x10, #0, #4, lo
	csinc	x26, x9, xzr, eq
	str	x26, [x22, #16]
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	mul	x0, x26, x8
Lloh15:
	adrp	x8, _MAX_CREDIT_REFILL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MAX_CREDIT_REFILL@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_min
	cmp	w0, w23
	csel	w8, w0, w23, gt
	sxtw	x8, w8
	str	x8, [x22, #24]
Lloh18:
	adrp	x8, _MAX_CREDIT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MAX_CREDIT@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	mul	x8, x8, x26
	lsr	x8, x8, #2
	umulh	x8, x8, x28
	lsr	x8, x8, #2
	cmp	w23, w8
	csel	w8, w23, w8, gt
Lloh21:
	adrp	x9, _DCB_TX_CONFIG@GOTPAGE
Lloh22:
	ldr	x9, [x9, _DCB_TX_CONFIG@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x19
	b.eq	LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	sxtw	x8, w8
	b	LBB0_6
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
Lloh24:
	adrp	x8, _DCB_ERR_CONFIG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DCB_ERR_CONFIG@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_DCB_ERR_CONFIG,4,2             ; @DCB_ERR_CONFIG
	.comm	_DCB_CREDIT_QUANTUM,4,2         ; @DCB_CREDIT_QUANTUM
	.comm	_MAX_TRAFFIC_CLASS,8,3          ; @MAX_TRAFFIC_CLASS
	.comm	_MAX_CREDIT_REFILL,4,2          ; @MAX_CREDIT_REFILL
	.comm	_MAX_CREDIT,8,3                 ; @MAX_CREDIT
	.comm	_DCB_TX_CONFIG,8,3              ; @DCB_TX_CONFIG
	.comm	_ixgbe_mac_82598EB,8,3          ; @ixgbe_mac_82598EB
	.comm	_MINIMUM_CREDIT_FOR_TSO,4,2     ; @MINIMUM_CREDIT_FOR_TSO
.subsections_via_symbols
