	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_register_gpu_instance   ## -- Begin function amdgpu_register_gpu_instance
	.p2align	4, 0x90
_amdgpu_register_gpu_instance:          ## @amdgpu_register_gpu_instance
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_mgpu_info@GOTPCREL(%rip), %r15
	leaq	8(%r15), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	(%r15), %rax
	movq	_MAX_GPU_INSTANCE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jae	LBB0_1
## %bb.2:
	movq	24(%r15), %rcx
	movq	%rax, %rdx
	shlq	$4, %rdx
	movq	%r14, 8(%rcx,%rdx)
	movq	$0, (%rcx,%rdx)
	incq	%rax
	movq	%rax, (%r15)
	movq	_AMD_IS_APU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_4
## %bb.3:
	incl	16(%r15)
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_5
LBB0_4:
	incl	12(%r15)
LBB0_5:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_mgpu_info,32,3                 ## @mgpu_info
	.comm	_MAX_GPU_INSTANCE,8,3           ## @MAX_GPU_INSTANCE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot register more gpu instance\n"

	.comm	_AMD_IS_APU,4,2                 ## @AMD_IS_APU
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_register_gpu_instance   ; -- Begin function amdgpu_register_gpu_instance
	.p2align	2
_amdgpu_register_gpu_instance:          ; @amdgpu_register_gpu_instance
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x20, _mgpu_info@GOTPAGE
Lloh1:
	ldr	x20, [x20, _mgpu_info@GOTPAGEOFF]
	add	x0, x20, #8
	bl	_mutex_lock
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _MAX_GPU_INSTANCE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MAX_GPU_INSTANCE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.hs	LBB0_3
; %bb.1:
	ldr	x9, [x20, #24]
	add	x9, x9, x8, lsl #4
	stp	xzr, x19, [x9]
	add	x8, x8, #1
	str	x8, [x20]
	ldr	w8, [x19]
Lloh5:
	adrp	x9, _AMD_IS_APU@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AMD_IS_APU@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
	ldr	w8, [x20, #16]
	add	w8, w8, #1
	str	w8, [x20, #16]
	b	LBB0_5
LBB0_3:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_5
LBB0_4:
	ldr	w8, [x20, #12]
	add	w8, w8, #1
	str	w8, [x20, #12]
LBB0_5:
	add	x0, x20, #8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_mgpu_info,32,3                 ; @mgpu_info
	.comm	_MAX_GPU_INSTANCE,8,3           ; @MAX_GPU_INSTANCE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot register more gpu instance\n"

	.comm	_AMD_IS_APU,4,2                 ; @AMD_IS_APU
.subsections_via_symbols
