	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function awg_reset
_awg_reset:                             ## @awg_reset
	.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
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r14d, %edi
	callq	_awg_phy_reset
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENXIO@GOTPCREL(%rip), %rbx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_9
LBB0_2:
	movq	_EMAC_BASIC_CTL_1@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_BASIC_CTL_SOFT_RST@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_WR4
	movq	_SOFT_RST_RETRY@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%r15d, %r15d
	jle	LBB0_7
## %bb.3:
	incl	%r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_RD4
	testl	%eax, (%r12)
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$10, %edi
	callq	_DELAY
	decl	%r15d
	cmpl	$1, %r15d
	jg	LBB0_4
	jmp	LBB0_8
LBB0_7:
	xorl	%eax, %eax
	testl	%r15d, %r15d
	jne	LBB0_10
LBB0_8:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rbx
	leaq	L_.str.1(%rip), %rsi
LBB0_9:
	movl	%r14d, %edi
	callq	_device_printf
	movl	(%rbx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	xorl	%eax, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to reset PHY\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_EMAC_BASIC_CTL_1,4,2           ## @EMAC_BASIC_CTL_1
	.comm	_BASIC_CTL_SOFT_RST,4,2         ## @BASIC_CTL_SOFT_RST
	.comm	_SOFT_RST_RETRY,4,2             ## @SOFT_RST_RETRY
L_.str.1:                               ## @.str.1
	.asciz	"soft reset timed out\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_awg_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function awg_reset
_awg_reset:                             ; @awg_reset
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	mov	x0, x19
	bl	_awg_phy_reset
	cbz	x0, LBB0_3
; %bb.1:
Lloh0:
	adrp	x22, _ENXIO@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ENXIO@GOTPAGEOFF]
Lloh2:
	adrp	x21, l_.str@PAGE
Lloh3:
	add	x21, x21, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	mov	x1, x21
	bl	_device_printf
	ldr	w0, [x22]
	b	LBB0_9
LBB0_3:
Lloh4:
	adrp	x23, _EMAC_BASIC_CTL_1@GOTPAGE
Lloh5:
	ldr	x23, [x23, _EMAC_BASIC_CTL_1@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh6:
	adrp	x24, _BASIC_CTL_SOFT_RST@GOTPAGE
Lloh7:
	ldr	x24, [x24, _BASIC_CTL_SOFT_RST@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x20
	bl	_WR4
Lloh8:
	adrp	x8, _SOFT_RST_RETRY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SOFT_RST_RETRY@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.4:
	add	w25, w8, #1
Lloh11:
	adrp	x22, _ETIMEDOUT@GOTPAGE
Lloh12:
	ldr	x22, [x22, _ETIMEDOUT@GOTPAGEOFF]
Lloh13:
	adrp	x21, l_.str.1@PAGE
Lloh14:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x20
	bl	_RD4
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #10
	bl	_DELAY
	sub	w25, w25, #1
	cmp	w25, #1
	b.gt	LBB0_5
	b	LBB0_2
LBB0_7:
	cbz	w8, LBB0_10
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_10:
Lloh15:
	adrp	x22, _ETIMEDOUT@GOTPAGE
Lloh16:
	ldr	x22, [x22, _ETIMEDOUT@GOTPAGEOFF]
Lloh17:
	adrp	x21, l_.str.1@PAGE
Lloh18:
	add	x21, x21, l_.str.1@PAGEOFF
	b	LBB0_2
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to reset PHY\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_EMAC_BASIC_CTL_1,4,2           ; @EMAC_BASIC_CTL_1
	.comm	_BASIC_CTL_SOFT_RST,4,2         ; @BASIC_CTL_SOFT_RST
	.comm	_SOFT_RST_RETRY,4,2             ; @SOFT_RST_RETRY
l_.str.1:                               ; @.str.1
	.asciz	"soft reset timed out\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_awg_reset
.subsections_via_symbols
