	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v7_0_mec_init
_gfx_v7_0_mec_init:                     ## @gfx_v7_0_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	16(%rdi), %edi
	movq	_AMDGPU_MAX_COMPUTE_QUEUES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bitmap_zero
	movq	%rbx, %rdi
	callq	_amdgpu_gfx_compute_queue_acquire
	movl	(%rbx), %eax
	movq	_GFX7_MEC_HPD_SIZE@GOTPCREL(%rip), %rcx
	imull	4(%rbx), %eax
	imull	(%rcx), %eax
	addl	%eax, %eax
	movslq	%eax, %r12
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AMDGPU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	8(%rbx), %r15
	leaq	12(%rbx), %r9
	leaq	-40(%rbp), %rax
	movq	%rax, (%rsp)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movq	%r15, %r8
	callq	_amdgpu_bo_create_reserved
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	20(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_warn
	movq	%rbx, %rdi
	callq	_gfx_v7_0_mec_fini
	jmp	LBB0_3
LBB0_2:
	movq	-40(%rbp), %rdi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_memset
	movl	(%r15), %edi
	callq	_amdgpu_bo_kunmap
	movl	(%r15), %edi
	callq	_amdgpu_bo_unreserve
LBB0_3:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_MAX_COMPUTE_QUEUES,4,2  ## @AMDGPU_MAX_COMPUTE_QUEUES
	.comm	_GFX7_MEC_HPD_SIZE,4,2          ## @GFX7_MEC_HPD_SIZE
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ## @AMDGPU_GEM_DOMAIN_VRAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%d) create, pin or map of HDP EOP bo failed\n"

	.no_dead_strip	_gfx_v7_0_mec_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v7_0_mec_init
_gfx_v7_0_mec_init:                     ; @gfx_v7_0_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	w0, [x0, #16]
Lloh0:
	adrp	x8, _AMDGPU_MAX_COMPUTE_QUEUES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_MAX_COMPUTE_QUEUES@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_bitmap_zero
	mov	x0, x19
	bl	_amdgpu_gfx_compute_queue_acquire
	ldp	w8, w9, [x19]
Lloh3:
	adrp	x10, _GFX7_MEC_HPD_SIZE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _GFX7_MEC_HPD_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	mul	w8, w8, w9
	mul	w8, w8, w10
	lsl	w8, w8, #1
	sxtw	x22, w8
Lloh6:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	add	x21, x19, #8
	add	x5, x19, #12
	add	x6, sp, #8
	mov	x0, x19
	mov	x1, x22
	mov	x4, x21
	bl	_amdgpu_bo_create_reserved
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #20]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_warn
	mov	x0, x19
	bl	_gfx_v7_0_mec_fini
	b	LBB0_3
LBB0_2:
	ldr	x0, [sp, #8]
	mov	w1, #0
	mov	x2, x22
	bl	_memset
	ldr	w0, [x21]
	bl	_amdgpu_bo_kunmap
	ldr	w0, [x21]
	bl	_amdgpu_bo_unreserve
LBB0_3:
	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
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_MAX_COMPUTE_QUEUES,4,2  ; @AMDGPU_MAX_COMPUTE_QUEUES
	.comm	_GFX7_MEC_HPD_SIZE,4,2          ; @GFX7_MEC_HPD_SIZE
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ; @AMDGPU_GEM_DOMAIN_VRAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%d) create, pin or map of HDP EOP bo failed\n"

	.no_dead_strip	_gfx_v7_0_mec_init
.subsections_via_symbols
