	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtsx_pci_write_register        ## -- Begin function rtsx_pci_write_register
	.p2align	4, 0x90
_rtsx_pci_write_register:               ## @rtsx_pci_write_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	%rdi, %r13
	movq	_HAIMR_WRITE_START@GOTPCREL(%rip), %rax
	shll	$16, %esi
	andl	$1073676288, %esi               ## imm = 0x3FFF0000
	shll	$8, %edx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	orl	%ecx, %edx
	orl	%esi, %edx
	orl	(%rax), %edx
	movq	_RTSX_HAIMR@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_rtsx_pci_writel
	movq	_MAX_RW_REG_CNT@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_6
## %bb.1:
	xorl	%ebx, %ebx
	movq	_HAIMR_TRANS_END@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_rtsx_pci_readl
	testl	%eax, (%r14)
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_3
LBB0_6:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_4:
	movslq	%eax, %rcx
	xorl	%eax, %eax
	cmpq	-48(%rbp), %rcx                 ## 8-byte Folded Reload
	je	LBB0_8
## %bb.5:
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HAIMR_WRITE_START,4,2          ## @HAIMR_WRITE_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	_EIO,4,2                        ## @EIO
	.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_write_register        ; -- Begin function rtsx_pci_write_register
	.p2align	2
_rtsx_pci_write_register:               ; @rtsx_pci_write_register
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x3
	mov	x20, x0
Lloh0:
	adrp	x8, _HAIMR_WRITE_START@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HAIMR_WRITE_START@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ubfiz	w9, w1, #16, #14
	orr	w9, w9, w2, lsl #8
	orr	w9, w9, w19
	orr	w2, w9, w8
Lloh3:
	adrp	x21, _RTSX_HAIMR@GOTPAGE
Lloh4:
	ldr	x21, [x21, _RTSX_HAIMR@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_rtsx_pci_writel
Lloh5:
	adrp	x22, _MAX_RW_REG_CNT@GOTPAGE
Lloh6:
	ldr	x22, [x22, _MAX_RW_REG_CNT@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w23, #0
Lloh7:
	adrp	x24, _HAIMR_TRANS_END@GOTPAGE
Lloh8:
	ldr	x24, [x24, _HAIMR_TRANS_END@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x20
	bl	_rtsx_pci_readl
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w23, w23, #1
	ldr	w8, [x22]
	cmp	w23, w8
	b.lt	LBB0_2
LBB0_4:
Lloh9:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	sxtw	x8, w0
	cmp	x8, x19
	b.ne	LBB0_7
; %bb.6:
	mov	w0, #0
	b	LBB0_9
LBB0_7:
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_HAIMR_WRITE_START,4,2          ; @HAIMR_WRITE_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	_EIO,4,2                        ; @EIO
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
.subsections_via_symbols
