	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ttm_init                ## -- Begin function radeon_ttm_init
	.p2align	4, 0x90
_radeon_ttm_init:                       ## @radeon_ttm_init
	.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	%rdi, %r15
	leaq	16(%rdi), %r14
	movq	24(%rdi), %rdi
	movq	32(%r15), %rax
	movq	(%rax), %rax
	movl	(%rax), %ebx
	callq	_dma_addressing_limited
	movq	_radeon_bo_driver@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_ttm_bo_device_init
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_14
LBB0_2:
	movl	$1, 12(%r15)
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r13
	movb	(%r13), %cl
	sarl	%cl, %edx
	movq	%r14, %rdi
	callq	_ttm_bo_init_mm
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
LBB0_13:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_14
LBB0_4:
	movl	8(%r15), %esi
	movq	%r15, %rdi
	callq	_radeon_ttm_set_active_vram_size
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_RADEON_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	20(%r15), %r12
	movq	%r12, 16(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movq	%r15, %rdi
	movl	$262144, %esi                   ## imm = 0x40000
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	_radeon_bo_create
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.5:
	movl	(%r12), %edi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.6:
	movl	(%r12), %edi
	movq	_RADEON_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_radeon_bo_pin
	movl	%eax, %ebx
	movl	(%r12), %edi
	callq	_radeon_bo_unreserve
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.7:
	movq	%r12, %rdi
	callq	_radeon_bo_unref
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%r15), %eax
	leal	1048575(%rax), %esi
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	sarl	$20, %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_DRM_INFO
	movq	_TTM_PL_TT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	movb	(%r13), %cl
	sarl	%cl, %edx
	movq	%r14, %rdi
	callq	_ttm_bo_init_mm
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_13
LBB0_10:
	movl	4(%r15), %eax
	leal	1048575(%rax), %esi
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	sarl	$20, %esi
	leaq	L_.str.4(%rip), %rdi
	callq	_DRM_INFO
	movq	%r15, %rdi
	callq	_radeon_ttm_debugfs_init
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_13
LBB0_11:
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_radeon_bo_driver,4,2           ## @radeon_bo_driver
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed initializing buffer object driver(%d).\n"

	.comm	_TTM_PL_VRAM,4,2                ## @TTM_PL_VRAM
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"Failed initializing VRAM heap.\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_RADEON_GEM_DOMAIN_VRAM,4,2     ## @RADEON_GEM_DOMAIN_VRAM
L_.str.2:                               ## @.str.2
	.asciz	"radeon: %uM of VRAM memory ready\n"

	.comm	_TTM_PL_TT,4,2                  ## @TTM_PL_TT
L_.str.3:                               ## @.str.3
	.asciz	"Failed initializing GTT heap.\n"

L_.str.4:                               ## @.str.4
	.asciz	"radeon: %uM of GTT memory ready.\n"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to init debugfs\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_ttm_init                ; -- Begin function radeon_ttm_init
	.p2align	2
_radeon_ttm_init:                       ; @radeon_ttm_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x0
	add	x20, x0, #16
	ldp	x0, x8, [x0, #24]
	ldr	x8, [x8]
	ldr	w21, [x8]
	bl	_dma_addressing_limited
	mov	x3, x0
Lloh0:
	adrp	x1, _radeon_bo_driver@GOTPAGE
Lloh1:
	ldr	x1, [x1, _radeon_bo_driver@GOTPAGEOFF]
	mov	x0, x20
	mov	x2, x21
	bl	_ttm_bo_device_init
	cbz	w0, LBB0_2
; %bb.1:
	mov	x21, x0
	str	x21, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	mov	w8, #1
	str	w8, [x19, #12]
Lloh4:
	adrp	x8, _TTM_PL_VRAM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	w8, [x19]
Lloh7:
	adrp	x23, _PAGE_SHIFT@GOTPAGE
Lloh8:
	ldr	x23, [x23, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x23]
	asr	w2, w8, w9
	mov	x0, x20
	bl	_ttm_bo_init_mm
	cbz	w0, LBB0_6
; %bb.3:
	mov	x21, x0
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_DRM_ERROR
LBB0_5:
	mov	x0, x21
	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
	add	sp, sp, #80
	ret
LBB0_6:
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_radeon_ttm_set_active_vram_size
Lloh11:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x24, _RADEON_GEM_DOMAIN_VRAM@GOTPAGE
Lloh15:
	ldr	x24, [x24, _RADEON_GEM_DOMAIN_VRAM@GOTPAGEOFF]
	ldr	w4, [x24]
	add	x22, x19, #20
	str	x22, [sp]
	mov	x0, x19
	mov	w1, #262144
	mov	w3, #1
	mov	w5, #0
	mov	x6, #0
	mov	x7, #0
	bl	_radeon_bo_create
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.7:
	ldr	w0, [x22]
	mov	w1, #0
	bl	_radeon_bo_reserve
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.8:
	ldr	w0, [x22]
	ldr	w1, [x24]
	mov	x2, #0
	bl	_radeon_bo_pin
	mov	x21, x0
	ldr	w0, [x22]
	bl	_radeon_bo_unreserve
	cbz	w21, LBB0_10
; %bb.9:
	mov	x0, x22
	bl	_radeon_bo_unref
	b	LBB0_5
LBB0_10:
	ldr	w8, [x19]
	mov	w22, #1048575
	add	w9, w8, w22
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w1, w8, #20
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
Lloh18:
	adrp	x8, _TTM_PL_TT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TTM_PL_TT@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	w8, [x19, #4]
	ldr	w9, [x23]
	asr	w2, w8, w9
	mov	x0, x20
	bl	_ttm_bo_init_mm
	cbz	w0, LBB0_12
; %bb.11:
	mov	x21, x0
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_12:
	ldr	w8, [x19, #4]
	add	w9, w8, w22
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w1, w8, #20
Lloh23:
	adrp	x0, l_.str.4@PAGE
Lloh24:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_INFO
	mov	x0, x19
	bl	_radeon_ttm_debugfs_init
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.13:
Lloh25:
	adrp	x0, l_.str.5@PAGE
Lloh26:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_radeon_bo_driver,4,2           ; @radeon_bo_driver
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed initializing buffer object driver(%d).\n"

	.comm	_TTM_PL_VRAM,4,2                ; @TTM_PL_VRAM
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"Failed initializing VRAM heap.\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_RADEON_GEM_DOMAIN_VRAM,4,2     ; @RADEON_GEM_DOMAIN_VRAM
l_.str.2:                               ; @.str.2
	.asciz	"radeon: %uM of VRAM memory ready\n"

	.comm	_TTM_PL_TT,4,2                  ; @TTM_PL_TT
l_.str.3:                               ; @.str.3
	.asciz	"Failed initializing GTT heap.\n"

l_.str.4:                               ; @.str.4
	.asciz	"radeon: %uM of GTT memory ready.\n"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to init debugfs\n"

.subsections_via_symbols
