	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_device_init      ## -- Begin function amdgpu_amdkfd_device_init
	.p2align	4, 0x90
_amdgpu_amdkfd_device_init:             ## @amdgpu_amdkfd_device_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 8(%rdi)
	je	LBB0_9
## %bb.1:
	movq	%rdi, %r13
	movl	32(%rdi), %eax
	movl	%eax, -88(%rbp)
	movl	36(%rdi), %eax
	movl	%eax, -84(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -80(%rbp)
	movq	$0, -64(%rbp)
	movl	24(%rdi), %eax
	movl	%eax, -56(%rbp)
	movq	72(%rdi), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movl	80(%rdi), %edi
	movq	_AMDGPU_GPU_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %edi
	movq	_AMDGPU_GMC_HOLE_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_min
	movl	%eax, -48(%rbp)
	movq	_compute_vmid_bitmap@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	40(%r13), %esi
	movq	_KGD_MAX_QUEUES@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	xorl	%edi, %edi
	callq	_bitmap_complement
	cmpq	$0, 64(%r13)
	je	LBB0_3
## %bb.2:
	movq	56(%r13), %rsi
	decq	%rsi
	movl	48(%r13), %ecx
	movl	52(%r13), %edx
	movq	%r13, %rdi
	callq	_amdgpu_gfx_mec_queue_to_bit
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_clear_bit
LBB0_3:
	leaq	-68(%rbp), %r15
	leaq	-64(%rbp), %r12
	movl	36(%r13), %ebx
	imull	32(%r13), %ebx
	cmpl	(%r14), %ebx
	jge	LBB0_6
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_clear_bit
	incl	%ebx
	cmpl	(%r14), %ebx
	jl	LBB0_4
LBB0_6:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%r15, %rdx
	leaq	-72(%rbp), %rcx
	callq	_amdgpu_doorbell_get_kfd_info
	movq	(%r13), %rax
	movq	_CHIP_VEGA10@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_8
## %bb.7:
	movl	20(%r13), %eax
	movl	%eax, -76(%rbp)
	movl	16(%r13), %eax
	movl	%eax, -80(%rbp)
LBB0_8:
	movq	8(%r13), %rdi
	leaq	-88(%rbp), %rsi
	callq	_kgd2kfd_device_init
LBB0_9:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GPU_PAGE_SHIFT,4,2      ## @AMDGPU_GPU_PAGE_SHIFT
	.comm	_AMDGPU_GMC_HOLE_START,4,2      ## @AMDGPU_GMC_HOLE_START
	.comm	_compute_vmid_bitmap,4,2        ## @compute_vmid_bitmap
	.comm	_KGD_MAX_QUEUES,4,2             ## @KGD_MAX_QUEUES
	.comm	_CHIP_VEGA10,8,3                ## @CHIP_VEGA10
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_device_init      ; -- Begin function amdgpu_amdkfd_device_init
	.p2align	2
_amdgpu_amdkfd_device_init:             ; @amdgpu_amdkfd_device_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_9
; %bb.1:
	mov	x19, x0
	ldr	d0, [x0, #32]
	str	d0, [sp]
	mov	x8, sp
	add	x20, x8, #16
	add	x21, x8, #20
	add	x22, x8, #24
	stp	xzr, xzr, [sp, #16]
	str	xzr, [sp, #8]
	ldr	w8, [x0, #24]
	str	w8, [sp, #32]
	ldr	x8, [x0, #72]
	ldr	x8, [x8]
	ldr	w8, [x8]
	str	w8, [sp, #36]
Lloh0:
	adrp	x8, _AMDGPU_GPU_PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AMDGPU_GPU_PAGE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x0, #80]
Lloh2:
	ldr	w8, [x8]
	lsl	w0, w9, w8
Lloh3:
	adrp	x8, _AMDGPU_GMC_HOLE_START@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AMDGPU_GMC_HOLE_START@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_min
Lloh6:
	adrp	x8, _compute_vmid_bitmap@GOTPAGE
Lloh7:
	ldr	x8, [x8, _compute_vmid_bitmap@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	stp	w0, w8, [sp, #40]
	ldr	w1, [x19, #40]
Lloh9:
	adrp	x24, _KGD_MAX_QUEUES@GOTPAGE
Lloh10:
	ldr	x24, [x24, _KGD_MAX_QUEUES@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	w0, #0
	bl	_bitmap_complement
	ldr	x8, [x19, #64]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	x8, [x19, #56]
	sub	x1, x8, #1
	ldp	w3, w2, [x19, #48]
	mov	x0, x19
	bl	_amdgpu_gfx_mec_queue_to_bit
	mov	w1, #0
	bl	_clear_bit
LBB0_3:
	ldp	w8, w9, [x19, #32]
	mul	w23, w9, w8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x24]
	cmp	w23, w8
	b.ge	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x23
	mov	w1, #0
	bl	_clear_bit
	add	w23, w23, #1
	b	LBB0_4
LBB0_6:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	bl	_amdgpu_doorbell_get_kfd_info
	ldr	x8, [x19]
Lloh11:
	adrp	x9, _CHIP_VEGA10@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CHIP_VEGA10@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_8
; %bb.7:
	ldr	d0, [x19, #16]
	str	d0, [sp, #8]
LBB0_8:
	ldr	x0, [x19, #8]
	mov	x1, sp
	bl	_kgd2kfd_device_init
LBB0_9:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GPU_PAGE_SHIFT,4,2      ; @AMDGPU_GPU_PAGE_SHIFT
	.comm	_AMDGPU_GMC_HOLE_START,4,2      ; @AMDGPU_GMC_HOLE_START
	.comm	_compute_vmid_bitmap,4,2        ; @compute_vmid_bitmap
	.comm	_KGD_MAX_QUEUES,4,2             ; @KGD_MAX_QUEUES
	.comm	_CHIP_VEGA10,8,3                ; @CHIP_VEGA10
.subsections_via_symbols
