	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_ldg_assign_ldn
_niu_ldg_assign_ldn:                    ## @niu_ldg_assign_ldn
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_NIU_LDG_MIN@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	jg	LBB0_2
## %bb.1:
	movl	%edx, %ebx
	movq	_NIU_LDG_MAX@GOTPCREL(%rip), %rax
	cmpl	%edx, (%rax)
	jl	LBB0_2
## %bb.3:
	movl	%ecx, %r14d
	testl	%ecx, %ecx
	js	LBB0_2
## %bb.4:
	movq	_LDN_MAX@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jl	LBB0_2
## %bb.5:
	movq	%rdi, %r15
	movq	(%rsi), %rax
	movl	%r14d, %ecx
	movl	%ebx, (%rax,%rcx,4)
	movq	8(%rdi), %rax
	movq	(%rax), %r12
	movq	_PLAT_TYPE_NIU@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movl	%r14d, %edi
	callq	_LDG_NUM
	movl	%eax, %edi
	cmpq	%r13, %r12
	jne	LBB0_8
## %bb.6:
	callq	_nr64
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	%ebx, %ecx
	je	LBB0_9
## %bb.7:
	movl	(%r15), %r12d
	movl	4(%r15), %r15d
	movl	%r14d, %edi
	callq	_LDG_NUM
	movl	%eax, %edi
	callq	_nr64
	movslq	%eax, %r9
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	callq	_dev_err
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%ebx, %esi
	callq	_nw64
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_NIU_LDG_MIN,4,2                ## @NIU_LDG_MIN
	.comm	_NIU_LDG_MAX,4,2                ## @NIU_LDG_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LDN_MAX,4,2                    ## @LDN_MAX
	.comm	_PLAT_TYPE_NIU,8,3              ## @PLAT_TYPE_NIU
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Port %u, mis-matched LDG assignment for ldn %d, should be %d is %llu\n"

	.no_dead_strip	_niu_ldg_assign_ldn
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_ldg_assign_ldn
_niu_ldg_assign_ldn:                    ; @niu_ldg_assign_ldn
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _NIU_LDG_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NIU_LDG_MIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _NIU_LDG_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NIU_LDG_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w2
	ccmp	w9, w2, #8, le
	b.lt	LBB0_6
; %bb.1:
	mov	x20, x3
	tbnz	w3, #31, LBB0_6
; %bb.2:
Lloh6:
	adrp	x8, _LDN_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LDN_MAX@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w20
	b.lt	LBB0_6
; %bb.3:
	mov	x19, x2
	mov	x21, x0
	ldr	x8, [x1]
	str	w2, [x8, w20, uxtw #2]
	ldr	x8, [x0, #8]
	ldr	x22, [x8]
Lloh9:
	adrp	x8, _PLAT_TYPE_NIU@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PLAT_TYPE_NIU@GOTPAGEOFF]
Lloh11:
	ldr	x23, [x8]
	mov	x0, x20
	bl	_LDG_NUM
	cmp	x22, x23
	b.ne	LBB0_8
; %bb.4:
	bl	_nr64
	cmp	w0, w19
	b.eq	LBB0_9
; %bb.5:
	ldp	w21, w22, [x21]
	mov	x0, x20
	bl	_LDG_NUM
	bl	_nr64
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x5, w0
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	mov	x3, x20
	mov	x4, x19
	bl	_dev_err
LBB0_6:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
	mov	x1, x19
	bl	_nw64
LBB0_9:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_NIU_LDG_MIN,4,2                ; @NIU_LDG_MIN
	.comm	_NIU_LDG_MAX,4,2                ; @NIU_LDG_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LDN_MAX,4,2                    ; @LDN_MAX
	.comm	_PLAT_TYPE_NIU,8,3              ; @PLAT_TYPE_NIU
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Port %u, mis-matched LDG assignment for ldn %d, should be %d is %llu\n"

	.no_dead_strip	_niu_ldg_assign_ldn
.subsections_via_symbols
