	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qt2025c_select_phy_mode
_qt2025c_select_phy_mode:               ## @qt2025c_select_phy_mode
	.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	%rdi, %r13
	movq	16(%rdi), %rbx
	callq	_falcon_board
	xorl	%r12d, %r12d
	cmpl	$33554688, (%rbx)               ## imm = 0x2000100
	jl	LBB0_11
## %bb.1:
	movq	%rax, %r15
	movq	(%r13), %rax
	movq	_LOOPBACK_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$56, %eax
	movl	$32, %r14d
	cmovel	%eax, %r14d
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49945, %edx                    ## imm = 0xC319
	callq	_ef4_mdio_read
	andl	$56, %eax
	cmpl	%r14d, %eax
	je	LBB0_11
## %bb.2:
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r13), %edx
	leaq	L_.str(%rip), %rcx
	movq	%r13, %rdi
	movl	%r14d, %r8d
	callq	_netif_dbg
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49920, %edx                    ## imm = 0xC300
	xorl	%ecx, %ecx
	callq	_ef4_mdio_write
	cmpq	$0, (%r15)
	jne	LBB0_6
## %bb.3:
	cmpl	$1, 8(%r15)
	jg	LBB0_6
## %bb.4:
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$17560, %ecx                    ## imm = 0x4498
	callq	_ef4_mdio_write
	movl	$9, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$17544, %ecx                    ## imm = 0x4488
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$17536, %ecx                    ## imm = 0x4480
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$17552, %ecx                    ## imm = 0x4490
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$17560, %ecx                    ## imm = 0x4498
	callq	_ef4_mdio_write
	decl	%ebx
	jne	LBB0_5
	jmp	LBB0_9
LBB0_6:
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$2336, %ecx                     ## imm = 0x920
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$53256, %edx                    ## imm = 0xD008
	movl	$4, %ecx
	callq	_ef4_mdio_write
	movl	$9, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$2304, %ecx                     ## imm = 0x900
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$53256, %edx                    ## imm = 0xD008
	movl	$5, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$2336, %ecx                     ## imm = 0x920
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$53256, %edx                    ## imm = 0xD008
	movl	$4, %ecx
	callq	_ef4_mdio_write
	decl	%ebx
	jne	LBB0_7
## %bb.8:
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$18688, %ecx                    ## imm = 0x4900
	callq	_ef4_mdio_write
LBB0_9:
	movl	$1, %r15d
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49923, %edx                    ## imm = 0xC303
	movl	$18688, %ecx                    ## imm = 0x4900
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49922, %edx                    ## imm = 0xC302
	movl	$4, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49942, %edx                    ## imm = 0xC316
	movl	$19, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49944, %edx                    ## imm = 0xC318
	movl	$84, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49945, %edx                    ## imm = 0xC319
	movl	%r14d, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49946, %edx                    ## imm = 0xC31A
	movl	$152, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$3, %esi
	movl	$38, %edx
	movl	$3584, %ecx                     ## imm = 0xE00
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$3, %esi
	movl	$39, %edx
	movl	$19, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$3, %esi
	movl	$40, %edx
	movl	$42280, %ecx                    ## imm = 0xA528
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$53254, %edx                    ## imm = 0xD006
	movl	$10, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$53255, %edx                    ## imm = 0xD007
	movl	$9, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$53256, %edx                    ## imm = 0xD008
	movl	$4, %ecx
	callq	_ef4_mdio_write
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49943, %edx                    ## imm = 0xC317
	movl	$255, %ecx
	callq	_ef4_mdio_write
	movq	_PMA_PMD_MODE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PMA_PMD_RXIN_SEL_LBN@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r15d
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	movl	$1, %esi
	movl	%r15d, %ecx
	xorl	%r8d, %r8d
	callq	_ef4_mdio_set_flag
	movq	%r13, %rdi
	movl	$1, %esi
	movl	$49920, %edx                    ## imm = 0xC300
	movl	$2, %ecx
	callq	_ef4_mdio_write
	movl	$20, %edi
	callq	_msleep
	movq	%r13, %rdi
	callq	_qt2025c_restart_firmware
	movq	%r13, %rdi
	callq	_qt2025c_wait_reset
	testl	%eax, %eax
	jns	LBB0_11
## %bb.10:
	movl	%eax, %r14d
	movq	_hw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r13), %edx
	leaq	L_.str.1(%rip), %rcx
	movq	%r13, %rdi
	callq	_netif_err
	movl	%r14d, %r12d
LBB0_11:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LOOPBACK_NONE,8,3              ## @LOOPBACK_NONE
	.comm	_hw,4,2                         ## @hw
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Switching PHY to mode 0x%04x\n"

	.comm	_PMA_PMD_MODE_REG,4,2           ## @PMA_PMD_MODE_REG
	.comm	_PMA_PMD_RXIN_SEL_LBN,4,2       ## @PMA_PMD_RXIN_SEL_LBN
L_.str.1:                               ## @.str.1
	.asciz	"PHY microcontroller reset during mode switch timed out\n"

	.no_dead_strip	_qt2025c_select_phy_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qt2025c_select_phy_mode
_qt2025c_select_phy_mode:               ; @qt2025c_select_phy_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	x20, [x0, #16]
	bl	_falcon_board
	ldr	w8, [x20]
	mov	w9, #256
	movk	w9, #512, lsl #16
	cmp	w8, w9
	b.lt	LBB0_2
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x8, _LOOPBACK_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LOOPBACK_NONE@GOTPAGEOFF]
	ldr	x9, [x19]
Lloh2:
	ldr	x8, [x8]
	cmp	x9, x8
	mov	w8, #32
	mov	w9, #56
	csel	w20, w9, w8, eq
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49945
	bl	_ef4_mdio_read
	and	w8, w0, #0x38
	cmp	w8, w20
	b.ne	LBB0_4
LBB0_2:
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
Lloh3:
	adrp	x22, _hw@GOTPAGE
Lloh4:
	ldr	x22, [x22, _hw@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	w2, [x19, #8]
Lloh5:
	adrp	x3, l_.str@PAGE
Lloh6:
	add	x3, x3, l_.str@PAGEOFF
	mov	x0, x19
	mov	x4, x20
	bl	_netif_dbg
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49920
	mov	w3, #0
	bl	_ef4_mdio_write
	ldr	x8, [x21]
	cbnz	x8, LBB0_8
; %bb.5:
	ldr	w8, [x21, #8]
	cmp	w8, #1
	b.gt	LBB0_8
; %bb.6:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #17560
	bl	_ef4_mdio_write
	mov	w21, #9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #17544
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #17536
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #17552
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #17560
	bl	_ef4_mdio_write
	subs	w21, w21, #1
	b.ne	LBB0_7
	b	LBB0_11
LBB0_8:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #2336
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #53256
	mov	w3, #4
	bl	_ef4_mdio_write
	mov	w21, #9
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #2304
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #53256
	mov	w3, #5
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #2336
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #53256
	mov	w3, #4
	bl	_ef4_mdio_write
	subs	w21, w21, #1
	b.ne	LBB0_9
; %bb.10:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #18688
	bl	_ef4_mdio_write
LBB0_11:
	mov	w21, #1
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49923
	mov	w3, #18688
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49922
	mov	w3, #4
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49942
	mov	w3, #19
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49944
	mov	w3, #84
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49945
	mov	x3, x20
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49946
	mov	w3, #152
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #3
	mov	w2, #38
	mov	w3, #3584
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #3
	mov	w2, #39
	mov	w3, #19
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #3
	mov	w2, #40
	mov	w3, #42280
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #53254
	mov	w3, #10
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #53255
	mov	w3, #9
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #53256
	mov	w3, #4
	bl	_ef4_mdio_write
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49943
	mov	w3, #255
	bl	_ef4_mdio_write
Lloh7:
	adrp	x8, _PMA_PMD_MODE_REG@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PMA_PMD_MODE_REG@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
Lloh10:
	adrp	x8, _PMA_PMD_RXIN_SEL_LBN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PMA_PMD_RXIN_SEL_LBN@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	lsl	w3, w21, w8
	mov	x0, x19
	mov	w1, #1
	mov	w4, #0
	bl	_ef4_mdio_set_flag
	mov	x0, x19
	mov	w1, #1
	mov	w2, #49920
	mov	w3, #2
	bl	_ef4_mdio_write
	mov	w0, #20
	bl	_msleep
	mov	x0, x19
	bl	_qt2025c_restart_firmware
	mov	x0, x19
	bl	_qt2025c_wait_reset
	mov	x20, x0
	mov	w0, #0
	tbz	w20, #31, LBB0_3
; %bb.12:
	ldr	w1, [x22]
	ldr	w2, [x19, #8]
Lloh13:
	adrp	x3, l_.str.1@PAGE
Lloh14:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netif_err
	mov	x0, x20
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_LOOPBACK_NONE,8,3              ; @LOOPBACK_NONE
	.comm	_hw,4,2                         ; @hw
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Switching PHY to mode 0x%04x\n"

	.comm	_PMA_PMD_MODE_REG,4,2           ; @PMA_PMD_MODE_REG
	.comm	_PMA_PMD_RXIN_SEL_LBN,4,2       ; @PMA_PMD_RXIN_SEL_LBN
l_.str.1:                               ; @.str.1
	.asciz	"PHY microcontroller reset during mode switch timed out\n"

	.no_dead_strip	_qt2025c_select_phy_mode
.subsections_via_symbols
