	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gart_unbind             ## -- Begin function amdgpu_gart_unbind
	.p2align	4, 0x90
_amdgpu_gart_unbind:                    ## @amdgpu_gart_unbind
	.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
	cmpl	$0, 24(%rdi)
	je	LBB0_1
## %bb.2:
	movl	%edx, %r13d
	movq	%rdi, %r15
	testl	%edx, %edx
	jle	LBB0_12
## %bb.3:
	movq	_AMDGPU_GPU_PAGE_SIZE@GOTPCREL(%rip), %r14
	xorl	%edi, %edi
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	(%r14)
	movl	%eax, %r12d
	movq	_AMDGPU_GPU_PAGES_IN_CPU_PAGE@GOTPCREL(%rip), %rax
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	incl	%r12d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	incl	%edi
	cmpl	%r13d, %edi
	je	LBB0_12
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movl	8(%r15), %esi
	testl	%esi, %esi
	je	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, (%rax)
	je	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	(%r15), %ebx
	movq	%r15, %rdi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	callq	_amdgpu_gmc_set_pte_pde
	movq	_AMDGPU_GPU_PAGES_IN_CPU_PAGE@GOTPCREL(%rip), %rax
	cmpl	$2, (%rax)
	jb	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	$1, %r13d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%r12,%r13), %edx
	addl	(%r14), %ebx
	movl	8(%r15), %esi
	movq	%r15, %rdi
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	callq	_amdgpu_gmc_set_pte_pde
	movq	_AMDGPU_GPU_PAGES_IN_CPU_PAGE@GOTPCREL(%rip), %rax
	incl	%r13d
	cmpl	(%rax), %r13d
	jb	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	addl	%r13d, %r12d
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_11
LBB0_12:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_mb
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_asic_flush_hdp
	cmpl	$0, 4(%r15)
	jle	LBB0_15
## %bb.13:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	xorl	%ecx, %ecx
	callq	_amdgpu_gmc_flush_gpu_tlb
	incl	%ebx
	cmpl	4(%r15), %ebx
	jl	LBB0_14
	jmp	LBB0_15
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_WARN
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_15:
	movl	%r14d, %eax
	addq	$24, %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	"trying to unbind memory from uninitialized GART !\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AMDGPU_GPU_PAGE_SIZE,4,2       ## @AMDGPU_GPU_PAGE_SIZE
	.comm	_AMDGPU_GPU_PAGES_IN_CPU_PAGE,4,2 ## @AMDGPU_GPU_PAGES_IN_CPU_PAGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gart_unbind             ; -- Begin function amdgpu_gart_unbind
	.p2align	2
_amdgpu_gart_unbind:                    ; @amdgpu_gart_unbind
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	w8, [x0, #24]
	cbz	w8, LBB0_14
; %bb.1:
	mov	x20, x2
	mov	x19, x0
	cmp	w2, #1
	b.lt	LBB0_10
; %bb.2:
	mov	w23, #0
Lloh0:
	adrp	x24, _AMDGPU_GPU_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _AMDGPU_GPU_PAGE_SIZE@GOTPAGEOFF]
	ldr	w8, [x24]
	udiv	w21, w1, w8
Lloh2:
	adrp	x25, _AMDGPU_GPU_PAGES_IN_CPU_PAGE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _AMDGPU_GPU_PAGES_IN_CPU_PAGE@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w21, #1
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w23, w23, #1
	cmp	w23, w20
	b.eq	LBB0_10
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	w1, [x19, #8]
	ldr	w8, [x25]
	cmp	w1, #0
	ccmp	w8, #0, #4, ne
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w22, [x19]
	mov	x0, x19
	mov	x2, x21
	mov	x3, x22
	mov	w4, #0
	bl	_amdgpu_gmc_set_pte_pde
	ldr	w8, [x25]
	cmp	w8, #2
	b.lo	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w26, #1
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w2, w21, w26
	ldr	w8, [x24]
	add	w22, w8, w22
	ldr	w1, [x19, #8]
	mov	x0, x19
	mov	x3, x22
	mov	w4, #0
	bl	_amdgpu_gmc_set_pte_pde
	add	w26, w26, #1
	ldr	w8, [x25]
	cmp	w26, w8
	b.lo	LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w21, w26
	b	LBB0_4
LBB0_10:
	bl	_mb
	mov	x0, x19
	mov	x1, #0
	bl	_amdgpu_asic_flush_hdp
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.11:
	mov	w20, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	mov	w3, #0
	bl	_amdgpu_gmc_flush_gpu_tlb
	add	w20, w20, #1
	ldr	w8, [x19, #4]
	cmp	w20, w8
	b.lt	LBB0_12
LBB0_13:
	mov	w0, #0
	b	LBB0_15
LBB0_14:
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_WARN
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"trying to unbind memory from uninitialized GART !\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AMDGPU_GPU_PAGE_SIZE,4,2       ; @AMDGPU_GPU_PAGE_SIZE
	.comm	_AMDGPU_GPU_PAGES_IN_CPU_PAGE,4,2 ; @AMDGPU_GPU_PAGES_IN_CPU_PAGE
.subsections_via_symbols
