	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a6xx_gmu_memory_free
_a6xx_gmu_memory_free:                  ## @a6xx_gmu_memory_free
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	je	LBB0_1
## %bb.5:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	(%r15), %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	testl	%eax, %eax
	jle	LBB0_4
## %bb.2:
	movl	16(%r15), %ebx
	movl	%eax, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %r13
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	movl	%ebx, %esi
	callq	_iommu_unmap
	movq	8(%r15), %rax
	movq	16(%rax,%r12), %rcx
	movq	%rcx, 16(%rsp)
	movups	(%rax,%r12), %xmm0
	movups	%xmm0, (%rsp)
	xorl	%edi, %edi
	callq	___free_pages
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	addl	%edx, %ebx
	addq	$24, %r12
	cmpq	%r12, %r13
	jne	LBB0_3
LBB0_4:
	movq	8(%r15), %rdi
	callq	_kfree
	movq	%r15, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.no_dead_strip	_a6xx_gmu_memory_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a6xx_gmu_memory_free
_a6xx_gmu_memory_free:                  ; @a6xx_gmu_memory_free
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_IS_ERR_OR_NULL
	cbnz	x0, LBB0_5
; %bb.1:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	asr	w8, w8, w9
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x22, #0
	ldr	w21, [x19, #16]
Lloh3:
	adrp	x23, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x23, [x23, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x2, [x23]
	mov	w9, #24
	umull	x24, w8, w9
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	mov	x1, x21
	bl	_iommu_unmap
	ldr	x8, [x19, #8]
	add	x8, x8, x22
	ldr	q0, [x8]
	ldr	x8, [x8, #16]
	str	x8, [sp, #16]
	str	q0, [sp]
	mov	x0, sp
	mov	w1, #0
	bl	___free_pages
	ldr	x2, [x23]
	add	w21, w21, w2
	add	x22, x22, #24
	cmp	x24, x22
	b.ne	LBB0_3
LBB0_4:
	ldr	x0, [x19, #8]
	bl	_kfree
	mov	x0, x19
	bl	_kfree
LBB0_5:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_a6xx_gmu_memory_free
.subsections_via_symbols
