	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_vce_ring_parse_cs_vm    ## -- Begin function amdgpu_vce_ring_parse_cs_vm
	.p2align	4, 0x90
_amdgpu_vce_ring_parse_cs_vm:           ## @amdgpu_vce_ring_parse_cs_vm
	.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
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rsi,4), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	$0, -56(%rbp)
	xorl	%ebx, %ebx
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rax,%rsi,4)
	jle	LBB0_1
## %bb.2:
	movl	$-1, %edx
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %eax
	movq	%r15, %rdx
	movl	%edx, %ecx
	shll	%cl, %eax
	cltq
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	orq	%rax, %r15
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$-1, %edx
	je	LBB0_17
LBB0_18:                                ##   in Loop: Header=BB0_3 Depth=1
	shrq	$2, %r14
	addl	%r14d, %ebx
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %ebx
	jge	LBB0_19
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_amdgpu_get_ib_value
	movq	%rax, %r14
	leal	1(%rbx), %edx
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_amdgpu_get_ib_value
	cmpq	$8, %r14
	jb	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %ecx
	andl	$3, %ecx
	testq	%rcx, %rcx
	jne	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$33554433, %rax                 ## imm = 0x2000001
	je	LBB0_15
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$16777217, %rax                 ## imm = 0x1000001
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$1, %rax
	jne	LBB0_9
## %bb.25:                              ##   in Loop: Header=BB0_3 Depth=1
	leal	2(%rbx), %edx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_amdgpu_get_ib_value
	movq	%r15, %rdi
	movq	%rax, %rsi
	leaq	-56(%rbp), %rdx
	callq	_amdgpu_vce_validate_handle
	movl	%eax, %edx
	testl	%eax, %eax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jns	LBB0_18
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %eax
	movq	%r15, %rdx
	movl	%edx, %ecx
	shll	%cl, %eax
	cltq
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	orq	%rax, %rcx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testq	%rax, %r15
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %ecx
	notl	%ecx
	movslq	%ecx, %rcx
	andq	%rcx, %r15
	orq	%rax, -56(%rbp)
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	testq	%rax, -56(%rbp)
	jne	LBB0_16
## %bb.13:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_14
LBB0_1:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	jmp	LBB0_20
LBB0_5:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_22
LBB0_19:
	movq	-56(%rbp), %rbx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
LBB0_20:
	notq	%rax
	testq	%rax, %rbx
	je	LBB0_24
## %bb.21:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_17:
	leaq	L_.str.2(%rip), %rdi
LBB0_14:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_22:
	movl	(%rax), %edx
	testl	%edx, %edx
	je	LBB0_24
## %bb.23:
	negl	%edx
LBB0_26:
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r15
	jmp	LBB0_27
LBB0_24:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	callq	_amdgpu_ib_free
LBB0_27:
	movq	_AMDGPU_MAX_VCE_HANDLES@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_32
## %bb.28:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_29 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	addq	$4, %r13
	cmpq	%rcx, %rbx
	jge	LBB0_32
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movl	$1, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	movslq	%edx, %rcx
	testq	%rcx, %r15
	je	LBB0_31
## %bb.30:                              ##   in Loop: Header=BB0_29 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %rdi
	addq	%r13, %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	movl	(%r14), %eax
	jmp	LBB0_31
LBB0_32:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
                                        ## kill: def $eax killed $eax killed $rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid VCE command length (%d)!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Handle already in use!\n"

L_.str.2:                               ## @.str.2
	.asciz	"no session command at start of IB\n"

L_.str.3:                               ## @.str.3
	.asciz	"New session without create command!\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_AMDGPU_MAX_VCE_HANDLES,4,2     ## @AMDGPU_MAX_VCE_HANDLES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_vce_ring_parse_cs_vm    ; -- Begin function amdgpu_vce_ring_parse_cs_vm
	.p2align	2
_amdgpu_vce_ring_parse_cs_vm:           ; @amdgpu_vce_ring_parse_cs_vm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	add	x20, x8, x1, lsl #2
	str	xzr, [sp, #8]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_15
; %bb.1:
	mov	x22, x1
	mov	w23, #0
	mov	x26, #0
	mov	x25, #0
	mov	w21, #-1
	mov	w27, #1
	movk	w27, #512, lsl #16
	mov	w28, #1
	movk	w28, #256, lsl #16
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #1
	lsl	w8, w8, w21
	sxtw	x8, w8
	orr	x25, x25, x8
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmn	w21, #1
	b.eq	LBB0_20
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	lsr	x8, x24, #2
	ldr	w9, [x20]
	add	w23, w23, w8
	cmp	w23, w9
	b.ge	LBB0_17
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_amdgpu_get_ib_value
	mov	x24, x0
	add	w2, w23, #1
	mov	x0, x19
	mov	x1, x22
	bl	_amdgpu_get_ib_value
	cmp	x24, #8
	b.lo	LBB0_16
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	and	x8, x24, #0x3
	cbnz	x8, LBB0_16
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x0, x27
	b.eq	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x0, x28
	b.eq	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x0, #1
	b.ne	LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	add	w2, w23, #2
	mov	x0, x19
	mov	x1, x22
	bl	_amdgpu_get_ib_value
	mov	x1, x0
	add	x2, sp, #8
	mov	x0, x19
	bl	_amdgpu_vce_validate_handle
	mov	x21, x0
	tbz	w0, #31, LBB0_4
	b	LBB0_23
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w8, #1
	lsl	w8, w8, w21
	sxtw	x8, w8
	orr	x26, x26, x8
	tst	x25, x8
	b.eq	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	mvn	w9, w8
	sxtw	x9, w9
	and	x25, x25, x9
	ldr	x9, [sp, #8]
	orr	x8, x9, x8
	str	x8, [sp, #8]
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [sp, #8]
	tst	x9, x8
	b.ne	LBB0_3
; %bb.14:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_21
LBB0_15:
	mov	x8, #0
	mov	x25, #0
	mov	x26, #0
	bics	xzr, x8, x26
	b.ne	LBB0_18
	b	LBB0_19
LBB0_16:
	str	x24, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_21
LBB0_17:
	ldr	x8, [sp, #8]
	bics	xzr, x8, x26
	b.eq	LBB0_19
LBB0_18:
Lloh4:
	adrp	x0, l_.str.3@PAGE
Lloh5:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
Lloh6:
	adrp	x8, _ENOENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cbnz	w8, LBB0_22
LBB0_19:
	ldr	x0, [x19]
	mov	x1, x20
	mov	x2, #0
	bl	_amdgpu_ib_free
	mov	w21, #0
	b	LBB0_24
LBB0_20:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_21:
	bl	_DRM_ERROR
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cbz	w8, LBB0_19
LBB0_22:
	neg	w21, w8
LBB0_23:
	ldr	x25, [sp, #8]
LBB0_24:
Lloh14:
	adrp	x20, _AMDGPU_MAX_VCE_HANDLES@GOTPAGE
Lloh15:
	ldr	x20, [x20, _AMDGPU_MAX_VCE_HANDLES@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_29
; %bb.25:
	mov	x22, #0
	mov	x23, #0
	mov	w24, #1
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_27 Depth=1
	add	x23, x23, #1
	add	x22, x22, #4
	cmp	x23, w8, sxtw
	b.ge	LBB0_29
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	lsl	w9, w24, w23
	sxtw	x9, w9
	tst	x25, x9
	b.eq	LBB0_26
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=1
	ldr	x8, [x19]
	ldr	x8, [x8]
	add	x0, x8, x22
	mov	w1, #0
	bl	_atomic_set
	ldr	w8, [x20]
	b	LBB0_26
LBB0_29:
	mov	x0, x21
	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
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid VCE command length (%d)!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Handle already in use!\n"

l_.str.2:                               ; @.str.2
	.asciz	"no session command at start of IB\n"

l_.str.3:                               ; @.str.3
	.asciz	"New session without create command!\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_AMDGPU_MAX_VCE_HANDLES,4,2     ; @AMDGPU_MAX_VCE_HANDLES
.subsections_via_symbols
