	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ctx_get_entity          ## -- Begin function amdgpu_ctx_get_entity
	.p2align	4, 0x90
_amdgpu_ctx_get_entity:                 ## @amdgpu_ctx_get_entity
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_AMDGPU_HW_IP_NUM@GOTPCREL(%rip), %rax
	cmpq	%rsi, (%rax)
	jle	LBB0_3
## %bb.1:
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%rdx, %rsi
	xorl	%eax, %eax
	callq	_DRM_DEBUG
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_8
LBB0_4:
	movq	_amdgpu_ctx_num_entities@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rcx, (%rax,%rsi,8)
	jle	LBB0_6
## %bb.5:
	movq	(%rdi), %rax
	shlq	$2, %rcx
	addq	(%rax,%rsi,8), %rcx
	movq	%rcx, (%r8)
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%rcx, %rdx
	xorl	%eax, %eax
	callq	_DRM_DEBUG
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_8:
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_HW_IP_NUM,8,3           ## @AMDGPU_HW_IP_NUM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown HW IP type: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"invalid ip instance: %d\n"

	.comm	_amdgpu_ctx_num_entities,8,3    ## @amdgpu_ctx_num_entities
L_.str.2:                               ## @.str.2
	.asciz	"invalid ring: %d %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_ctx_get_entity          ; -- Begin function amdgpu_ctx_get_entity
	.p2align	2
_amdgpu_ctx_get_entity:                 ; @amdgpu_ctx_get_entity
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.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
Lloh0:
	adrp	x9, _AMDGPU_HW_IP_NUM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMDGPU_HW_IP_NUM@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x9, x1
	b.le	LBB0_3
; %bb.1:
	cbz	x2, LBB0_4
; %bb.2:
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x2
	b	LBB0_7
LBB0_3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_8
LBB0_4:
Lloh7:
	adrp	x9, _amdgpu_ctx_num_entities@GOTPAGE
Lloh8:
	ldr	x9, [x9, _amdgpu_ctx_num_entities@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	ldr	x9, [x9, x1, lsl #3]
	cmp	x9, x3
	b.le	LBB0_6
; %bb.5:
	mov	x8, x0
	mov	w0, #0
	ldr	x8, [x8]
	ldr	x8, [x8, x1, lsl #3]
	add	x8, x8, x3, lsl #2
	str	x8, [x4]
	b	LBB0_9
LBB0_6:
	str	x3, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_7:
	bl	_DRM_DEBUG
LBB0_8:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_HW_IP_NUM,8,3           ; @AMDGPU_HW_IP_NUM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown HW IP type: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"invalid ip instance: %d\n"

	.comm	_amdgpu_ctx_num_entities,8,3    ; @amdgpu_ctx_num_entities
l_.str.2:                               ; @.str.2
	.asciz	"invalid ring: %d %d\n"

.subsections_via_symbols
