	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpsw_split_res                 ## -- Begin function cpsw_split_res
	.p2align	4, 0x90
_cpsw_split_res:                        ## @cpsw_split_res
	.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, %r12
	movq	24(%rdi), %r13
	movl	(%rdi), %ecx
	testl	%ecx, %ecx
	jle	LBB0_7
## %bb.1:
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r13,%rbx,8), %edi
	callq	_cpdma_chan_get_rate
	addl	%eax, %r15d
	cmpl	$1, %eax
	sbbl	$-1, %r14d
	incq	%rbx
	movslq	(%r12), %rsi
	cmpq	%rsi, %rbx
	jl	LBB0_2
## %bb.3:
	movl	%esi, %edi
	subl	%r14d, %edi
	je	LBB0_8
## %bb.4:
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.9:
	movl	4(%r12), %eax
	imull	$1000, %eax, %ecx               ## imm = 0x3E8
	imull	$10000, %eax, %eax              ## imm = 0x2710
	cmpl	%r15d, %ecx
	cmovgel	%ecx, %eax
	leal	(%rax,%rax), %ecx
	cmpl	%r15d, %eax
	leal	(%rcx,%rcx,4), %r8d
	cmovgel	%eax, %r8d
	movq	_CPSW_POLL_WEIGHT@GOTPCREL(%rip), %rax
	movl	%r15d, %ebx
	movl	(%rax), %r15d
	movl	%r15d, %eax
	imull	%ebx, %eax
	cltd
	idivl	%r8d
	movl	%r15d, %ecx
	subl	%eax, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, %eax
	subl	%ebx, %eax
	cltd
	idivl	%edi
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	jmp	LBB0_10
LBB0_7:
	xorl	%esi, %esi
	movl	$0, %r15d
	testl	%ecx, %ecx
	jne	LBB0_6
LBB0_8:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movq	_CPSW_POLL_WEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	xorl	%eax, %eax
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_10
LBB0_5:
	movl	%esi, %ecx
LBB0_6:
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	movq	_CPSW_POLL_WEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r15d, %eax
	cltd
	idivl	%ecx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	movl	%ecx, %esi
LBB0_10:
	testl	%esi, %esi
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_11
## %bb.12:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r13,%r12,8)
	testl	%ebx, %ebx
	cmovel	%r12d, %ebx
	xorl	%esi, %esi
LBB0_16:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	%r13, %r14
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	24(%r13), %rax
	movl	4(%rax,%r12,8), %edi
	callq	_cpdma_chan_set_weight
	subl	(%r14,%r12,8), %r15d
	incq	%r12
	movslq	(%r13), %rax
	cmpq	%rax, %r12
	movq	%r14, %r13
	jge	LBB0_17
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	4(%r13,%r12,8), %edi
	callq	_cpdma_chan_get_rate
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	%eax, %ecx
	movq	_CPSW_POLL_WEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	%ecx, %eax
	cltd
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	idivl	%esi
	testl	%eax, %eax
	movl	$1, %edi
	cmovel	%edi, %eax
	movl	%eax, (%r13,%r12,8)
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, %ecx
	cmovgl	%ecx, %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	cmovgl	%r12d, %ebx
	imull	$100, %ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, %esi
	testl	%eax, %eax
	cmovel	%edi, %esi
	jmp	LBB0_16
LBB0_11:
	xorl	%ebx, %ebx
LBB0_17:
	testl	%r15d, %r15d
	je	LBB0_19
## %bb.18:
	movslq	%ebx, %rax
	addl	%r15d, (%r13,%rax,8)
LBB0_19:
	movq	_CPSW_POLL_WEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-64(%rbp), %r10                 ## 8-byte Reload
	movl	8(%r10), %r9d
	movl	%ecx, %eax
	cltd
	idivl	%r9d
	testl	%r9d, %r9d
	jle	LBB0_32
## %bb.20:
	movq	16(%r10), %rcx
	cmpl	$8, %r9d
	jae	LBB0_22
## %bb.21:
	xorl	%edi, %edi
	jmp	LBB0_30
LBB0_22:
	movl	%r9d, %edi
	andl	$-8, %edi
	movd	%eax, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%rdi), %rsi
	movq	%rsi, %rbx
	shrq	$3, %rbx
	incq	%rbx
	movl	%ebx, %r8d
	andl	$7, %r8d
	cmpq	$56, %rsi
	jae	LBB0_24
## %bb.23:
	xorl	%esi, %esi
	jmp	LBB0_26
LBB0_24:
	andq	$-8, %rbx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%rcx,%rsi,4)
	movdqu	%xmm0, 16(%rcx,%rsi,4)
	movdqu	%xmm0, 32(%rcx,%rsi,4)
	movdqu	%xmm0, 48(%rcx,%rsi,4)
	movdqu	%xmm0, 64(%rcx,%rsi,4)
	movdqu	%xmm0, 80(%rcx,%rsi,4)
	movdqu	%xmm0, 96(%rcx,%rsi,4)
	movdqu	%xmm0, 112(%rcx,%rsi,4)
	movdqu	%xmm0, 128(%rcx,%rsi,4)
	movdqu	%xmm0, 144(%rcx,%rsi,4)
	movdqu	%xmm0, 160(%rcx,%rsi,4)
	movdqu	%xmm0, 176(%rcx,%rsi,4)
	movdqu	%xmm0, 192(%rcx,%rsi,4)
	movdqu	%xmm0, 208(%rcx,%rsi,4)
	movdqu	%xmm0, 224(%rcx,%rsi,4)
	movdqu	%xmm0, 240(%rcx,%rsi,4)
	addq	$64, %rsi
	addq	$-8, %rbx
	jne	LBB0_25
LBB0_26:
	testq	%r8, %r8
	je	LBB0_29
## %bb.27:
	leaq	(%rcx,%rsi,4), %rsi
	addq	$16, %rsi
	shlq	$5, %r8
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, -16(%rsi,%rbx)
	movdqu	%xmm0, (%rsi,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %r8
	jne	LBB0_28
LBB0_29:
	cmpq	%r9, %rdi
	je	LBB0_31
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, (%rcx,%rdi,4)
	incq	%rdi
	cmpq	%rdi, %r9
	jne	LBB0_30
LBB0_31:
	movl	%edx, %ecx
LBB0_32:
	testl	%ecx, %ecx
	je	LBB0_34
## %bb.33:
	movq	16(%r10), %rax
	addl	%ecx, (%rax)
LBB0_34:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CPSW_POLL_WEIGHT,4,2           ## @CPSW_POLL_WEIGHT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpsw_split_res                 ; -- Begin function cpsw_split_res
	.p2align	2
_cpsw_split_res:                        ; @cpsw_split_res
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	ldr	x20, [x0, #24]
	ldr	w9, [x0]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.1:
	mov	x23, #0
	mov	w21, #0
	mov	w22, #0
	add	x24, x20, #4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24], #8
	bl	_cpdma_chan_get_rate
	cmp	w0, #0
	add	w22, w0, w22
	cinc	w21, w21, ne
	add	x23, x23, #1
	ldrsw	x8, [x19]
	cmp	x23, x8
	b.lt	LBB0_2
; %bb.3:
	subs	w9, w8, w21
	b.eq	LBB0_7
; %bb.4:
	cbz	w21, LBB0_13
; %bb.5:
	ldr	w10, [x19, #4]
	mov	w11, #1000
	mul	w11, w10, w11
	mov	w12, #10000
	mul	w10, w10, w12
	cmp	w11, w22
	csel	w10, w10, w11, lt
	add	w11, w10, w10, lsl #2
	lsl	w11, w11, #1
	cmp	w10, w22
	csel	w10, w11, w10, lt
Lloh0:
	adrp	x11, _CPSW_POLL_WEIGHT@GOTPAGE
Lloh1:
	ldr	x11, [x11, _CPSW_POLL_WEIGHT@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x11]
	mul	w11, w23, w22
	sdiv	w11, w11, w10
	sub	w11, w23, w11
	sdiv	w25, w11, w9
	sub	w11, w10, w22
	mov	x22, x10
	sdiv	w24, w11, w9
	cmp	w8, #1
	b.ge	LBB0_8
	b	LBB0_15
LBB0_6:
	mov	w8, #0
	mov	w22, #0
	cbnz	w9, LBB0_14
LBB0_7:
	mov	w24, #0
	mov	w25, #0
Lloh3:
	adrp	x9, _CPSW_POLL_WEIGHT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CPSW_POLL_WEIGHT@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x9]
	cmp	w8, #1
	b.lt	LBB0_15
LBB0_8:
	mov	x27, #0
	mov	x28, #0
	mov	w26, #0
	mov	w21, #100
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	mov	w1, #0
	str	w25, [x20, x27]
	cmp	w26, #0
	csel	w26, w28, w26, eq
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x19, #24]
	add	x8, x8, x27
	ldr	w0, [x8, #4]
	bl	_cpdma_chan_set_weight
	ldr	w8, [x20, x27]
	sub	w23, w23, w8
	add	x28, x28, #1
	ldrsw	x8, [x19]
	add	x27, x27, #8
	cmp	x28, x8
	b.ge	LBB0_16
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	x8, x20, x27
	ldr	w0, [x8, #4]
	bl	_cpdma_chan_get_rate
	cbz	w0, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
Lloh6:
	adrp	x8, _CPSW_POLL_WEIGHT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CPSW_POLL_WEIGHT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mul	w8, w8, w0
	sdiv	w8, w8, w22
	cmp	w8, #0
	csinc	w8, w8, wzr, ne
	cmp	w0, w24
	csel	w24, w0, w24, gt
	str	w8, [x20, x27]
	csel	w26, w28, w26, gt
	mul	w8, w0, w21
	sdiv	w8, w8, w22
	cmp	w8, #0
	csinc	w1, w8, wzr, ne
	b	LBB0_10
LBB0_13:
	mov	x9, x8
LBB0_14:
	mov	w24, #0
Lloh9:
	adrp	x8, _CPSW_POLL_WEIGHT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CPSW_POLL_WEIGHT@GOTPAGEOFF]
Lloh11:
	ldr	w23, [x8]
	mov	x8, x9
	sdiv	w25, w23, w9
	cmp	w8, #1
	b.ge	LBB0_8
LBB0_15:
	mov	w26, #0
LBB0_16:
	cbz	w23, LBB0_18
; %bb.17:
	sbfiz	x8, x26, #3, #32
	ldr	w9, [x20, x8]
	add	w9, w9, w23
	str	w9, [x20, x8]
LBB0_18:
Lloh12:
	adrp	x8, _CPSW_POLL_WEIGHT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CPSW_POLL_WEIGHT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w11, [x19, #8]
	cmp	w11, #1
	b.lt	LBB0_27
; %bb.19:
	sdiv	w9, w8, w11
	ldr	x12, [x19, #16]
	mul	w10, w11, w9
	cmp	w11, #16
	b.hs	LBB0_21
; %bb.20:
	mov	x13, #0
	b	LBB0_24
LBB0_21:
	and	x13, x11, #0xfffffff0
	dup.4s	v0, w9
	add	x14, x12, #32
	mov	x15, x13
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x14, #-32]
	stp	q0, q0, [x14], #64
	subs	x15, x15, #16
	b.ne	LBB0_22
; %bb.23:
	cmp	x13, x11
	b.eq	LBB0_26
LBB0_24:
	add	x12, x12, x13, lsl #2
	sub	x11, x11, x13
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	str	w9, [x12], #4
	subs	x11, x11, #1
	b.ne	LBB0_25
LBB0_26:
	sub	w8, w8, w10
LBB0_27:
	cbz	w8, LBB0_29
; %bb.28:
	ldr	x9, [x19, #16]
	ldr	w10, [x9]
	add	w8, w10, w8
	str	w8, [x9]
LBB0_29:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_CPSW_POLL_WEIGHT,4,2           ; @CPSW_POLL_WEIGHT
.subsections_via_symbols
