	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___rtsx_pci_read_phy_register   ## -- Begin function __rtsx_pci_read_phy_register
	.p2align	4, 0x90
___rtsx_pci_read_phy_register:          ## @__rtsx_pci_read_phy_register
	.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
	movq	%rdx, %r12
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_rtsx_pci_init_cmd
	movq	_WRITE_REG_CMD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_PHYADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$255, %ecx
	movl	%ebx, %r8d
	callq	_rtsx_pci_add_cmd
	movl	(%r14), %esi
	movq	_PHYRWCTL@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r15, %rdi
	movl	$255, %ecx
	movl	$128, %r8d
	callq	_rtsx_pci_add_cmd
	movq	%r15, %rdi
	movl	$100, %esi
	callq	_rtsx_pci_send_cmd
	testl	%eax, %eax
	js	LBB0_11
## %bb.1:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	$100000, %r14d                  ## imm = 0x186A0
	leaq	-44(%rbp), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_rtsx_pci_read_register
	testl	%eax, %eax
	js	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testb	$-128, -44(%rbp)
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	decl	%r14d
	jne	LBB0_2
## %bb.5:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_8:
	movq	%r15, %rdi
	callq	_rtsx_pci_init_cmd
	movq	_READ_REG_CMD@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	_PHYDATA0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_rtsx_pci_add_cmd
	movl	(%r14), %esi
	movq	_PHYDATA1@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_rtsx_pci_add_cmd
	movq	%r15, %rdi
	movl	$100, %esi
	callq	_rtsx_pci_send_cmd
	testl	%eax, %eax
	js	LBB0_11
## %bb.9:
	movq	%r15, %rdi
	callq	_rtsx_pci_get_cmd_data
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_12
## %bb.10:
	movl	4(%rax), %ecx
	shll	$8, %ecx
	orl	(%rax), %ecx
	movl	%ecx, (%rdx)
	jmp	LBB0_12
LBB0_11:
	movl	%eax, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WRITE_REG_CMD,4,2              ## @WRITE_REG_CMD
	.comm	_PHYADDR,4,2                    ## @PHYADDR
	.comm	_PHYRWCTL,4,2                   ## @PHYRWCTL
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_READ_REG_CMD,4,2               ## @READ_REG_CMD
	.comm	_PHYDATA0,4,2                   ## @PHYDATA0
	.comm	_PHYDATA1,4,2                   ## @PHYDATA1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___rtsx_pci_read_phy_register   ; -- Begin function __rtsx_pci_read_phy_register
	.p2align	2
___rtsx_pci_read_phy_register:          ; @__rtsx_pci_read_phy_register
	.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, x2
	mov	x21, x1
	mov	x20, x0
	bl	_rtsx_pci_init_cmd
Lloh0:
	adrp	x22, _WRITE_REG_CMD@GOTPAGE
Lloh1:
	ldr	x22, [x22, _WRITE_REG_CMD@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x8, _PHYADDR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PHYADDR@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w3, #255
	mov	x4, x21
	bl	_rtsx_pci_add_cmd
	ldr	w1, [x22]
Lloh5:
	adrp	x21, _PHYRWCTL@GOTPAGE
Lloh6:
	ldr	x21, [x21, _PHYRWCTL@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x20
	mov	w3, #255
	mov	w4, #128
	bl	_rtsx_pci_add_cmd
	mov	x0, x20
	mov	w1, #100
	bl	_rtsx_pci_send_cmd
	tbnz	w0, #31, LBB0_10
; %bb.1:
	mov	w22, #34464
	movk	w22, #1, lsl #16
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x20
	bl	_rtsx_pci_read_register
	tbnz	w0, #31, LBB0_10
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldrb	w8, [sp, #12]
	tbz	w8, #7, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	subs	w22, w22, #1
	b.ne	LBB0_2
; %bb.5:
Lloh7:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_6:
	mov	x0, x20
	bl	_rtsx_pci_init_cmd
Lloh10:
	adrp	x21, _READ_REG_CMD@GOTPAGE
Lloh11:
	ldr	x21, [x21, _READ_REG_CMD@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh12:
	adrp	x8, _PHYDATA0@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PHYDATA0@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w3, #0
	mov	w4, #0
	bl	_rtsx_pci_add_cmd
	ldr	w1, [x21]
Lloh15:
	adrp	x8, _PHYDATA1@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PHYDATA1@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w3, #0
	mov	w4, #0
	bl	_rtsx_pci_add_cmd
	mov	x0, x20
	mov	w1, #100
	bl	_rtsx_pci_send_cmd
	tbnz	w0, #31, LBB0_10
; %bb.7:
	mov	x0, x20
	bl	_rtsx_pci_get_cmd_data
	cbz	x19, LBB0_9
; %bb.8:
	mov	x8, x0
	mov	w0, #0
	ldp	w8, w9, [x8]
	orr	w8, w8, w9, lsl #8
	str	w8, [x19]
	b	LBB0_10
LBB0_9:
	mov	w0, #0
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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_WRITE_REG_CMD,4,2              ; @WRITE_REG_CMD
	.comm	_PHYADDR,4,2                    ; @PHYADDR
	.comm	_PHYRWCTL,4,2                   ; @PHYRWCTL
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_READ_REG_CMD,4,2               ; @READ_REG_CMD
	.comm	_PHYDATA0,4,2                   ; @PHYDATA0
	.comm	_PHYDATA1,4,2                   ; @PHYDATA1
.subsections_via_symbols
