	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtsx_pci_read_ppbuf            ## -- Begin function rtsx_pci_read_ppbuf
	.p2align	4, 0x90
_rtsx_pci_read_ppbuf:                   ## @rtsx_pci_read_ppbuf
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$512, %edx                      ## imm = 0x200
	movl	$512, %r14d                     ## imm = 0x200
	cmovll	%edx, %r14d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	_PPBUF_BASE2@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leal	255(%r14), %eax
	testl	%r14d, %r14d
	cmovnsl	%r14d, %eax
	cmpl	$256, %r14d                     ## imm = 0x100
	jl	LBB0_7
## %bb.1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	sarl	$8, %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	movq	_READ_REG_CMD@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
	movl	%eax, -68(%rbp)                 ## 4-byte Spill
	movl	%r15d, %r12d
	movq	%rbx, %rdi
	callq	_rtsx_pci_init_cmd
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%r12,%r14), %edx
	movl	(%r13), %esi
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_rtsx_pci_add_cmd
	incl	%r14d
	cmpl	$256, %r14d                     ## imm = 0x100
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movl	$250, %esi
	callq	_rtsx_pci_send_cmd
	testl	%eax, %eax
	js	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	(%r12,%r14), %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_rtsx_pci_get_cmd_data
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	%eax, %esi
	movl	$256, %edx                      ## imm = 0x100
	callq	_memcpy
	addq	$1024, %r15                     ## imm = 0x400
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movl	-68(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	cmpl	-64(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_2
## %bb.6:
	addl	%r14d, %r12d
	movl	%r12d, %r15d
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movl	-60(%rbp), %eax                 ## 4-byte Reload
LBB0_7:
	andl	$-256, %eax
	subl	%eax, %r14d
	je	LBB0_12
## %bb.8:
	movq	%rbx, %rdi
	callq	_rtsx_pci_init_cmd
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	testl	%r14d, %r14d
	jle	LBB0_11
## %bb.9:
	movq	_READ_REG_CMD@GOTPCREL(%rip), %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %r12d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %esi
	leal	1(%r15), %r13d
	movq	%rbx, %rdi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_rtsx_pci_add_cmd
	movl	%r13d, %r15d
	decl	%r12d
	jne	LBB0_10
LBB0_11:
	movq	%rbx, %rdi
	movl	$250, %esi
	callq	_rtsx_pci_send_cmd
	testl	%eax, %eax
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	js	LBB0_13
LBB0_12:
	movq	%rbx, %rdi
	callq	_rtsx_pci_get_cmd_data
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	movl	%r14d, %edx
	callq	_memcpy
	xorl	%eax, %eax
LBB0_13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PPBUF_BASE2,4,2                ## @PPBUF_BASE2
	.comm	_READ_REG_CMD,4,2               ## @READ_REG_CMD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rtsx_pci_read_ppbuf            ; -- Begin function rtsx_pci_read_ppbuf
	.p2align	2
_rtsx_pci_read_ppbuf:                   ; @rtsx_pci_read_ppbuf
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x1
	mov	x20, x0
	mov	w8, #512
	cmp	w2, #512
	csel	w22, w2, w8, lt
Lloh0:
	adrp	x8, _PPBUF_BASE2@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PPBUF_BASE2@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	add	w8, w22, #255
	cmp	w22, #0
	csel	w8, w8, w22, lt
	asr	w23, w8, #8
	cmp	w22, #256
	b.lt	LBB0_7
; %bb.1:
	mov	w24, #0
Lloh3:
	adrp	x25, _READ_REG_CMD@GOTPAGE
Lloh4:
	ldr	x25, [x25, _READ_REG_CMD@GOTPAGEOFF]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	mov	x26, x21
	mov	x0, x20
	bl	_rtsx_pci_init_cmd
	mov	w27, #0
LBB0_3:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w2, w26, w27
	ldr	w1, [x25]
	mov	x0, x20
	mov	w3, #0
	mov	w4, #0
	bl	_rtsx_pci_add_cmd
	add	w27, w27, #1
	cmp	w27, #256
	b.ne	LBB0_3
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	mov	w1, #250
	bl	_rtsx_pci_send_cmd
	tbnz	w0, #31, LBB0_13
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w21, w26, w27
	mov	x0, x20
	bl	_rtsx_pci_get_cmd_data
	mov	x1, x0
	mov	x0, x19
	mov	w2, #256
	bl	_memcpy
	add	x19, x19, #1024
	add	w24, w24, #1
	cmp	w24, w23
	b.ne	LBB0_2
; %bb.6:
	add	w21, w26, w27
LBB0_7:
	subs	w22, w22, w23, lsl #8
	b.eq	LBB0_12
; %bb.8:
	mov	x0, x20
	bl	_rtsx_pci_init_cmd
	cmp	w22, #1
	b.lt	LBB0_11
; %bb.9:
Lloh5:
	adrp	x23, _READ_REG_CMD@GOTPAGE
Lloh6:
	ldr	x23, [x23, _READ_REG_CMD@GOTPAGEOFF]
	mov	x24, x22
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	add	w25, w21, #1
	mov	x0, x20
	mov	x2, x21
	mov	w3, #0
	mov	w4, #0
	bl	_rtsx_pci_add_cmd
	mov	x21, x25
	subs	w24, w24, #1
	b.ne	LBB0_10
LBB0_11:
	mov	x0, x20
	mov	w1, #250
	bl	_rtsx_pci_send_cmd
	tbnz	w0, #31, LBB0_13
LBB0_12:
	mov	x0, x20
	bl	_rtsx_pci_get_cmd_data
	mov	x1, x0
	mov	x0, x19
	mov	x2, x22
	bl	_memcpy
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_PPBUF_BASE2,4,2                ; @PPBUF_BASE2
	.comm	_READ_REG_CMD,4,2               ; @READ_REG_CMD
.subsections_via_symbols
