	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gart_bind               ## -- Begin function radeon_gart_bind
	.p2align	4, 0x90
_radeon_gart_bind:                      ## @radeon_gart_bind
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	cmpl	$0, 24(%rdi)
	je	LBB0_1
## %bb.2:
	movl	%edx, %r8d
	movq	%rdi, %r13
	testl	%edx, %edx
	jle	LBB0_11
## %bb.3:
	movq	_RADEON_GPU_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%r9d, %r9d
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%edi
	movl	%eax, %r10d
	movq	%rsi, %rax
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	xorl	%edx, %edx
	divl	%r10d
	movl	%r8d, %r10d
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%r10, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	addl	%r14d, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	-88(%rbp), %r9                  ## 8-byte Reload
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movq	-64(%rbp), %r10                 ## 8-byte Reload
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%r9
	incl	%eax
	cmpq	%r10, %r9
	je	LBB0_11
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	(%rcx,%r9,8), %r8
	movq	16(%r13), %rdx
	movl	%eax, %esi
	movq	%r8, (%rdx,%rsi,8)
	cmpl	%ebx, %edi
	ja	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%r9, -88(%rbp)                  ## 8-byte Spill
	movl	(%rax,%r9,4), %r12d
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=2
	movq	_RADEON_GPU_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addl	%edi, %r12d
	incl	%r14d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%edi
	cmpl	%eax, %r14d
	jae	LBB0_9
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%r14), %r15d
	movl	%r12d, %edi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_radeon_gart_get_page_entry
	movq	(%r13), %rcx
	movl	%eax, (%rcx,%r15,4)
	cmpq	$0, 8(%r13)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_radeon_gart_set_page
	jmp	LBB0_8
LBB0_11:
	cmpq	$0, 8(%r13)
	je	LBB0_12
## %bb.13:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_mb
	movq	%r13, %rdi
	callq	_radeon_gart_tlb_flush
	jmp	LBB0_14
LBB0_1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_WARN
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_14
LBB0_12:
	xorl	%r14d, %r14d
LBB0_14:
	movl	%r14d, %eax
	addq	$56, %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	_RADEON_GPU_PAGE_SIZE,4,2       ## @RADEON_GPU_PAGE_SIZE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gart_bind               ; -- Begin function radeon_gart_bind
	.p2align	2
_radeon_gart_bind:                      ; @radeon_gart_bind
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x4, [sp, #24]                   ; 8-byte Folded Spill
	ldr	w8, [x0, #24]
	cbz	w8, LBB0_13
; %bb.1:
	mov	x19, x0
	cmp	w2, #1
	b.lt	LBB0_10
; %bb.2:
	mov	x20, x5
	mov	x25, #0
Lloh0:
	adrp	x26, _RADEON_GPU_PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x26, [x26, _RADEON_GPU_PAGE_SIZE@GOTPAGEOFF]
	ldr	w8, [x26]
	udiv	w27, w1, w8
Lloh2:
	adrp	x28, _PAGE_SIZE@GOTPAGE
Lloh3:
	ldr	x28, [x28, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w9, [x28]
	udiv	w10, w9, w8
	mov	w12, w2
	udiv	w22, w27, w10
	stp	x12, x3, [sp, #8]               ; 16-byte Folded Spill
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w27, w27, w21
	ldp	x12, x3, [sp, #8]               ; 16-byte Folded Reload
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x25, x25, #1
	add	w22, w22, #1
	cmp	x25, x12
	b.eq	LBB0_10
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x10, [x3, x25, lsl #3]
	ldr	x11, [x19, #16]
	str	x10, [x11, w22, uxtw #3]
	cmp	w8, w9
	b.hi	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w21, #0
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	w23, [x8, x25, lsl #2]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	ldr	w8, [x26]
	add	w23, w8, w23
	add	w21, w21, #1
	ldr	w9, [x28]
	udiv	w10, w9, w8
	cmp	w21, w10
	b.hs	LBB0_3
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	w24, w27, w21
	mov	x0, x23
	mov	x1, x20
	bl	_radeon_gart_get_page_entry
	ldp	x8, x9, [x19]
	str	w0, [x8, w24, uxtw #2]
	cbz	x9, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	mov	x2, x0
	mov	x0, x19
	mov	x1, x24
	bl	_radeon_gart_set_page
	b	LBB0_7
LBB0_10:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_12
; %bb.11:
	bl	_mb
	mov	x0, x19
	bl	_radeon_gart_tlb_flush
LBB0_12:
	mov	w0, #0
	b	LBB0_14
LBB0_13:
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_14:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	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	_RADEON_GPU_PAGE_SIZE,4,2       ; @RADEON_GPU_PAGE_SIZE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
.subsections_via_symbols
