	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ttm_init                ## -- Begin function amdgpu_ttm_init
	.p2align	4, 0x90
_amdgpu_ttm_init:                       ## @amdgpu_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	addq	$24, %rdi
	callq	_mutex_init
	leaq	16(%r15), %r14
	movq	56(%r15), %rax
	movq	(%rax), %rax
	movl	(%rax), %ebx
	movl	52(%r15), %edi
	callq	_dma_addressing_limited
	movq	_amdgpu_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_24
LBB0_2:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, 12(%r15)
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	28(%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_23:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_24
LBB0_4:
	movq	_amdgpu_vis_vram_limit@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	jle	LBB0_7
## %bb.5:
	shll	$20, %eax
	cmpl	32(%r15), %eax
	jg	LBB0_7
## %bb.6:
	movl	%eax, 32(%r15)
LBB0_7:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_ttm_set_buffer_funcs_status
	movq	%r15, %rdi
	callq	_amdgpu_ttm_fw_reserve_vram_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_24
## %bb.8:
	movl	40(%r15), %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AMDGPU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	48(%r15), %r8
	leaq	-64(%rbp), %rax
	movq	%rax, (%rsp)
	movq	%r15, %rdi
	xorl	%r9d, %r9d
	callq	_amdgpu_bo_create_kernel
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_9
LBB0_24:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	28(%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	_amdgpu_gtt_size@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	cmpl	$-1, %r12d
	je	LBB0_10
## %bb.11:
	shll	$20, %r12d
	jmp	LBB0_12
LBB0_10:
	leaq	-56(%rbp), %rdi
	callq	_si_meminfo
	movq	_AMDGPU_DEFAULT_GTT_SIZE_MB@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$20, %edi
	movl	36(%r15), %esi
	callq	_max
	movl	-48(%rbp), %ecx
	imull	-56(%rbp), %ecx
	leal	(%rcx,%rcx,2), %edx
	leal	(%rcx,%rcx,2), %esi
	addl	$3, %esi
	testl	%edx, %edx
	cmovnsl	%edx, %esi
	sarl	$2, %esi
	movl	%eax, %edi
	callq	_min
	movl	%eax, %r12d
LBB0_12:
	movq	_TTM_PL_TT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movb	(%r13), %cl
	movl	%r12d, %edx
	sarl	%cl, %edx
	movq	%r14, %rdi
	callq	_ttm_bo_init_mm
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_23
LBB0_14:
	leal	1048575(%r12), %esi
	testl	%r12d, %r12d
	cmovnsl	%r12d, %esi
	sarl	$20, %esi
	leaq	L_.str.4(%rip), %rdi
	callq	_DRM_INFO
	movq	_AMDGPU_PL_GDS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_ttm_bo_init_mm
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_23
LBB0_16:
	movq	_AMDGPU_PL_GWS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	movq	%r14, %rdi
	callq	_ttm_bo_init_mm
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_23
LBB0_18:
	movq	_AMDGPU_PL_OA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %edx
	movq	%r14, %rdi
	callq	_ttm_bo_init_mm
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:
	movl	%eax, %ebx
	leaq	L_.str.7(%rip), %rdi
	jmp	LBB0_23
LBB0_20:
	movq	%r15, %rdi
	callq	_amdgpu_ttm_debugfs_init
	testl	%eax, %eax
	je	LBB0_21
## %bb.22:
	movl	%eax, %ebx
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_23
LBB0_21:
	xorl	%ebx, %ebx
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_amdgpu_bo_driver,4,2           ## @amdgpu_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	_amdgpu_vis_vram_limit,8,3      ## @amdgpu_vis_vram_limit
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ## @AMDGPU_GEM_DOMAIN_VRAM
L_.str.2:                               ## @.str.2
	.asciz	"amdgpu: %uM of VRAM memory ready\n"

	.comm	_amdgpu_gtt_size,4,2            ## @amdgpu_gtt_size
	.comm	_AMDGPU_DEFAULT_GTT_SIZE_MB,4,2 ## @AMDGPU_DEFAULT_GTT_SIZE_MB
	.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	"amdgpu: %uM of GTT memory ready.\n"

	.comm	_AMDGPU_PL_GDS,4,2              ## @AMDGPU_PL_GDS
L_.str.5:                               ## @.str.5
	.asciz	"Failed initializing GDS heap.\n"

	.comm	_AMDGPU_PL_GWS,4,2              ## @AMDGPU_PL_GWS
L_.str.6:                               ## @.str.6
	.asciz	"Failed initializing gws heap.\n"

	.comm	_AMDGPU_PL_OA,4,2               ## @AMDGPU_PL_OA
L_.str.7:                               ## @.str.7
	.asciz	"Failed initializing oa heap.\n"

L_.str.8:                               ## @.str.8
	.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	_amdgpu_ttm_init                ; -- Begin function amdgpu_ttm_init
	.p2align	2
_amdgpu_ttm_init:                       ; @amdgpu_ttm_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x0, x0, #24
	bl	_mutex_init
	add	x20, x19, #16
	ldr	x8, [x19, #56]
	ldr	x8, [x8]
	ldr	w21, [x8]
	ldr	w0, [x19, #52]
	bl	_dma_addressing_limited
	mov	x3, x0
Lloh0:
	adrp	x1, _amdgpu_bo_driver@GOTPAGE
Lloh1:
	ldr	x1, [x1, _amdgpu_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:
	movi.2s	v0, #1
	stur	d0, [x19, #12]
Lloh4:
	adrp	x8, _TTM_PL_VRAM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	ldr	w8, [x19, #28]
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, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
Lloh11:
	adrp	x8, _amdgpu_vis_vram_limit@GOTPAGE
Lloh12:
	ldr	x8, [x8, _amdgpu_vis_vram_limit@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.7:
	lsl	w8, w8, #20
	ldr	w9, [x19, #32]
	cmp	w8, w9
	b.gt	LBB0_9
; %bb.8:
	str	w8, [x19, #32]
LBB0_9:
	mov	x0, x19
	mov	w1, #0
	bl	_amdgpu_ttm_set_buffer_funcs_status
	mov	x0, x19
	bl	_amdgpu_ttm_fw_reserve_vram_init
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.10:
Lloh14:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x19, #40]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x8, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	add	x4, x19, #48
	add	x6, sp, #24
	mov	x0, x19
	mov	x5, #0
	bl	_amdgpu_bo_create_kernel
	mov	x21, x0
	cbnz	w0, LBB0_5
; %bb.11:
	ldr	w8, [x19, #28]
	mov	w9, #1048575
	add	w9, w8, w9
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w1, w8, #20
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_INFO
Lloh22:
	adrp	x8, _amdgpu_gtt_size@GOTPAGE
Lloh23:
	ldr	x8, [x8, _amdgpu_gtt_size@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	cmn	w8, #1
	b.eq	LBB0_13
; %bb.12:
	lsl	w22, w8, #20
	b	LBB0_14
LBB0_13:
	add	x0, sp, #8
	bl	_si_meminfo
Lloh25:
	adrp	x8, _AMDGPU_DEFAULT_GTT_SIZE_MB@GOTPAGE
Lloh26:
	ldr	x8, [x8, _AMDGPU_DEFAULT_GTT_SIZE_MB@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	lsl	w0, w8, #20
	ldr	w1, [x19, #36]
	bl	_max
	ldr	w8, [sp, #16]
	ldr	w9, [sp, #8]
	mul	w8, w8, w9
	add	w8, w8, w8, lsl #1
	add	w9, w8, #3
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w1, w8, #2
	bl	_min
	mov	x22, x0
LBB0_14:
Lloh28:
	adrp	x8, _TTM_PL_TT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _TTM_PL_TT@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	ldr	w8, [x23]
	asr	w2, w22, w8
	mov	x0, x20
	bl	_ttm_bo_init_mm
	cbz	w0, LBB0_16
; %bb.15:
	mov	x21, x0
Lloh31:
	adrp	x0, l_.str.3@PAGE
Lloh32:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_16:
	mov	w8, #1048575
	add	w8, w22, w8
	cmp	w22, #0
	csel	w8, w8, w22, lt
	asr	w1, w8, #20
Lloh33:
	adrp	x0, l_.str.4@PAGE
Lloh34:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_INFO
Lloh35:
	adrp	x8, _AMDGPU_PL_GDS@GOTPAGE
Lloh36:
	ldr	x8, [x8, _AMDGPU_PL_GDS@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	ldr	w2, [x19]
	mov	x0, x20
	bl	_ttm_bo_init_mm
	cbz	w0, LBB0_18
; %bb.17:
	mov	x21, x0
Lloh38:
	adrp	x0, l_.str.5@PAGE
Lloh39:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_4
LBB0_18:
Lloh40:
	adrp	x8, _AMDGPU_PL_GWS@GOTPAGE
Lloh41:
	ldr	x8, [x8, _AMDGPU_PL_GWS@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
	mov	x0, x20
	bl	_ttm_bo_init_mm
	cbz	w0, LBB0_20
; %bb.19:
	mov	x21, x0
Lloh43:
	adrp	x0, l_.str.6@PAGE
Lloh44:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_4
LBB0_20:
Lloh45:
	adrp	x8, _AMDGPU_PL_OA@GOTPAGE
Lloh46:
	ldr	x8, [x8, _AMDGPU_PL_OA@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
	ldr	w2, [x19, #8]
	mov	x0, x20
	bl	_ttm_bo_init_mm
	cbz	w0, LBB0_22
; %bb.21:
	mov	x21, x0
Lloh48:
	adrp	x0, l_.str.7@PAGE
Lloh49:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_4
LBB0_22:
	mov	x0, x19
	bl	_amdgpu_ttm_debugfs_init
	mov	x21, x0
	cbz	w0, LBB0_5
; %bb.23:
Lloh50:
	adrp	x0, l_.str.8@PAGE
Lloh51:
	add	x0, x0, l_.str.8@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 AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_amdgpu_bo_driver,4,2           ; @amdgpu_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	_amdgpu_vis_vram_limit,8,3      ; @amdgpu_vis_vram_limit
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ; @AMDGPU_GEM_DOMAIN_VRAM
l_.str.2:                               ; @.str.2
	.asciz	"amdgpu: %uM of VRAM memory ready\n"

	.comm	_amdgpu_gtt_size,4,2            ; @amdgpu_gtt_size
	.comm	_AMDGPU_DEFAULT_GTT_SIZE_MB,4,2 ; @AMDGPU_DEFAULT_GTT_SIZE_MB
	.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	"amdgpu: %uM of GTT memory ready.\n"

	.comm	_AMDGPU_PL_GDS,4,2              ; @AMDGPU_PL_GDS
l_.str.5:                               ; @.str.5
	.asciz	"Failed initializing GDS heap.\n"

	.comm	_AMDGPU_PL_GWS,4,2              ; @AMDGPU_PL_GWS
l_.str.6:                               ; @.str.6
	.asciz	"Failed initializing gws heap.\n"

	.comm	_AMDGPU_PL_OA,4,2               ; @AMDGPU_PL_OA
l_.str.7:                               ; @.str.7
	.asciz	"Failed initializing oa heap.\n"

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

.subsections_via_symbols
