	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cik_mec_init
_cik_mec_init:                          ## @cik_mec_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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	_CHIP_KAVERI@GOTPCREL(%rip), %rax
	movq	(%rdi), %rcx
	movq	24(%rdi), %rdi
	xorl	%esi, %esi
	cmpq	(%rax), %rcx
	sete	%sil
	incl	%esi
	movl	%esi, 8(%rbx)
	movl	$4, 12(%rbx)
	movl	%esi, %eax
	shll	$5, %eax
	movl	%eax, 16(%rbx)
	leaq	24(%rbx), %r15
	testq	%rdi, %rdi
	je	LBB0_1
LBB0_3:
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	movl	%eax, %r14d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:
	movq	24(%rbx), %rdi
	movq	_RADEON_GEM_DOMAIN_GTT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	32(%rbx), %rdx
	callq	_radeon_bo_pin
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %r14d
	movl	40(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_1:
	movq	_MEC_HPD_SIZE@GOTPCREL(%rip), %rax
	imull	(%rax), %esi
	shll	$3, %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_RADEON_GEM_DOMAIN_GTT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r15, 16(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movq	%rbx, %rdi
	movl	$1, %ecx
	xorl	%r9d, %r9d
	callq	_radeon_bo_create
	testl	%eax, %eax
	je	LBB0_2
## %bb.12:
	movl	%eax, %r14d
	movl	40(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	jmp	LBB0_11
LBB0_2:
	movq	(%r15), %rdi
	jmp	LBB0_3
LBB0_8:
	movq	(%r15), %rdi
	leaq	-32(%rbp), %rsi
	callq	_radeon_bo_kmap
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r14d
	movl	40(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_7:
	movl	%r14d, %edx
	callq	_dev_warn
LBB0_4:
	movq	%rbx, %rdi
	callq	_cik_mec_fini
LBB0_11:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	-32(%rbp), %rdi
	movl	8(%rbx), %edx
	imull	12(%rbx), %edx
	movq	_MEC_HPD_SIZE@GOTPCREL(%rip), %rax
	imull	(%rax), %edx
	addl	%edx, %edx
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_memset
	movq	24(%rbx), %rdi
	callq	_radeon_bo_kunmap
	movq	24(%rbx), %rdi
	callq	_radeon_bo_unreserve
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_KAVERI,8,3                ## @CHIP_KAVERI
	.comm	_MEC_HPD_SIZE,4,2               ## @MEC_HPD_SIZE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_RADEON_GEM_DOMAIN_GTT,4,2      ## @RADEON_GEM_DOMAIN_GTT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%d) create HDP EOP bo failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"(%d) pin HDP EOP bo failed\n"

L_.str.2:                               ## @.str.2
	.asciz	"(%d) map HDP EOP bo failed\n"

	.no_dead_strip	_cik_mec_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cik_mec_init
_cik_mec_init:                          ; @cik_mec_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _CHIP_KAVERI@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_KAVERI@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #1
	cinc	w8, w8, eq
	mov	w9, #4
	stp	w8, w9, [x0, #8]
	lsl	w9, w8, #5
	str	w9, [x0, #16]
	mov	x21, x0
	ldr	x0, [x21, #24]!
	cbz	x0, LBB0_4
LBB0_1:
	mov	w1, #0
	bl	_radeon_bo_reserve
	mov	x20, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_10
; %bb.2:
	ldr	x0, [x19, #24]
Lloh3:
	adrp	x8, _RADEON_GEM_DOMAIN_GTT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RADEON_GEM_DOMAIN_GTT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, x19, #32
	bl	_radeon_bo_pin
	cbz	w0, LBB0_7
; %bb.3:
	mov	x20, x0
	ldr	w0, [x19, #40]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_4:
Lloh8:
	adrp	x9, _MEC_HPD_SIZE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MEC_HPD_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	mul	w8, w8, w9
	lsl	w1, w8, #3
Lloh11:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x8, _RADEON_GEM_DOMAIN_GTT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _RADEON_GEM_DOMAIN_GTT@GOTPAGEOFF]
Lloh16:
	ldr	w4, [x8]
	str	x21, [sp]
	mov	x0, x19
	mov	w3, #1
	mov	w5, #0
	mov	x6, #0
	mov	x7, #0
	bl	_radeon_bo_create
	cbz	w0, LBB0_6
; %bb.5:
	mov	x20, x0
	ldr	w0, [x19, #40]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_warn
	b	LBB0_11
LBB0_6:
	ldr	x0, [x21]
	b	LBB0_1
LBB0_7:
	ldr	x0, [x21]
	add	x1, sp, #8
	bl	_radeon_bo_kmap
	mov	x20, x0
	cbz	w0, LBB0_12
; %bb.8:
	ldr	w0, [x19, #40]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x2, x20
	bl	_dev_warn
LBB0_10:
	mov	x0, x19
	bl	_cik_mec_fini
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_12:
	ldr	x0, [sp, #8]
	ldp	w8, w9, [x19, #8]
Lloh21:
	adrp	x10, _MEC_HPD_SIZE@GOTPAGE
Lloh22:
	ldr	x10, [x10, _MEC_HPD_SIZE@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	mul	w8, w8, w9
	mul	w8, w8, w10
	lsl	w2, w8, #1
	mov	w1, #0
	bl	_memset
	ldr	x0, [x19, #24]
	bl	_radeon_bo_kunmap
	ldr	x0, [x19, #24]
	bl	_radeon_bo_unreserve
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_KAVERI,8,3                ; @CHIP_KAVERI
	.comm	_MEC_HPD_SIZE,4,2               ; @MEC_HPD_SIZE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_RADEON_GEM_DOMAIN_GTT,4,2      ; @RADEON_GEM_DOMAIN_GTT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%d) create HDP EOP bo failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"(%d) pin HDP EOP bo failed\n"

l_.str.2:                               ; @.str.2
	.asciz	"(%d) map HDP EOP bo failed\n"

	.no_dead_strip	_cik_mec_init
.subsections_via_symbols
