	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mediatek_dwmac_config_dt
_mediatek_dwmac_config_dt:              ## @mediatek_dwmac_config_dt
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_syscon_regmap_lookup_by_phandle
	movl	%eax, 40(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.15:
	movl	24(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movl	40(%rbx), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movl	8(%rbx), %edi
	callq	_of_get_phy_mode
	movq	%rax, (%rbx)
	testq	%rax, %rax
	js	LBB0_2
## %bb.3:
	movl	8(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	leaq	-24(%rbp), %rdx
	callq	_of_property_read_u32
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	movq	-24(%rbp), %rdx
	movq	32(%rbx), %rax
	cmpq	(%rax), %rdx
	jge	LBB0_11
## %bb.5:
	movq	%rdx, 72(%rbx)
LBB0_6:
	movl	8(%rbx), %edi
	leaq	L_.str.5(%rip), %rsi
	leaq	-16(%rbp), %rdx
	callq	_of_property_read_u32
	testl	%eax, %eax
	jne	LBB0_9
## %bb.7:
	movq	-16(%rbp), %rdx
	movq	32(%rbx), %rax
	cmpq	8(%rax), %rdx
	jge	LBB0_14
## %bb.8:
	movq	%rdx, 64(%rbx)
LBB0_9:
	movl	8(%rbx), %edi
	leaq	L_.str.7(%rip), %rsi
	callq	_of_property_read_bool
	movq	%rax, 56(%rbx)
	movl	8(%rbx), %edi
	leaq	L_.str.8(%rip), %rsi
	callq	_of_property_read_bool
	movq	%rax, 48(%rbx)
	movl	8(%rbx), %edi
	leaq	L_.str.9(%rip), %rsi
	callq	_of_property_read_bool
	movq	%rax, 16(%rbx)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_2:
	movl	24(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_13
LBB0_11:
	movl	24(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_12
LBB0_14:
	movl	24(%rbx), %edi
	leaq	L_.str.6(%rip), %rsi
LBB0_12:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mediatek,pericfg"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to get pericfg syscon\n"

L_.str.2:                               ## @.str.2
	.asciz	"not find phy-mode\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"mediatek,tx-delay-ps"

L_.str.4:                               ## @.str.4
	.asciz	"Invalid TX clock delay: %dps\n"

L_.str.5:                               ## @.str.5
	.asciz	"mediatek,rx-delay-ps"

L_.str.6:                               ## @.str.6
	.asciz	"Invalid RX clock delay: %dps\n"

L_.str.7:                               ## @.str.7
	.asciz	"mediatek,txc-inverse"

L_.str.8:                               ## @.str.8
	.asciz	"mediatek,rxc-inverse"

L_.str.9:                               ## @.str.9
	.asciz	"mediatek,rmii-rxc"

	.no_dead_strip	_mediatek_dwmac_config_dt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mediatek_dwmac_config_dt
_mediatek_dwmac_config_dt:              ; @mediatek_dwmac_config_dt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	mov	x19, x0
	ldr	w0, [x0, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_syscon_regmap_lookup_by_phandle
	str	w0, [x19, #40]
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #24]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w0, [x19, #40]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_PTR_ERR
LBB0_2:
	ldr	w0, [x19, #8]
	bl	_of_get_phy_mode
	str	x0, [x19]
	tbnz	x0, #63, LBB0_10
; %bb.3:
	ldr	w0, [x19, #8]
Lloh4:
	adrp	x1, l_.str.3@PAGE
Lloh5:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x2, sp, #24
	bl	_of_property_read_u32
	cbnz	w0, LBB0_6
; %bb.4:
	ldr	x8, [sp, #24]
	ldr	x9, [x19, #32]
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_11
; %bb.5:
	str	x8, [x19, #72]
LBB0_6:
	ldr	w0, [x19, #8]
Lloh6:
	adrp	x1, l_.str.5@PAGE
Lloh7:
	add	x1, x1, l_.str.5@PAGEOFF
	add	x2, sp, #16
	bl	_of_property_read_u32
	cbnz	w0, LBB0_9
; %bb.7:
	ldr	x8, [sp, #16]
	ldr	x9, [x19, #32]
	ldr	x9, [x9, #8]
	cmp	x8, x9
	b.ge	LBB0_12
; %bb.8:
	str	x8, [x19, #64]
LBB0_9:
	ldr	w0, [x19, #8]
Lloh8:
	adrp	x1, l_.str.7@PAGE
Lloh9:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_of_property_read_bool
	str	x0, [x19, #56]
	ldr	w0, [x19, #8]
Lloh10:
	adrp	x1, l_.str.8@PAGE
Lloh11:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_of_property_read_bool
	str	x0, [x19, #48]
	ldr	w0, [x19, #8]
Lloh12:
	adrp	x1, l_.str.9@PAGE
Lloh13:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_of_property_read_bool
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19, #16]
	b	LBB0_14
LBB0_10:
	ldr	w0, [x19, #24]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_13
LBB0_11:
	ldr	w0, [x19, #24]
	str	x8, [sp]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_13
LBB0_12:
	ldr	w0, [x19, #24]
	str	x8, [sp]
Lloh18:
	adrp	x1, l_.str.6@PAGE
Lloh19:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_13:
	bl	_dev_err
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mediatek,pericfg"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to get pericfg syscon\n"

l_.str.2:                               ; @.str.2
	.asciz	"not find phy-mode\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"mediatek,tx-delay-ps"

l_.str.4:                               ; @.str.4
	.asciz	"Invalid TX clock delay: %dps\n"

l_.str.5:                               ; @.str.5
	.asciz	"mediatek,rx-delay-ps"

l_.str.6:                               ; @.str.6
	.asciz	"Invalid RX clock delay: %dps\n"

l_.str.7:                               ; @.str.7
	.asciz	"mediatek,txc-inverse"

l_.str.8:                               ; @.str.8
	.asciz	"mediatek,rxc-inverse"

l_.str.9:                               ; @.str.9
	.asciz	"mediatek,rmii-rxc"

	.no_dead_strip	_mediatek_dwmac_config_dt
.subsections_via_symbols
