	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gart_map                ## -- Begin function amdgpu_gart_map
	.p2align	4, 0x90
_amdgpu_gart_map:                       ## @amdgpu_gart_map
	.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
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rdi)
	je	LBB0_1
## %bb.2:
	movl	%edx, %ecx
	testl	%edx, %edx
	je	LBB0_10
## %bb.3:
	movl	%r8d, %r13d
	movq	_AMDGPU_GPU_PAGE_SIZE@GOTPCREL(%rip), %rbx
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	(%rbx)
	movl	%eax, %r12d
	xorl	%esi, %esi
	movl	%ecx, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_AMDGPU_GPU_PAGES_IN_CPU_PAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%eax, %eax
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rsi
	cmpq	-56(%rbp), %rsi                 ## 8-byte Folded Reload
	je	LBB0_10
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	(%rax,%rsi,4), %r15d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	(%r12,%r14), %edx
	movq	%rdi, %rbx
	movq	%r9, %rsi
	movl	%r15d, %ecx
	movl	%r13d, %r8d
	callq	_amdgpu_gmc_set_pte_pde
	movq	_AMDGPU_GPU_PAGES_IN_CPU_PAGE@GOTPCREL(%rip), %rcx
	movq	_AMDGPU_GPU_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	%rbx, %rdi
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	addl	(%rax), %r15d
	incl	%r14d
	movl	(%rcx), %eax
	cmpl	%eax, %r14d
	jb	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	addl	%r14d, %r12d
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_10:
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_WARN
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$40, %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 bind memory to 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_map                ; -- Begin function amdgpu_gart_map
	.p2align	2
_amdgpu_gart_map:                       ; @amdgpu_gart_map
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	str	x3, [sp, #8]                    ; 8-byte Folded Spill
	ldr	w8, [x0]
	cbz	w8, LBB0_9
; %bb.1:
	cbz	w2, LBB0_8
; %bb.2:
	mov	x19, x5
	mov	x20, x4
	mov	x22, x0
	mov	x24, #0
Lloh0:
	adrp	x25, _AMDGPU_GPU_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _AMDGPU_GPU_PAGE_SIZE@GOTPAGEOFF]
	ldr	w8, [x25]
	udiv	w26, w1, w8
	mov	w27, w2
Lloh2:
	adrp	x28, _AMDGPU_GPU_PAGES_IN_CPU_PAGE@GOTPAGE
Lloh3:
	ldr	x28, [x28, _AMDGPU_GPU_PAGES_IN_CPU_PAGE@GOTPAGEOFF]
	ldr	w8, [x28]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	cmp	x24, x27
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	cbz	w8, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w21, #0
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	w23, [x8, x24, lsl #2]
LBB0_6:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w2, w26, w21
	mov	x0, x22
	mov	x1, x19
	mov	x3, x23
	mov	x4, x20
	bl	_amdgpu_gmc_set_pte_pde
	ldr	w8, [x25]
	add	w23, w8, w23
	add	w21, w21, #1
	ldr	w8, [x28]
	cmp	w21, w8
	b.lo	LBB0_6
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w26, w26, w21
	b	LBB0_3
LBB0_8:
	mov	w0, #0
	b	LBB0_10
LBB0_9:
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_10:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	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 bind memory to 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
