	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_radeon_ttm_global_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.1:
	leaq	12(%r15), %r14
	movq	_DRM_FILE_PAGE_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	16(%r15), %esi
	movl	32(%r15), %r8d
	movq	_radeon_bo_driver@GOTPCREL(%rip), %rdx
	movq	%r14, %rdi
	callq	_ttm_bo_device_init
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_15
LBB0_3:
	movl	$1, 8(%r15)
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	20(%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_5
## %bb.4:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rdi
LBB0_14:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_15
LBB0_5:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_RADEON_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	28(%r15), %r12
	movq	%r12, (%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_15
## %bb.6:
	movl	(%r12), %edi
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.7:
	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_9
## %bb.8:
	movq	%r12, %rdi
	callq	_radeon_bo_unref
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	20(%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	24(%r15), %edx
	movb	(%r13), %cl
	sarl	%cl, %edx
	movq	%r14, %rdi
	callq	_ttm_bo_init_mm
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_14
LBB0_11:
	movl	24(%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), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r15)
	movq	%r15, %rdi
	callq	_radeon_ttm_debugfs_init
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_14
LBB0_12:
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_radeon_bo_driver,4,2           ## @radeon_bo_driver
	.comm	_DRM_FILE_PAGE_OFFSET,4,2       ## @DRM_FILE_PAGE_OFFSET
	.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
	bl	_radeon_ttm_global_init
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.1:
	add	x20, x19, #12
	ldr	w1, [x19, #16]
Lloh0:
	adrp	x8, _DRM_FILE_PAGE_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_FILE_PAGE_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	ldr	w4, [x19, #32]
Lloh3:
	adrp	x2, _radeon_bo_driver@GOTPAGE
Lloh4:
	ldr	x2, [x2, _radeon_bo_driver@GOTPAGEOFF]
	mov	x0, x20
	bl	_ttm_bo_device_init
	cbz	w0, LBB0_3
; %bb.2:
	mov	x21, x0
	str	x21, [sp]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_5
LBB0_3:
	mov	w8, #1
	str	w8, [x19, #8]
Lloh7:
	adrp	x8, _TTM_PL_VRAM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	ldr	w8, [x19, #20]
Lloh10:
	adrp	x23, _PAGE_SHIFT@GOTPAGE
Lloh11:
	ldr	x23, [x23, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x23]
	asr	w2, w8, w9
	mov	x0, x20
	bl	_ttm_bo_init_mm
	cbz	w0, LBB0_7
; %bb.4:
	mov	x21, x0
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_5:
	bl	_DRM_ERROR
LBB0_6:
	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_7:
Lloh14:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x24, _RADEON_GEM_DOMAIN_VRAM@GOTPAGE
Lloh18:
	ldr	x24, [x24, _RADEON_GEM_DOMAIN_VRAM@GOTPAGEOFF]
	ldr	w4, [x24]
	add	x22, x19, #28
	mov	x0, x19
	mov	w1, #262144
	mov	w3, #1
	mov	x5, #0
	mov	x6, x22
	bl	_radeon_bo_create
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.8:
	ldr	w0, [x22]
	mov	w1, #0
	bl	_radeon_bo_reserve
	mov	x21, x0
	cbnz	w0, LBB0_6
; %bb.9:
	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_11
; %bb.10:
	mov	x0, x22
	bl	_radeon_bo_unref
	b	LBB0_6
LBB0_11:
	ldr	w8, [x19, #20]
	mov	w22, #1048575
	add	w9, w8, w22
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w1, w8, #20
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
Lloh21:
	adrp	x8, _TTM_PL_TT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TTM_PL_TT@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	ldr	w8, [x19, #24]
	ldr	w9, [x23]
	asr	w2, w8, w9
	mov	x0, x20
	bl	_ttm_bo_init_mm
	cbz	w0, LBB0_13
; %bb.12:
	mov	x21, x0
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_5
LBB0_13:
	ldr	w8, [x19, #24]
	add	w9, w8, w22
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w1, w8, #20
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_INFO
	ldr	x8, [x19]
	ldr	w8, [x8]
	str	w8, [x19, #12]
	mov	x0, x19
	bl	_radeon_ttm_debugfs_init
	mov	x21, x0
	cbz	w0, LBB0_6
; %bb.14:
Lloh28:
	adrp	x0, l_.str.5@PAGE
Lloh29:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_5
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_radeon_bo_driver,4,2           ; @radeon_bo_driver
	.comm	_DRM_FILE_PAGE_OFFSET,4,2       ; @DRM_FILE_PAGE_OFFSET
	.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
