	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function awg_phy_reset
_awg_phy_reset:                         ## @awg_phy_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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_ofw_bus_get_node
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	leaq	-64(%rbp), %rdx
	movl	%eax, %edi
	movl	$16, %ecx
	callq	_OF_getencprop
	xorl	%r15d, %r15d
	testq	%rax, %rax
	jle	LBB0_8
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	leaq	-76(%rbp), %rdx
	movl	%ebx, %edi
	movl	$12, %ecx
	callq	_OF_getencprop
	testq	%rax, %rax
	jle	LBB0_2
## %bb.3:
	movl	-64(%rbp), %edi
	callq	_OF_node_from_xref
	movl	%eax, %r12d
	movl	-64(%rbp), %edi
	callq	_OF_device_from_xref
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %r14
	leaq	-64(%rbp), %rdi
	callq	_nitems
	leaq	-1(%rax), %rcx
	leaq	-60(%rbp), %r8
	leaq	-84(%rbp), %rax
	movq	%rax, (%rsp)
	leaq	-80(%rbp), %r9
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r12d, %edx
	callq	_GPIO_MAP_GPIOS
	testq	%rax, %rax
	je	LBB0_5
LBB0_2:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%r15d, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_GPIO_PIN_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edi
	callq	_OF_hasprop
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_GPIO_PIN_HIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_7:
	movq	_GPIO_ACTIVE_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-84(%rbp), %eax
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	sete	%bl
	testl	%eax, %eax
	cmovel	%r12d, %ebx
	movl	-80(%rbp), %esi
	movq	_GPIO_PIN_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_GPIO_PIN_SETFLAGS
	movl	-80(%rbp), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_GPIO_PIN_SET
	movl	-76(%rbp), %edi
	callq	_DELAY
	movl	-80(%rbp), %esi
	xorl	%edx, %edx
	testl	%ebx, %ebx
	sete	%dl
	movq	%r14, %rdi
	callq	_GPIO_PIN_SET
	movl	-72(%rbp), %edi
	callq	_DELAY
	movl	-80(%rbp), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_GPIO_PIN_SET
	movl	-68(%rbp), %edi
	callq	_DELAY
	jmp	LBB0_8
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"allwinner,reset-gpio"

L_.str.1:                               ## @.str.1
	.asciz	"allwinner,reset-delays-us"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_GPIO_PIN_LOW,4,2               ## @GPIO_PIN_LOW
L_.str.2:                               ## @.str.2
	.asciz	"allwinner,reset-active-low"

	.comm	_GPIO_PIN_HIGH,4,2              ## @GPIO_PIN_HIGH
	.comm	_GPIO_ACTIVE_LOW,4,2            ## @GPIO_ACTIVE_LOW
	.comm	_GPIO_PIN_OUTPUT,4,2            ## @GPIO_PIN_OUTPUT
	.no_dead_strip	_awg_phy_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function awg_phy_reset
_awg_phy_reset:                         ; @awg_phy_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_ofw_bus_get_node
	mov	x20, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #24
	mov	w3, #16
	bl	_OF_getencprop
	cmp	x0, #1
	b.lt	LBB0_6
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #12
	mov	x0, x20
	mov	w3, #12
	bl	_OF_getencprop
	cmp	x0, #0
	b.le	LBB0_4
; %bb.2:
	ldr	w0, [sp, #24]
	bl	_OF_node_from_xref
	mov	x21, x0
	ldr	w0, [sp, #24]
	bl	_OF_device_from_xref
	cbz	x0, LBB0_4
; %bb.3:
	mov	x19, x0
	add	x22, sp, #24
	add	x0, sp, #24
	bl	_nitems
	sub	x3, x0, #1
	add	x4, x22, #4
	add	x5, sp, #8
	add	x6, sp, #4
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_GPIO_MAP_GPIOS
	cbz	x0, LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _ENXIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	b	LBB0_7
LBB0_5:
Lloh10:
	adrp	x8, _GPIO_PIN_LOW@GOTPAGE
Lloh11:
	ldr	x8, [x8, _GPIO_PIN_LOW@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_OF_hasprop
Lloh15:
	adrp	x8, _GPIO_PIN_HIGH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GPIO_PIN_HIGH@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w8, w21, w8, eq
	ldp	w9, w1, [sp, #4]
Lloh18:
	adrp	x10, _GPIO_ACTIVE_LOW@GOTPAGE
Lloh19:
	ldr	x10, [x10, _GPIO_ACTIVE_LOW@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	cmp	w8, #0
	cset	w11, eq
	tst	w10, w9
	csel	w20, w8, w11, eq
Lloh21:
	adrp	x8, _GPIO_PIN_OUTPUT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _GPIO_PIN_OUTPUT@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_GPIO_PIN_SETFLAGS
	ldr	w1, [sp, #8]
	mov	x0, x19
	mov	x2, x20
	bl	_GPIO_PIN_SET
	ldr	w0, [sp, #12]
	bl	_DELAY
	ldr	w1, [sp, #8]
	cmp	w20, #0
	cset	w2, eq
	mov	x0, x19
	bl	_GPIO_PIN_SET
	ldr	w0, [sp, #16]
	bl	_DELAY
	ldr	w1, [sp, #8]
	mov	x0, x19
	mov	x2, x20
	bl	_GPIO_PIN_SET
	ldr	w0, [sp, #20]
	bl	_DELAY
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldr	x8, [sp, #40]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"allwinner,reset-gpio"

l_.str.1:                               ; @.str.1
	.asciz	"allwinner,reset-delays-us"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_GPIO_PIN_LOW,4,2               ; @GPIO_PIN_LOW
l_.str.2:                               ; @.str.2
	.asciz	"allwinner,reset-active-low"

	.comm	_GPIO_PIN_HIGH,4,2              ; @GPIO_PIN_HIGH
	.comm	_GPIO_ACTIVE_LOW,4,2            ; @GPIO_ACTIVE_LOW
	.comm	_GPIO_PIN_OUTPUT,4,2            ; @GPIO_PIN_OUTPUT
	.no_dead_strip	_awg_phy_reset
.subsections_via_symbols
