	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps3vram_cache_evict
_ps3vram_cache_evict:                   ## @ps3vram_cache_evict
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_ps3_system_bus_get_drvdata
	movq	%rax, %r14
	movq	8(%rax), %rax
	movslq	%ebx, %rbx
	movq	_CACHE_PAGE_DIRTY@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	testl	%ecx, (%rax,%rbx,8)
	je	LBB0_4
## %bb.1:
	movl	4(%rax,%rbx,8), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_dev_dbg
	movq	_CACHE_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%r14), %eax
	movl	%eax, %edx
	imull	%ebx, %edx
	movslq	%edx, %rsi
	addq	(%rcx), %rsi
	movq	8(%r14), %rcx
	movl	4(%rcx,%rbx,8), %r8d
	movq	_DMA_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cltd
	idivl	%ecx
	movq	%r15, %rdi
	movl	%r8d, %edx
	movl	%eax, %r8d
	callq	_ps3vram_upload
	testq	%rax, %rax
	jns	LBB0_3
## %bb.2:
	movl	(%r14), %r8d
	movl	%ebx, %edx
	imull	%r8d, %edx
	movq	8(%r14), %rax
	movl	4(%rax,%rbx,8), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
LBB0_3:
	movl	(%r12), %eax
	notl	%eax
	movq	8(%r14), %rcx
	andl	%eax, (%rcx,%rbx,8)
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CACHE_PAGE_DIRTY,4,2           ## @CACHE_PAGE_DIRTY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Flushing %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 upload from 0x%x to 0x%x size 0x%x\n"

	.no_dead_strip	_ps3vram_cache_evict
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps3vram_cache_evict
_ps3vram_cache_evict:                   ; @ps3vram_cache_evict
	.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	x21, x1
	mov	x20, x0
	bl	_ps3_system_bus_get_drvdata
	ldr	x8, [x0, #8]
	sbfiz	x9, x21, #3, #32
	ldr	w9, [x8, x9]
Lloh0:
	adrp	x22, _CACHE_PAGE_DIRTY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CACHE_PAGE_DIRTY@GOTPAGEOFF]
	ldr	w10, [x22]
	tst	w10, w9
	b.eq	LBB0_4
; %bb.1:
	mov	x19, x0
	sxtw	x24, w21
	lsl	x23, x24, #3
	add	x8, x8, x23
	ldr	w3, [x8, #4]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_dev_dbg
Lloh4:
	adrp	x8, _CACHE_OFFSET@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CACHE_OFFSET@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	ldr	w9, [x19]
	mul	w10, w9, w21
	add	x1, x8, w10, sxtw
	ldr	x8, [x19, #8]
	add	x8, x8, x23
	ldr	w2, [x8, #4]
Lloh7:
	adrp	x8, _DMA_PAGE_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DMA_PAGE_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	sdiv	w4, w9, w3
	mov	x0, x20
	bl	_ps3vram_upload
	tbz	x0, #63, LBB0_3
; %bb.2:
	ldr	w4, [x19]
	mul	w2, w4, w21
	ldr	x8, [x19, #8]
	add	x8, x8, x24, lsl #3
	ldr	w3, [x8, #4]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
LBB0_3:
	ldr	w8, [x22]
	ldr	x9, [x19, #8]
	ldr	w10, [x9, x23]
	bic	w8, w10, w8
	str	w8, [x9, x23]
LBB0_4:
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CACHE_PAGE_DIRTY,4,2           ; @CACHE_PAGE_DIRTY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Flushing %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 upload from 0x%x to 0x%x size 0x%x\n"

	.no_dead_strip	_ps3vram_cache_evict
.subsections_via_symbols
