	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps3vram_cache_load
_ps3vram_cache_load:                    ## @ps3vram_cache_load
	.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
	movl	%edx, %r14d
	movl	%esi, %r12d
	movq	%rdi, %r13
	callq	_ps3_system_bus_get_drvdata
	movq	%rax, %r15
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	callq	_dev_dbg
	movq	_CACHE_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%r15), %eax
	movl	%eax, %edx
	imull	%r12d, %edx
	movslq	%edx, %rbx
	addq	(%rcx), %rbx
	movq	_DMA_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cltd
	idivl	%ecx
	movq	%r13, %rdi
	movl	%r14d, %esi
	movq	%rbx, %rdx
	movl	%eax, %r8d
	callq	_ps3vram_download
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	movl	(%r15), %r8d
	movl	%r8d, %ecx
	imull	%r12d, %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	_dev_err
LBB0_2:
	movq	8(%r15), %rax
	movslq	%r12d, %rcx
	movl	%r14d, (%rax,%rcx,8)
	movq	_CACHE_PAGE_PRESENT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	%edx, 4(%rax,%rcx,8)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Fetching %d: 0x%08x\n"

	.comm	_CACHE_OFFSET,8,3               ## @CACHE_OFFSET
	.comm	_DMA_PAGE_SIZE,4,2              ## @DMA_PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to download from 0x%x to 0x%x size 0x%x\n"

	.comm	_CACHE_PAGE_PRESENT,4,2         ## @CACHE_PAGE_PRESENT
	.no_dead_strip	_ps3vram_cache_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps3vram_cache_load
_ps3vram_cache_load:                    ; @ps3vram_cache_load
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x1
	mov	x22, x0
	bl	_ps3_system_bus_get_drvdata
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x20
	mov	x3, x19
	bl	_dev_dbg
Lloh2:
	adrp	x8, _CACHE_OFFSET@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CACHE_OFFSET@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	w9, [x21]
	mul	w10, w9, w20
	add	x2, x8, w10, sxtw
Lloh5:
	adrp	x8, _DMA_PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DMA_PAGE_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w3, [x8]
	sdiv	w4, w9, w3
	mov	x0, x22
	mov	x1, x19
	bl	_ps3vram_download
	tbz	x0, #63, LBB0_2
; %bb.1:
	ldr	w4, [x21]
	mul	w3, w4, w20
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x19
	bl	_dev_err
LBB0_2:
	ldr	x8, [x21, #8]
	add	x8, x8, w20, sxtw #3
	str	w19, [x8]
Lloh10:
	adrp	x9, _CACHE_PAGE_PRESENT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _CACHE_PAGE_PRESENT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	ldr	w10, [x8, #4]
	orr	w9, w10, w9
	str	w9, [x8, #4]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Fetching %d: 0x%08x\n"

	.comm	_CACHE_OFFSET,8,3               ; @CACHE_OFFSET
	.comm	_DMA_PAGE_SIZE,4,2              ; @DMA_PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to download from 0x%x to 0x%x size 0x%x\n"

	.comm	_CACHE_PAGE_PRESENT,4,2         ; @CACHE_PAGE_PRESENT
	.no_dead_strip	_ps3vram_cache_load
.subsections_via_symbols
