	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sr9800_set_default_mode
_sr9800_set_default_mode:               ## @sr9800_set_default_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	leaq	4(%rdi), %rbx
	movl	(%rdi), %edi
	movl	4(%r14), %esi
	movq	_MII_BMCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BMCR_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_sr_mdio_write
	movl	(%r14), %edi
	movl	4(%r14), %esi
	movq	_MII_ADVERTISE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_ADVERTISE_ALL@GOTPCREL(%rip), %rax
	movq	_ADVERTISE_CSMA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	callq	_sr_mdio_write
	movq	%rbx, %rdi
	callq	_mii_nway_restart
	movq	_SR9800_MEDIUM_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sr_write_medium_mode
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	movq	_SR_CMD_WRITE_IPG012@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SR9800_IPG0_DEFAULT@GOTPCREL(%rip), %rax
	movq	_SR9800_IPG1_DEFAULT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_SR9800_IPG2_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_sr_write_cmd
	testl	%eax, %eax
	js	LBB0_5
## %bb.2:
	movq	_SR_DEFAULT_RX_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_sr_write_rx_ctl
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movq	%r14, %rdi
	callq	_sr_read_rx_ctl
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_netdev_dbg
	movq	%r14, %rdi
	callq	_sr_read_medium_status
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_netdev_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_6:
	movl	%eax, %ebx
	jmp	LBB0_7
LBB0_5:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_netdev_dbg
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MII_BMCR,4,2                   ## @MII_BMCR
	.comm	_BMCR_RESET,4,2                 ## @BMCR_RESET
	.comm	_MII_ADVERTISE,4,2              ## @MII_ADVERTISE
	.comm	_ADVERTISE_ALL,4,2              ## @ADVERTISE_ALL
	.comm	_ADVERTISE_CSMA,4,2             ## @ADVERTISE_CSMA
	.comm	_SR9800_MEDIUM_DEFAULT,4,2      ## @SR9800_MEDIUM_DEFAULT
	.comm	_SR_CMD_WRITE_IPG012,4,2        ## @SR_CMD_WRITE_IPG012
	.comm	_SR9800_IPG0_DEFAULT,4,2        ## @SR9800_IPG0_DEFAULT
	.comm	_SR9800_IPG1_DEFAULT,4,2        ## @SR9800_IPG1_DEFAULT
	.comm	_SR9800_IPG2_DEFAULT,4,2        ## @SR9800_IPG2_DEFAULT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Write IPG,IPG1,IPG2 failed: %d\n"

	.comm	_SR_DEFAULT_RX_CTL,4,2          ## @SR_DEFAULT_RX_CTL
L_.str.1:                               ## @.str.1
	.asciz	"RX_CTL is 0x%04x after all initializations\n"

L_.str.2:                               ## @.str.2
	.asciz	"Medium Status:0x%04x after all initializations\n"

	.no_dead_strip	_sr9800_set_default_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sr9800_set_default_mode
_sr9800_set_default_mode:               ; @sr9800_set_default_mode
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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]
	mov	x20, x19
	ldr	w1, [x20, #4]!
Lloh0:
	adrp	x8, _MII_BMCR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MII_BMCR@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x8, _BMCR_RESET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BMCR_RESET@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	bl	_sr_mdio_write
	ldr	w0, [x19]
	ldr	w1, [x20]
Lloh6:
	adrp	x8, _MII_ADVERTISE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MII_ADVERTISE@GOTPAGEOFF]
Lloh8:
	adrp	x9, _ADVERTISE_ALL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ADVERTISE_ALL@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	ldr	w8, [x9]
Lloh12:
	adrp	x9, _ADVERTISE_CSMA@GOTPAGE
Lloh13:
	ldr	x9, [x9, _ADVERTISE_CSMA@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w3, w9, w8
	bl	_sr_mdio_write
	mov	x0, x20
	bl	_mii_nway_restart
Lloh15:
	adrp	x8, _SR9800_MEDIUM_DEFAULT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SR9800_MEDIUM_DEFAULT@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sr_write_medium_mode
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh18:
	adrp	x8, _SR_CMD_WRITE_IPG012@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SR_CMD_WRITE_IPG012@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _SR9800_IPG0_DEFAULT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SR9800_IPG0_DEFAULT@GOTPAGEOFF]
Lloh23:
	adrp	x9, _SR9800_IPG1_DEFAULT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _SR9800_IPG1_DEFAULT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh27:
	adrp	x8, _SR9800_IPG2_DEFAULT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SR9800_IPG2_DEFAULT@GOTPAGEOFF]
Lloh29:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #0
	mov	x5, #0
	bl	_sr_write_cmd
	tbnz	w0, #31, LBB0_5
; %bb.2:
Lloh30:
	adrp	x8, _SR_DEFAULT_RX_CTL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SR_DEFAULT_RX_CTL@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sr_write_rx_ctl
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_sr_read_rx_ctl
	mov	x2, x0
	ldr	w0, [x19]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_dbg
	mov	x0, x19
	bl	_sr_read_medium_status
	mov	x2, x0
	ldr	w0, [x19]
Lloh35:
	adrp	x1, l_.str.2@PAGE
Lloh36:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_netdev_dbg
	mov	w20, #0
	b	LBB0_6
LBB0_4:
	mov	x20, x0
	b	LBB0_6
LBB0_5:
	mov	x20, x0
	ldr	w0, [x19]
Lloh37:
	adrp	x1, l_.str@PAGE
Lloh38:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_netdev_dbg
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh25
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_MII_BMCR,4,2                   ; @MII_BMCR
	.comm	_BMCR_RESET,4,2                 ; @BMCR_RESET
	.comm	_MII_ADVERTISE,4,2              ; @MII_ADVERTISE
	.comm	_ADVERTISE_ALL,4,2              ; @ADVERTISE_ALL
	.comm	_ADVERTISE_CSMA,4,2             ; @ADVERTISE_CSMA
	.comm	_SR9800_MEDIUM_DEFAULT,4,2      ; @SR9800_MEDIUM_DEFAULT
	.comm	_SR_CMD_WRITE_IPG012,4,2        ; @SR_CMD_WRITE_IPG012
	.comm	_SR9800_IPG0_DEFAULT,4,2        ; @SR9800_IPG0_DEFAULT
	.comm	_SR9800_IPG1_DEFAULT,4,2        ; @SR9800_IPG1_DEFAULT
	.comm	_SR9800_IPG2_DEFAULT,4,2        ; @SR9800_IPG2_DEFAULT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Write IPG,IPG1,IPG2 failed: %d\n"

	.comm	_SR_DEFAULT_RX_CTL,4,2          ; @SR_DEFAULT_RX_CTL
l_.str.1:                               ; @.str.1
	.asciz	"RX_CTL is 0x%04x after all initializations\n"

l_.str.2:                               ; @.str.2
	.asciz	"Medium Status:0x%04x after all initializations\n"

	.no_dead_strip	_sr9800_set_default_mode
.subsections_via_symbols
