	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function niu_pci_vpd_validate
_niu_pci_vpd_validate:                  ## @niu_pci_vpd_validate
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %rdi
	movq	40(%rbx), %r14
	callq	_is_valid_ether_addr
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movl	28(%rbx), %edi
	movq	_NIU_ALONSO_MDL_STR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	28(%rbx), %edi
	movq	_NIU_KIMI_MDL_STR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_5
## %bb.9:
	movl	28(%rbx), %edi
	movq	_NIU_FOXXY_MDL_STR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_10
## %bb.14:
	movl	24(%rbx), %esi
	movq	%rbx, %rdi
	callq	_niu_phy_type_prop_decode
	testq	%rax, %rax
	je	LBB0_11
## %bb.15:
	movl	8(%rbx), %edi
	movl	24(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movl	8(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_5:
	movq	_NIU_FLAGS_10G@GOTPCREL(%rip), %rax
	movl	(%rbx), %esi
	movl	4(%rbx), %edi
	orl	(%rax), %esi
	movl	%esi, (%rbx)
	movq	_NIU_FLAGS_FIBER@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	notl	%ecx
	andl	%esi, %ecx
	movl	%ecx, (%rbx)
	movq	_NIU_FLAGS_XCVR_SERDES@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movl	%ecx, (%rbx)
	movq	_MAC_XCVR_PCS@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, 32(%rbx)
	cmpl	$2, %edi
	jl	LBB0_7
## %bb.6:
	orl	(%rdx), %ecx
	movl	%ecx, (%rbx)
	movl	(%rax), %edx
	notl	%edx
	andl	%edx, %ecx
	movl	%ecx, (%rbx)
LBB0_7:
	testl	%ecx, (%rax)
	je	LBB0_11
## %bb.8:
	movq	_MAC_XCVR_XPCS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	jmp	LBB0_11
LBB0_1:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
LBB0_2:
	xorl	%eax, %eax
	callq	_dev_err
	movq	_NIU_FLAGS_VPD_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%rbx)
	jmp	LBB0_13
LBB0_10:
	movq	_NIU_FLAGS_10G@GOTPCREL(%rip), %rax
	movq	_NIU_FLAGS_FIBER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_NIU_FLAGS_HOTPLUG_PHY@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	orl	%ecx, (%rbx)
LBB0_11:
	movq	(%r14), %rdi
	movq	16(%rbx), %rsi
	movq	_ETH_ALEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movq	(%r14), %rax
	movslq	4(%rbx), %rcx
	addq	%rcx, 40(%rax)
	testq	%rcx, %rcx
	jns	LBB0_13
## %bb.12:
	incq	32(%rax)
LBB0_13:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VPD MAC invalid, falling back to SPROM\n"

	.comm	_NIU_FLAGS_VPD_VALID,4,2        ## @NIU_FLAGS_VPD_VALID
	.comm	_NIU_ALONSO_MDL_STR,4,2         ## @NIU_ALONSO_MDL_STR
	.comm	_NIU_KIMI_MDL_STR,4,2           ## @NIU_KIMI_MDL_STR
	.comm	_NIU_FLAGS_10G,4,2              ## @NIU_FLAGS_10G
	.comm	_NIU_FLAGS_FIBER,4,2            ## @NIU_FLAGS_FIBER
	.comm	_NIU_FLAGS_XCVR_SERDES,4,2      ## @NIU_FLAGS_XCVR_SERDES
	.comm	_MAC_XCVR_PCS,4,2               ## @MAC_XCVR_PCS
	.comm	_MAC_XCVR_XPCS,4,2              ## @MAC_XCVR_XPCS
	.comm	_NIU_FOXXY_MDL_STR,4,2          ## @NIU_FOXXY_MDL_STR
	.comm	_NIU_FLAGS_HOTPLUG_PHY,4,2      ## @NIU_FLAGS_HOTPLUG_PHY
L_.str.1:                               ## @.str.1
	.asciz	"Illegal phy string [%s]\n"

L_.str.2:                               ## @.str.2
	.asciz	"Falling back to SPROM\n"

	.comm	_ETH_ALEN,4,2                   ## @ETH_ALEN
	.no_dead_strip	_niu_pci_vpd_validate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function niu_pci_vpd_validate
_niu_pci_vpd_validate:                  ; @niu_pci_vpd_validate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	x20, [x0, #40]
	ldr	x0, [x0, #16]
	bl	_is_valid_ether_addr
	cbz	w0, LBB0_10
; %bb.1:
	ldr	w0, [x19, #28]
Lloh0:
	adrp	x8, _NIU_ALONSO_MDL_STR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NIU_ALONSO_MDL_STR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_strcmp
	cbz	w0, LBB0_6
; %bb.2:
	ldr	w0, [x19, #28]
Lloh3:
	adrp	x8, _NIU_KIMI_MDL_STR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NIU_KIMI_MDL_STR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_strcmp
	cbz	w0, LBB0_6
; %bb.3:
	ldr	w0, [x19, #28]
Lloh6:
	adrp	x8, _NIU_FOXXY_MDL_STR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NIU_FOXXY_MDL_STR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_strcmp
	cbz	w0, LBB0_12
; %bb.4:
	ldr	w1, [x19, #24]
	mov	x0, x19
	bl	_niu_phy_type_prop_decode
	cbz	x0, LBB0_13
; %bb.5:
	ldr	w0, [x19, #8]
	ldr	w8, [x19, #24]
	str	x8, [sp]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w0, [x19, #8]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_6:
Lloh13:
	adrp	x8, _NIU_FLAGS_10G@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NIU_FLAGS_10G@GOTPAGEOFF]
	ldr	w9, [x8]
	ldp	w10, w11, [x19]
	orr	w9, w10, w9
	str	w9, [x19]
Lloh15:
	adrp	x10, _NIU_FLAGS_FIBER@GOTPAGE
Lloh16:
	ldr	x10, [x10, _NIU_FLAGS_FIBER@GOTPAGEOFF]
	ldr	w12, [x10]
	bic	w9, w9, w12
	str	w9, [x19]
Lloh17:
	adrp	x12, _NIU_FLAGS_XCVR_SERDES@GOTPAGE
Lloh18:
	ldr	x12, [x12, _NIU_FLAGS_XCVR_SERDES@GOTPAGEOFF]
Lloh19:
	ldr	w12, [x12]
	orr	w9, w12, w9
	str	w9, [x19]
Lloh20:
	adrp	x12, _MAC_XCVR_PCS@GOTPAGE
Lloh21:
	ldr	x12, [x12, _MAC_XCVR_PCS@GOTPAGEOFF]
Lloh22:
	ldr	w12, [x12]
	str	w12, [x19, #32]
	cmp	w11, #2
	b.lt	LBB0_8
; %bb.7:
	ldr	w10, [x10]
	orr	w9, w10, w9
	str	w9, [x19]
	ldr	w10, [x8]
	bic	w9, w9, w10
	str	w9, [x19]
LBB0_8:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_13
; %bb.9:
Lloh23:
	adrp	x8, _MAC_XCVR_XPCS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MAC_XCVR_XPCS@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	b	LBB0_13
LBB0_10:
	ldr	w0, [x19, #8]
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
LBB0_11:
	bl	_dev_err
Lloh28:
	adrp	x8, _NIU_FLAGS_VPD_VALID@GOTPAGE
Lloh29:
	ldr	x8, [x8, _NIU_FLAGS_VPD_VALID@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	b	LBB0_15
LBB0_12:
Lloh31:
	adrp	x8, _NIU_FLAGS_10G@GOTPAGE
Lloh32:
	ldr	x8, [x8, _NIU_FLAGS_10G@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
Lloh34:
	adrp	x9, _NIU_FLAGS_FIBER@GOTPAGE
Lloh35:
	ldr	x9, [x9, _NIU_FLAGS_FIBER@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
Lloh37:
	adrp	x10, _NIU_FLAGS_HOTPLUG_PHY@GOTPAGE
Lloh38:
	ldr	x10, [x10, _NIU_FLAGS_HOTPLUG_PHY@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh39:
	ldr	w9, [x10]
	orr	w8, w8, w9
	ldr	w9, [x19]
	orr	w8, w8, w9
	str	w8, [x19]
LBB0_13:
	ldr	x0, [x20]
	ldr	x1, [x19, #16]
Lloh40:
	adrp	x8, _ETH_ALEN@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ETH_ALEN@GOTPAGEOFF]
Lloh42:
	ldr	w2, [x8]
	bl	_memcpy
	ldr	x8, [x20]
	ldr	x9, [x8, #40]
	ldrsw	x10, [x19, #4]
	add	x9, x9, x10
	str	x9, [x8, #40]
	tbz	w10, #31, LBB0_15
; %bb.14:
	ldr	x9, [x8, #32]
	add	x9, x9, #1
	str	x9, [x8, #32]
LBB0_15:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VPD MAC invalid, falling back to SPROM\n"

	.comm	_NIU_FLAGS_VPD_VALID,4,2        ; @NIU_FLAGS_VPD_VALID
	.comm	_NIU_ALONSO_MDL_STR,4,2         ; @NIU_ALONSO_MDL_STR
	.comm	_NIU_KIMI_MDL_STR,4,2           ; @NIU_KIMI_MDL_STR
	.comm	_NIU_FLAGS_10G,4,2              ; @NIU_FLAGS_10G
	.comm	_NIU_FLAGS_FIBER,4,2            ; @NIU_FLAGS_FIBER
	.comm	_NIU_FLAGS_XCVR_SERDES,4,2      ; @NIU_FLAGS_XCVR_SERDES
	.comm	_MAC_XCVR_PCS,4,2               ; @MAC_XCVR_PCS
	.comm	_MAC_XCVR_XPCS,4,2              ; @MAC_XCVR_XPCS
	.comm	_NIU_FOXXY_MDL_STR,4,2          ; @NIU_FOXXY_MDL_STR
	.comm	_NIU_FLAGS_HOTPLUG_PHY,4,2      ; @NIU_FLAGS_HOTPLUG_PHY
l_.str.1:                               ; @.str.1
	.asciz	"Illegal phy string [%s]\n"

l_.str.2:                               ; @.str.2
	.asciz	"Falling back to SPROM\n"

	.comm	_ETH_ALEN,4,2                   ; @ETH_ALEN
	.no_dead_strip	_niu_pci_vpd_validate
.subsections_via_symbols
