	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function awusbphy_set_mode
_awusbphy_set_mode:                     ## @awusbphy_set_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	callq	_phynode_get_device
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_phynode_get_id
	movq	%rax, %rbx
	movl	%r12d, %edi
	callq	_device_get_softc
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.1:
	xorl	%eax, %eax
	cmpl	$129, %r15d
	je	LBB0_10
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_10
LBB0_3:
	movq	%rax, %r14
	cmpl	$129, %r15d
	jne	LBB0_9
## %bb.4:
	movl	4(%r14), %edi
	movq	_PHY_CSR@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_bus_read_4
	movq	_VBUS_CHANGE_DET@GOTPCREL(%rip), %rcx
	movq	_ID_CHANGE_DET@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_DPDM_CHANGE_DET@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_ID_PULLUP_EN@GOTPCREL(%rip), %rcx
	movq	_DPDM_PULLUP_EN@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rcx), %esi
	notl	%edx
	andl	%eax, %edx
	orl	%edx, %esi
	movq	_FORCE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	_FORCE_ID_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	_FORCE_ID_LOW@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	shll	%cl, %edi
	andl	%esi, %eax
	orl	%eax, %edi
	movq	_FORCE_VBUS_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	_FORCE_VBUS_VALID_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	_FORCE_VBUS_VALID_HIGH@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	shll	%cl, %edx
	andl	%edi, %eax
	orl	%eax, %edx
	movl	4(%r14), %edi
	movl	(%rbx), %esi
	callq	_bus_write_4
	movq	8(%r14), %rax
	cmpl	$1, (%rax)
	jne	LBB0_9
## %bb.5:
	leaq	-36(%rbp), %rsi
	movl	%r12d, %edi
	callq	_awusbphy_vbus_detect
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_10
## %bb.6:
	cmpl	$0, -36(%rbp)
	movl	4(%r14), %edi
	movq	_OTG_PHY_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_OTG_PHY_ROUTE_OTG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	je	LBB0_7
## %bb.8:
	callq	_SET4
	jmp	LBB0_9
LBB0_7:
	callq	_CLR4
LBB0_9:
	movl	%r15d, (%r14)
	xorl	%eax, %eax
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PHY_CSR,4,2                    ## @PHY_CSR
	.comm	_VBUS_CHANGE_DET,4,2            ## @VBUS_CHANGE_DET
	.comm	_ID_CHANGE_DET,4,2              ## @ID_CHANGE_DET
	.comm	_DPDM_CHANGE_DET,4,2            ## @DPDM_CHANGE_DET
	.comm	_ID_PULLUP_EN,4,2               ## @ID_PULLUP_EN
	.comm	_DPDM_PULLUP_EN,4,2             ## @DPDM_PULLUP_EN
	.comm	_FORCE_ID,4,2                   ## @FORCE_ID
	.comm	_FORCE_ID_LOW,4,2               ## @FORCE_ID_LOW
	.comm	_FORCE_ID_SHIFT,4,2             ## @FORCE_ID_SHIFT
	.comm	_FORCE_VBUS_VALID,4,2           ## @FORCE_VBUS_VALID
	.comm	_FORCE_VBUS_VALID_HIGH,4,2      ## @FORCE_VBUS_VALID_HIGH
	.comm	_FORCE_VBUS_VALID_SHIFT,4,2     ## @FORCE_VBUS_VALID_SHIFT
	.comm	_OTG_PHY_CFG,4,2                ## @OTG_PHY_CFG
	.comm	_OTG_PHY_ROUTE_OTG,4,2          ## @OTG_PHY_ROUTE_OTG
	.no_dead_strip	_awusbphy_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function awusbphy_set_mode
_awusbphy_set_mode:                     ; @awusbphy_set_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
	bl	_phynode_get_device
	mov	x21, x0
	mov	x0, x20
	bl	_phynode_get_id
	mov	x22, x0
	mov	x0, x21
	bl	_device_get_softc
	cbz	x22, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w19, #129
	csel	w0, wzr, w8, eq
	b	LBB0_10
LBB0_2:
	mov	x20, x0
	cmp	w19, #129
	b.ne	LBB0_9
; %bb.3:
	ldr	w0, [x20, #4]
Lloh3:
	adrp	x22, _PHY_CSR@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PHY_CSR@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_bus_read_4
Lloh5:
	adrp	x8, _VBUS_CHANGE_DET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VBUS_CHANGE_DET@GOTPAGEOFF]
Lloh7:
	adrp	x9, _ID_CHANGE_DET@GOTPAGE
Lloh8:
	ldr	x9, [x9, _ID_CHANGE_DET@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh11:
	adrp	x9, _DPDM_CHANGE_DET@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DPDM_CHANGE_DET@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bic	w8, w0, w8
Lloh14:
	adrp	x9, _ID_PULLUP_EN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ID_PULLUP_EN@GOTPAGEOFF]
Lloh16:
	adrp	x10, _DPDM_PULLUP_EN@GOTPAGE
Lloh17:
	ldr	x10, [x10, _DPDM_PULLUP_EN@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	ldr	w10, [x10]
	orr	w9, w10, w9
	orr	w8, w9, w8
Lloh20:
	adrp	x9, _FORCE_ID@GOTPAGE
Lloh21:
	ldr	x9, [x9, _FORCE_ID@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh23:
	adrp	x9, _FORCE_ID_LOW@GOTPAGE
Lloh24:
	ldr	x9, [x9, _FORCE_ID_LOW@GOTPAGEOFF]
Lloh25:
	adrp	x10, _FORCE_ID_SHIFT@GOTPAGE
Lloh26:
	ldr	x10, [x10, _FORCE_ID_SHIFT@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
Lloh28:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
Lloh29:
	adrp	x9, _FORCE_VBUS_VALID@GOTPAGE
Lloh30:
	ldr	x9, [x9, _FORCE_VBUS_VALID@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	bic	w8, w8, w9
Lloh32:
	adrp	x9, _FORCE_VBUS_VALID_HIGH@GOTPAGE
Lloh33:
	ldr	x9, [x9, _FORCE_VBUS_VALID_HIGH@GOTPAGEOFF]
Lloh34:
	adrp	x10, _FORCE_VBUS_VALID_SHIFT@GOTPAGE
Lloh35:
	ldr	x10, [x10, _FORCE_VBUS_VALID_SHIFT@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
Lloh37:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w2, w9, w8
	ldr	w0, [x20, #4]
	ldr	w1, [x22]
	bl	_bus_write_4
	ldr	x8, [x20, #8]
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_9
; %bb.4:
	add	x1, sp, #12
	mov	x0, x21
	bl	_awusbphy_vbus_detect
	cbz	w0, LBB0_6
; %bb.5:
	mov	w0, #0
	b	LBB0_10
LBB0_6:
	ldr	w8, [sp, #12]
	ldr	w0, [x20, #4]
Lloh38:
	adrp	x9, _OTG_PHY_CFG@GOTPAGE
Lloh39:
	ldr	x9, [x9, _OTG_PHY_CFG@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x9]
Lloh41:
	adrp	x9, _OTG_PHY_ROUTE_OTG@GOTPAGE
Lloh42:
	ldr	x9, [x9, _OTG_PHY_ROUTE_OTG@GOTPAGEOFF]
Lloh43:
	ldr	w2, [x9]
	cbz	w8, LBB0_8
; %bb.7:
	bl	_SET4
	b	LBB0_9
LBB0_8:
	bl	_CLR4
LBB0_9:
	mov	w0, #0
	str	w19, [x20]
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh36
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh27
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh18
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PHY_CSR,4,2                    ; @PHY_CSR
	.comm	_VBUS_CHANGE_DET,4,2            ; @VBUS_CHANGE_DET
	.comm	_ID_CHANGE_DET,4,2              ; @ID_CHANGE_DET
	.comm	_DPDM_CHANGE_DET,4,2            ; @DPDM_CHANGE_DET
	.comm	_ID_PULLUP_EN,4,2               ; @ID_PULLUP_EN
	.comm	_DPDM_PULLUP_EN,4,2             ; @DPDM_PULLUP_EN
	.comm	_FORCE_ID,4,2                   ; @FORCE_ID
	.comm	_FORCE_ID_LOW,4,2               ; @FORCE_ID_LOW
	.comm	_FORCE_ID_SHIFT,4,2             ; @FORCE_ID_SHIFT
	.comm	_FORCE_VBUS_VALID,4,2           ; @FORCE_VBUS_VALID
	.comm	_FORCE_VBUS_VALID_HIGH,4,2      ; @FORCE_VBUS_VALID_HIGH
	.comm	_FORCE_VBUS_VALID_SHIFT,4,2     ; @FORCE_VBUS_VALID_SHIFT
	.comm	_OTG_PHY_CFG,4,2                ; @OTG_PHY_CFG
	.comm	_OTG_PHY_ROUTE_OTG,4,2          ; @OTG_PHY_ROUTE_OTG
	.no_dead_strip	_awusbphy_set_mode
.subsections_via_symbols
