	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpsw_set_fifo_bw
_cpsw_set_fifo_bw:                      ## @cpsw_set_fifo_bw
	.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, %rbx
	imull	$1000, (%rdi), %eax             ## imm = 0x3E8
	cmpl	%edx, %eax
	jge	LBB0_1
LBB0_18:
	movl	16(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_err
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_20
LBB0_1:
	movl	%esi, %r12d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	24(%rbx), %rdi
	movq	(%rdi), %r14
	movq	%rbx, %rsi
	callq	_cpsw_slave_index
	leaq	(%r14,%rax,4), %rdi
	movq	_SEND_PERCENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	callq	_slave_read
	movl	%eax, %r13d
	movq	_CPSW_FIFO_SHAPERS_NUM@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%r15d, %r15d
	movslq	%r12d, %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	jle	LBB0_2
## %bb.3:
	movl	%r12d, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leal	-8(,%r14,8), %r15d
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	xorl	%r12d, %r12d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_CPSW_PCT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	notl	%eax
	andl	%eax, %r13d
	movl	(%rbx), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %esi
	callq	_DIV_ROUND_UP
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%eax, %r12d
	testl	%eax, %eax
	movl	$1, %eax
	cmovel	%eax, %r12d
	movl	%r12d, %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	orl	%eax, %r13d
	addl	%r12d, -48(%rbp)                ## 4-byte Folded Spill
LBB0_15:                                ##   in Loop: Header=BB0_4 Depth=1
	leaq	-1(%r14), %rax
	addl	$-8, %r15d
	cmpq	$1, %r14
	movq	%rax, %r14
	jle	LBB0_16
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	testl	%edi, %edi
	je	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%rbx), %rax
	movl	(%rax,%r14,4), %eax
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	-56(%rbp), %r14                 ## 8-byte Folded Reload
	jg	LBB0_10
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%r14, -80(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%r13d, %eax
	movl	%r15d, %ecx
	sarl	%cl, %eax
	movq	_CPSW_PCT_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	addl	%eax, -48(%rbp)                 ## 4-byte Folded Spill
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpq	-56(%rbp), %r14                 ## 8-byte Folded Reload
	jge	LBB0_15
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%rbx), %rax
	cmpl	$0, (%rax,%r14,4)
	je	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	16(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_warn
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_15
LBB0_2:
	xorl	%r12d, %r12d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_17
LBB0_16:
	cmpl	$99, -48(%rbp)                  ## 4-byte Folded Reload
	movl	$0, %r15d
	jg	LBB0_18
LBB0_17:
	movl	%edi, %r14d
	movq	_SEND_PERCENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	callq	_slave_write
	movq	8(%rbx), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%r14d, (%rax,%rcx,4)
	movl	16(%rbx), %r14d
	imull	(%rbx), %r12d
	movl	%r12d, %edi
	movl	$100, %esi
	callq	_DIV_ROUND_CLOSEST
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_20:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	16(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_SEND_PERCENT,4,2               ## @SEND_PERCENT
	.comm	_CPSW_FIFO_SHAPERS_NUM,4,2      ## @CPSW_FIFO_SHAPERS_NUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Prev FIFO%d is shaped"

L_.str.1:                               ## @.str.1
	.asciz	"Upper FIFO%d is not shaped"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CPSW_PCT_MASK,4,2              ## @CPSW_PCT_MASK
L_.str.2:                               ## @.str.2
	.asciz	"set FIFO%d bw = %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Bandwidth doesn't fit in tc configuration"

	.no_dead_strip	_cpsw_set_fifo_bw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpsw_set_fifo_bw
_cpsw_set_fifo_bw:                      ; @cpsw_set_fifo_bw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x0
	ldr	w8, [x0]
	mov	w9, #1000
	mul	w8, w8, w9
	cmp	w8, w2
	b.ge	LBB0_3
LBB0_1:
	ldr	w0, [x20, #16]
Lloh0:
	adrp	x1, l_.str.3@PAGE
Lloh1:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_2:
	bl	_dev_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_18
LBB0_3:
	mov	x21, x2
	mov	x22, x1
	ldr	x0, [x20, #24]
	ldr	x19, [x0]
	mov	x1, x20
	bl	_cpsw_slave_index
	add	x19, x19, x0, lsl #2
Lloh5:
	adrp	x25, _SEND_PERCENT@GOTPAGE
Lloh6:
	ldr	x25, [x25, _SEND_PERCENT@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	bl	_slave_read
	mov	x23, x0
Lloh7:
	adrp	x8, _CPSW_FIFO_SHAPERS_NUM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _CPSW_FIFO_SHAPERS_NUM@GOTPAGEOFF]
Lloh9:
	ldr	w24, [x8]
	cmp	w24, #1
	b.lt	LBB0_15
; %bb.4:
	stp	x19, x22, [sp, #16]             ; 16-byte Folded Spill
	mov	w28, #0
	mov	w27, #0
	sxtw	x26, w22
	mov	w25, w22
	lsl	w8, w24, #3
	sub	w22, w8, #8
Lloh10:
	adrp	x19, _CPSW_PCT_MASK@GOTPAGE
Lloh11:
	ldr	x19, [x19, _CPSW_PCT_MASK@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x19]
	lsl	w8, w8, w22
	bic	w23, w23, w8
	ldr	w8, [x20]
	add	w8, w8, w8, lsl #2
	lsl	w1, w8, #1
	mov	x0, x21
	bl	_DIV_ROUND_UP
	cmp	w0, #0
	csinc	w27, w0, wzr, ne
	lsl	w8, w27, w22
	orr	w23, w8, w23
	add	w28, w27, w28
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	sub	w22, w22, #8
	subs	x24, x24, #1
	b.le	LBB0_16
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	cbz	w21, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x20, #8]
	ldr	w8, [x8, x24, lsl #2]
	cmp	w8, #0
	ccmp	x24, x26, #4, eq
	b.gt	LBB0_19
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	x25, x24
	b.eq	LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	cbz	w8, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	asr	w8, w23, w22
	ldr	w9, [x19]
	and	w8, w9, w8
	add	w28, w8, w28
	b	LBB0_6
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	x24, x26
	b.ge	LBB0_6
; %bb.13:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x20, #8]
	ldr	w8, [x8, x24, lsl #2]
	cbz	w8, LBB0_6
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x20, #16]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x24
	bl	_dev_warn
	b	LBB0_6
LBB0_15:
	mov	w27, #0
	b	LBB0_17
LBB0_16:
	cmp	w28, #99
	ldp	x19, x22, [sp, #16]             ; 16-byte Folded Reload
Lloh14:
	adrp	x25, _SEND_PERCENT@GOTPAGE
Lloh15:
	ldr	x25, [x25, _SEND_PERCENT@GOTPAGEOFF]
	b.gt	LBB0_1
LBB0_17:
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, x23
	bl	_slave_write
	ldr	x8, [x20, #8]
	str	w21, [x8, w22, sxtw #2]
	ldr	w21, [x20, #16]
	ldr	w8, [x20]
	mul	w0, w8, w27
	mov	w1, #100
	bl	_DIV_ROUND_CLOSEST
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_dev_warn
	mov	w0, #0
LBB0_18:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_19:
	ldr	w0, [x20, #16]
	str	x24, [sp]
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_SEND_PERCENT,4,2               ; @SEND_PERCENT
	.comm	_CPSW_FIFO_SHAPERS_NUM,4,2      ; @CPSW_FIFO_SHAPERS_NUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Prev FIFO%d is shaped"

l_.str.1:                               ; @.str.1
	.asciz	"Upper FIFO%d is not shaped"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CPSW_PCT_MASK,4,2              ; @CPSW_PCT_MASK
l_.str.2:                               ; @.str.2
	.asciz	"set FIFO%d bw = %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Bandwidth doesn't fit in tc configuration"

	.no_dead_strip	_cpsw_set_fifo_bw
.subsections_via_symbols
