	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_divide_channels
_niu_divide_channels:                   ## @niu_divide_channels
	.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
	movl	(%rdi), %edi
	movq	_NIU_NUM_RXCHAN@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	movl	%edx, %ebx
	testl	%edx, %edx
	je	LBB0_2
## %bb.3:
	leal	7(%r8), %edx
	testl	%r8d, %r8d
	cmovnsl	%r8d, %edx
	sarl	$3, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	imull	%ebx, %edx
	movl	%r8d, %eax
	subl	%edx, %eax
	cltd
	idivl	%esi
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_NIU_NUM_TXCHAN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$715827883, %rax, %rdx          ## imm = 0x2AAAAAAB
	movq	%rdx, %rcx
	shrq	$63, %rcx
	shrq	$32, %rdx
	addl	%ecx, %edx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	imull	%edx, %ebx
	subl	%ebx, %eax
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	%esi
	movl	%eax, %r14d
	jmp	LBB0_4
LBB0_2:
	movl	%r8d, %eax
	cltd
	idivl	%edi
	movl	%eax, %esi
	movq	_NIU_NUM_TXCHAN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cltd
	idivl	%edi
	movl	%eax, %r14d
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
LBB0_4:
	testl	%edi, %edi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_11
## %bb.5:
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	8(%r15), %rax
	movl	%ecx, (%rax,%r13,4)
	movq	16(%r15), %rcx
	movl	%r8d, (%rcx,%r13,4)
	movl	24(%r15), %esi
	movl	(%rax,%r13,4), %ecx
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %edx
	callq	_pr_info
	movq	8(%r15), %rax
	movq	16(%r15), %rcx
	addl	(%rax,%r13,4), %ebx
	addl	(%rcx,%r13,4), %r12d
	incq	%r13
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%r13, %rax
	je	LBB0_9
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	28(%r15), %edi
	movl	%r13d, %esi
	callq	_phy_decode
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	%r14d, %r8d
	movq	_PORT_TYPE_10G@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %r8d
	jmp	LBB0_8
LBB0_9:
	movq	_NIU_NUM_RXCHAN@GOTPCREL(%rip), %r13
	cmpl	(%r13), %ebx
	jle	LBB0_13
## %bb.10:
	movl	24(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %edx
	movq	%rax, %r14
	callq	_pr_err
	movq	8(%r15), %rdi
	leaq	(,%r14,4), %rdx
	leaq	L_.memset_pattern.4(%rip), %rsi
	callq	_memset_pattern16
	jmp	LBB0_13
LBB0_11:
	xorl	%r12d, %r12d
	movl	$0, %ebx
	testl	%r8d, %r8d
	movq	_NIU_NUM_RXCHAN@GOTPCREL(%rip), %r13
	jns	LBB0_13
## %bb.12:
	movl	24(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%edx, %edx
	callq	_pr_err
	xorl	%ebx, %ebx
LBB0_13:
	movq	_NIU_NUM_TXCHAN@GOTPCREL(%rip), %r14
	cmpl	(%r14), %r12d
	jle	LBB0_16
## %bb.14:
	movl	24(%r15), %esi
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %edx
	callq	_pr_err
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_16
## %bb.15:
	movq	16(%r15), %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	shlq	$2, %rdx
	leaq	L_.memset_pattern.4(%rip), %rsi
	callq	_memset_pattern16
LBB0_16:
	cmpl	(%r13), %ebx
	jl	LBB0_19
## %bb.17:
	cmpl	(%r14), %r12d
	jl	LBB0_19
## %bb.18:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	24(%r15), %esi
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pr_warn                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NIU_NUM_RXCHAN,4,2             ## @NIU_NUM_RXCHAN
	.comm	_NIU_NUM_TXCHAN,4,2             ## @NIU_NUM_TXCHAN
	.comm	_PORT_TYPE_10G,4,2              ## @PORT_TYPE_10G
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"niu%d: Port %u [%u RX chans] [%u TX chans]\n"

L_.str.1:                               ## @.str.1
	.asciz	"niu%d: Too many RX channels (%d), resetting to one per port\n"

L_.str.2:                               ## @.str.2
	.asciz	"niu%d: Too many TX channels (%d), resetting to one per port\n"

L_.str.3:                               ## @.str.3
	.asciz	"niu%d: Driver bug, wasted channels, RX[%d] TX[%d]\n"

	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## @.memset_pattern.4
L_.memset_pattern.4:
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1
	.long	1                               ## 0x1

	.no_dead_strip	_niu_divide_channels
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_divide_channels
_niu_divide_channels:                   ; @niu_divide_channels
	.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	w26, [x0]
Lloh0:
	adrp	x23, _NIU_NUM_RXCHAN@GOTPAGE
Lloh1:
	ldr	x23, [x23, _NIU_NUM_RXCHAN@GOTPAGEOFF]
	ldr	w8, [x23]
Lloh2:
	adrp	x22, _NIU_NUM_TXCHAN@GOTPAGE
Lloh3:
	ldr	x22, [x22, _NIU_NUM_TXCHAN@GOTPAGEOFF]
	cbz	w1, LBB0_6
; %bb.1:
	cbz	w2, LBB0_6
; %bb.2:
	add	w9, w8, #7
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w27, w9, #3
	msub	w9, w27, w2, w8
	sdiv	w28, w9, w1
	ldrsw	x9, [x22]
	mov	w10, #43691
	movk	w10, #10922, lsl #16
	mul	x10, x9, x10
	lsr	x11, x10, #63
	lsr	x10, x10, #32
	add	w25, w10, w11
	msub	w9, w25, w2, w9
	sdiv	w24, w9, w1
	cmp	w26, #1
	b.ge	LBB0_7
LBB0_3:
	tbz	w8, #31, LBB0_5
; %bb.4:
	ldr	w1, [x19, #24]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w2, #0
	bl	_pr_err
LBB0_5:
	mov	w20, #0
	mov	w21, #0
	b	LBB0_12
LBB0_6:
	ldr	w9, [x22]
	sdiv	w24, w9, w26
	mov	x25, x24
	sdiv	w27, w8, w26
	mov	x28, x27
	cmp	w26, #1
	b.lt	LBB0_3
LBB0_7:
	mov	x22, #0
	mov	w20, #0
	mov	w21, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #28]
	mov	x1, x22
	bl	_phy_decode
Lloh6:
	adrp	x8, _PORT_TYPE_10G@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PORT_TYPE_10G@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mov	x23, x26
	lsl	x26, x22, #2
	cmp	w0, w8
	csel	w8, w28, w27, eq
	ldp	x9, x10, [x19, #8]
	str	w8, [x9, x26]
	csel	w4, w24, w25, eq
	str	w4, [x10, x26]
	ldr	w1, [x19, #24]
	ldr	w3, [x9, x26]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x22
	bl	_pr_info
	ldp	x8, x9, [x19, #8]
	ldr	w8, [x8, x26]
	add	w21, w8, w21
	ldr	w8, [x9, x26]
	mov	x26, x23
	add	w20, w8, w20
	add	x22, x22, #1
	cmp	x23, x22
	b.ne	LBB0_8
; %bb.9:
Lloh11:
	adrp	x23, _NIU_NUM_RXCHAN@GOTPAGE
Lloh12:
	ldr	x23, [x23, _NIU_NUM_RXCHAN@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w21, w8
	b.le	LBB0_11
; %bb.10:
	ldr	w1, [x19, #24]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x21
	bl	_pr_err
	ldr	x0, [x19, #8]
	lsl	x2, x26, #2
Lloh15:
	adrp	x1, l_.memset_pattern.4@PAGE
Lloh16:
	add	x1, x1, l_.memset_pattern.4@PAGEOFF
	bl	_memset_pattern16
LBB0_11:
Lloh17:
	adrp	x22, _NIU_NUM_TXCHAN@GOTPAGE
Lloh18:
	ldr	x22, [x22, _NIU_NUM_TXCHAN@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x22]
	cmp	w20, w8
	b.le	LBB0_15
; %bb.13:
	ldr	w1, [x19, #24]
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_pr_err
	cmp	w26, #1
	b.lt	LBB0_15
; %bb.14:
	ldr	x0, [x19, #16]
	lsl	x2, x26, #2
Lloh21:
	adrp	x1, l_.memset_pattern.4@PAGE
Lloh22:
	add	x1, x1, l_.memset_pattern.4@PAGEOFF
	bl	_memset_pattern16
LBB0_15:
	ldr	w8, [x23]
	cmp	w21, w8
	b.lt	LBB0_18
; %bb.16:
	ldr	w8, [x22]
	cmp	w20, w8
	b.lt	LBB0_18
; %bb.17:
	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
LBB0_18:
	ldr	w1, [x19, #24]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	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
	b	_pr_warn
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_NIU_NUM_RXCHAN,4,2             ; @NIU_NUM_RXCHAN
	.comm	_NIU_NUM_TXCHAN,4,2             ; @NIU_NUM_TXCHAN
	.comm	_PORT_TYPE_10G,4,2              ; @PORT_TYPE_10G
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"niu%d: Port %u [%u RX chans] [%u TX chans]\n"

l_.str.1:                               ; @.str.1
	.asciz	"niu%d: Too many RX channels (%d), resetting to one per port\n"

l_.str.2:                               ; @.str.2
	.asciz	"niu%d: Too many TX channels (%d), resetting to one per port\n"

l_.str.3:                               ; @.str.3
	.asciz	"niu%d: Driver bug, wasted channels, RX[%d] TX[%d]\n"

	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; @.memset_pattern.4
l_.memset_pattern.4:
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	1                               ; 0x1
	.long	1                               ; 0x1

	.no_dead_strip	_niu_divide_channels
.subsections_via_symbols
