	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtsx_pci_read_register         ## -- Begin function rtsx_pci_read_register
	.p2align	4, 0x90
_rtsx_pci_read_register:                ## @rtsx_pci_read_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	_HAIMR_READ_START@GOTPCREL(%rip), %rax
	shll	$16, %r12d
	andl	$1073676288, %r12d              ## imm = 0x3FFF0000
	orl	(%rax), %r12d
	movq	_RTSX_HAIMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edx
	callq	_rtsx_pci_writel
	movq	_MAX_RW_REG_CNT@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, %eax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	movq	_HAIMR_TRANS_END@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_RTSX_HAIMR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rtsx_pci_readl
	movl	%eax, %r12d
	testl	%eax, (%r13)
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	jl	LBB0_3
	jmp	LBB0_6
LBB0_1:
	xorl	%ebx, %ebx
LBB0_6:
	cmpl	%eax, %ebx
	jge	LBB0_7
LBB0_8:
	xorl	%eax, %eax
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.9:
	movzbl	%r12b, %ecx
	movq	%rcx, (%rdx)
	jmp	LBB0_10
LBB0_4:
	movl	(%r14), %eax
	cmpl	%eax, %ebx
	jl	LBB0_8
LBB0_7:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HAIMR_READ_START,4,2           ## @HAIMR_READ_START
	.comm	_RTSX_HAIMR,4,2                 ## @RTSX_HAIMR
	.comm	_MAX_RW_REG_CNT,4,2             ## @MAX_RW_REG_CNT
	.comm	_HAIMR_TRANS_END,4,2            ## @HAIMR_TRANS_END
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtsx_pci_read_register         ; -- Begin function rtsx_pci_read_register
	.p2align	2
_rtsx_pci_read_register:                ; @rtsx_pci_read_register
	.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, x2
	mov	x21, x0
Lloh0:
	adrp	x8, _HAIMR_READ_START@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HAIMR_READ_START@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ubfiz	w9, w1, #16, #14
	orr	w20, w8, w9
Lloh3:
	adrp	x23, _RTSX_HAIMR@GOTPAGE
Lloh4:
	ldr	x23, [x23, _RTSX_HAIMR@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x2, x20
	bl	_rtsx_pci_writel
Lloh5:
	adrp	x24, _MAX_RW_REG_CNT@GOTPAGE
Lloh6:
	ldr	x24, [x24, _MAX_RW_REG_CNT@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w22, #0
Lloh7:
	adrp	x25, _HAIMR_TRANS_END@GOTPAGE
Lloh8:
	ldr	x25, [x25, _HAIMR_TRANS_END@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x21
	bl	_rtsx_pci_readl
	mov	x20, x0
	ldr	w8, [x25]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w22, w22, #1
	ldr	w8, [x24]
	cmp	w22, w8
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	mov	w22, #0
LBB0_5:
	cmp	w22, w8
	b.ge	LBB0_9
LBB0_6:
	mov	w0, #0
	cbz	x19, LBB0_10
; %bb.7:
	and	w8, w20, #0xff
	str	x8, [x19]
	b	LBB0_10
LBB0_8:
	ldr	w8, [x24]
	cmp	w22, w8
	b.lt	LBB0_6
LBB0_9:
Lloh9:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_HAIMR_READ_START,4,2           ; @HAIMR_READ_START
	.comm	_RTSX_HAIMR,4,2                 ; @RTSX_HAIMR
	.comm	_MAX_RW_REG_CNT,4,2             ; @MAX_RW_REG_CNT
	.comm	_HAIMR_TRANS_END,4,2            ; @HAIMR_TRANS_END
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
