	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arasan_phy_set
_arasan_phy_set:                        ## @arasan_phy_set
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r15d
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_HISPD_MODE@GOTPCREL(%rip), %rax
	movq	_HS200_MODE@GOTPCREL(%rip), %r12
	xorl	%ecx, %ecx
	cmpl	%esi, (%r12)
	cmovel	%ecx, %esi
	cmpl	%ebx, (%rax)
	movq	_MODE_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmovel	%ecx, %esi
	callq	_arasan_phy_write
	testl	%eax, %eax
	je	LBB0_1
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_HS400_MODE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_3
## %bb.2:
	cmpl	%ebx, (%r12)
	je	LBB0_3
LBB0_5:
	movq	_LEGACY_MODE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_7
## %bb.6:
	movq	_OTAP_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_arasan_phy_write
	testl	%eax, %eax
	jne	LBB0_19
	jmp	LBB0_10
LBB0_3:
	movq	_IPAD_CTRL1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdx
	movq	%r14, %rdi
	callq	_arasan_phy_read
	testl	%eax, %eax
	jne	LBB0_19
## %bb.4:
	movl	-52(%rbp), %edi
	movl	%r15d, %esi
	callq	_IOPAD
	movq	_IPAD_CTRL1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_arasan_phy_write
	testl	%eax, %eax
	jne	LBB0_19
	jmp	LBB0_5
LBB0_7:
	movl	%r13d, %edi
	callq	_OTAPDLY
	movq	_OTAP_DELAY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_arasan_phy_write
	testl	%eax, %eax
	jne	LBB0_19
## %bb.8:
	xorl	%r15d, %r15d
	cmpl	%ebx, (%r12)
	je	LBB0_10
## %bb.9:
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_ITAPDLY
	movl	%eax, %r15d
LBB0_10:
	movq	_ITAP_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_arasan_phy_write
	testl	%eax, %eax
	jne	LBB0_19
## %bb.11:
	movq	_LEGACY_MODE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	je	LBB0_13
## %bb.12:
	movq	_DLL_TRIM@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_arasan_phy_write
	testl	%eax, %eax
	jne	LBB0_19
LBB0_13:
	movq	_DLL_STATUS@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_arasan_phy_write
	testl	%eax, %eax
	jne	LBB0_19
## %bb.14:
	movq	_LEGACY_MODE@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jne	LBB0_16
## %bb.15:
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_16:
	movl	16(%rbp), %edi
	callq	_FREQSEL
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_arasan_phy_write
	testl	%eax, %eax
	jne	LBB0_19
## %bb.17:
	movl	(%r15), %esi
	movq	_DLL_RDY_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_arasan_phy_sts_poll
	movl	%eax, %ecx
	movl	$0, %eax
	testl	%ecx, %ecx
	je	LBB0_19
## %bb.18:
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_HISPD_MODE,4,2                 ## @HISPD_MODE
	.comm	_HS200_MODE,4,2                 ## @HS200_MODE
	.comm	_MODE_CTRL,4,2                  ## @MODE_CTRL
	.comm	_HS400_MODE,4,2                 ## @HS400_MODE
	.comm	_IPAD_CTRL1,4,2                 ## @IPAD_CTRL1
	.comm	_LEGACY_MODE,4,2                ## @LEGACY_MODE
	.comm	_OTAP_DELAY,4,2                 ## @OTAP_DELAY
	.comm	_ITAP_DELAY,4,2                 ## @ITAP_DELAY
	.comm	_DLL_TRIM,4,2                   ## @DLL_TRIM
	.comm	_DLL_STATUS,4,2                 ## @DLL_STATUS
	.comm	_DLL_RDY_MASK,4,2               ## @DLL_RDY_MASK
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_arasan_phy_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arasan_phy_set
_arasan_phy_set:                        ; @arasan_phy_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x6
	mov	x22, x5
	mov	x23, x4
	mov	x25, x3
	mov	x24, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _HISPD_MODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HISPD_MODE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x26, _HS200_MODE@GOTPAGE
Lloh4:
	ldr	x26, [x26, _HS200_MODE@GOTPAGEOFF]
	ldr	w9, [x26]
	cmp	w9, w1
	ccmp	w8, w1, #4, ne
Lloh5:
	adrp	x8, _MODE_CTRL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MODE_CTRL@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	csel	w1, wzr, w1, eq
	bl	_arasan_phy_write
	cbz	w0, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
Lloh8:
	adrp	x8, _HS400_MODE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _HS400_MODE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w9, [x26]
	cmp	w8, w21
	ccmp	w9, w21, #4, ne
	b.ne	LBB0_5
; %bb.3:
Lloh11:
	adrp	x27, _IPAD_CTRL1@GOTPAGE
Lloh12:
	ldr	x27, [x27, _IPAD_CTRL1@GOTPAGEOFF]
	ldr	w1, [x27]
	add	x2, sp, #12
	mov	x0, x19
	bl	_arasan_phy_read
	cbnz	w0, LBB0_1
; %bb.4:
	ldr	w0, [sp, #12]
	mov	x1, x25
	bl	_IOPAD
	mov	x1, x0
	ldr	w2, [x27]
	mov	x0, x19
	bl	_arasan_phy_write
	cbnz	w0, LBB0_1
LBB0_5:
Lloh13:
	adrp	x25, _LEGACY_MODE@GOTPAGE
Lloh14:
	ldr	x25, [x25, _LEGACY_MODE@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, w21
	b.ne	LBB0_7
; %bb.6:
Lloh15:
	adrp	x8, _OTAP_DELAY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _OTAP_DELAY@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_arasan_phy_write
	cbnz	w0, LBB0_1
	b	LBB0_9
LBB0_7:
	mov	x0, x24
	bl	_OTAPDLY
	mov	x1, x0
Lloh18:
	adrp	x8, _OTAP_DELAY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _OTAP_DELAY@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_arasan_phy_write
	cbnz	w0, LBB0_1
; %bb.8:
	ldr	w8, [x26]
	cmp	w8, w21
	b.ne	LBB0_10
LBB0_9:
	mov	w1, #0
	b	LBB0_11
LBB0_10:
	mov	x0, x23
	bl	_ITAPDLY
	mov	x1, x0
LBB0_11:
Lloh21:
	adrp	x8, _ITAP_DELAY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ITAP_DELAY@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_arasan_phy_write
	cbnz	w0, LBB0_1
; %bb.12:
	ldr	w8, [x25]
	cmp	w8, w21
	b.eq	LBB0_14
; %bb.13:
Lloh24:
	adrp	x8, _DLL_TRIM@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DLL_TRIM@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_arasan_phy_write
	cbnz	w0, LBB0_1
LBB0_14:
Lloh27:
	adrp	x22, _DLL_STATUS@GOTPAGE
Lloh28:
	ldr	x22, [x22, _DLL_STATUS@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	mov	w1, #0
	bl	_arasan_phy_write
	cbnz	w0, LBB0_1
; %bb.15:
	ldr	w8, [x25]
	cmp	w8, w21
	b.ne	LBB0_17
; %bb.16:
	mov	w0, #0
	b	LBB0_1
LBB0_17:
	mov	x0, x20
	bl	_FREQSEL
	mov	x1, x0
	ldr	w2, [x22]
	mov	x0, x19
	bl	_arasan_phy_write
	cbnz	w0, LBB0_1
; %bb.18:
	ldr	w1, [x22]
Lloh29:
	adrp	x8, _DLL_RDY_MASK@GOTPAGE
Lloh30:
	ldr	x8, [x8, _DLL_RDY_MASK@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_arasan_phy_sts_poll
	cbz	w0, LBB0_1
; %bb.19:
Lloh32:
	adrp	x8, _EBUSY@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_HISPD_MODE,4,2                 ; @HISPD_MODE
	.comm	_HS200_MODE,4,2                 ; @HS200_MODE
	.comm	_MODE_CTRL,4,2                  ; @MODE_CTRL
	.comm	_HS400_MODE,4,2                 ; @HS400_MODE
	.comm	_IPAD_CTRL1,4,2                 ; @IPAD_CTRL1
	.comm	_LEGACY_MODE,4,2                ; @LEGACY_MODE
	.comm	_OTAP_DELAY,4,2                 ; @OTAP_DELAY
	.comm	_ITAP_DELAY,4,2                 ; @ITAP_DELAY
	.comm	_DLL_TRIM,4,2                   ; @DLL_TRIM
	.comm	_DLL_STATUS,4,2                 ; @DLL_STATUS
	.comm	_DLL_RDY_MASK,4,2               ; @DLL_RDY_MASK
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_arasan_phy_set
.subsections_via_symbols
