	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_vce_ring_parse_cs       ## -- Begin function amdgpu_vce_ring_parse_cs
	.p2align	4, 0x90
_amdgpu_vce_ring_parse_cs:              ## @amdgpu_vce_ring_parse_cs
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movq	8(%rax), %r15
	movq	$0, -88(%rbp)
	movq	$0, (%rax)
	leaq	(%rsi,%rsi,2), %rbx
	movl	4(%r15,%rbx,4), %edi
	callq	_amdgpu_sa_bo_gpu_addr
	movl	%eax, 8(%r15,%rbx,4)
	xorl	%eax, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r15,%rbx,4)
	je	LBB0_54
## %bb.1:
	leaq	(%r15,%rbx,4), %rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movl	$0, -60(%rbp)                   ## 4-byte Folded Spill
	xorl	%ebx, %ebx
                                        ## implicit-def: $r12
	jmp	LBB0_6
LBB0_2:                                 ##   in Loop: Header=BB0_6 Depth=1
	leal	3(%rbx), %edx
	leal	2(%rbx), %ecx
LBB0_3:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
LBB0_4:                                 ##   in Loop: Header=BB0_6 Depth=1
	callq	_amdgpu_vce_validate_bo
	testl	%eax, %eax
	jne	LBB0_51
LBB0_5:                                 ##   in Loop: Header=BB0_6 Depth=1
	sarl	$2, %r15d
	addl	%r15d, %ebx
	movq	-120(%rbp), %rax                ## 8-byte Reload
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	jae	LBB0_20
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_amdgpu_get_ib_value
	movl	%eax, %r15d
	leal	1(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
	cmpl	$8, %r15d
	jb	LBB0_19
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%r15d, %ecx
	andl	$3, %ecx
	testq	%rcx, %rcx
	jne	LBB0_19
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	cltq
	leaq	-83886081(%rax), %rcx
	cmpq	$12, %rcx
	ja	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rax
	addq	%rdx, %rax
	jmpq	*%rax
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	leal	4(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
	movslq	%eax, %r12
	leal	3(%rbx), %edx
	leal	2(%rbx), %ecx
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%r12d, %r8d
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$50331649, %rax                 ## imm = 0x3000001
	je	LBB0_17
## %bb.12:                              ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$2, %rax
	jne	LBB0_5
## %bb.13:                              ##   in Loop: Header=BB0_6 Depth=1
	leal	6(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leal	7(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	jmp	LBB0_5
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	leal	3(%rbx), %edx
	leal	2(%rbx), %ecx
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	$4096, %r8d                     ## imm = 0x1000
	movq	-80(%rbp), %r9                  ## 8-byte Reload
                                        ## kill: def $r9d killed $r9d killed $r9
	jmp	LBB0_4
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=1
	leal	3(%rbx), %edx
	leal	2(%rbx), %ecx
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_amdgpu_vce_validate_bo
	testl	%eax, %eax
	jne	LBB0_51
## %bb.16:                              ##   in Loop: Header=BB0_6 Depth=1
	leal	8(%rbx), %edx
	leal	7(%rbx), %ecx
	jmp	LBB0_3
LBB0_17:                                ##   in Loop: Header=BB0_6 Depth=1
	leal	10(%rbx), %edx
	leal	9(%rbx), %ecx
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_amdgpu_vce_validate_bo
	testl	%eax, %eax
	jne	LBB0_51
## %bb.18:                              ##   in Loop: Header=BB0_6 Depth=1
	leal	12(%rbx), %edx
	leal	11(%rbx), %ecx
	jmp	LBB0_3
LBB0_19:
	movslq	%r15d, %rsi
	movq	%r12, -112(%rbp)
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	xorl	%esi, %esi
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_57
LBB0_20:
	xorl	%edx, %edx
	movq	%r12, -112(%rbp)
	testl	%eax, %eax
	je	LBB0_53
## %bb.21:
	leaq	-112(%rbp), %rsi
	movl	$-1, -44(%rbp)                  ## 4-byte Folded Spill
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%rdx, %rbx
	callq	_amdgpu_get_ib_value
	movl	%eax, %r12d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leal	1(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
	movslq	%eax, %rsi
	cmpq	$83886080, %rsi                 ## imm = 0x5000000
	jg	LBB0_31
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	cmpq	$33554432, %rsi                 ## imm = 0x2000000
	jle	LBB0_33
## %bb.24:                              ##   in Loop: Header=BB0_22 Depth=1
	leaq	-67108865(%rsi), %rax
	cmpq	$8, %rax
	ja	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	$467, %ecx                      ## imm = 0x1D3
	btq	%rax, %rcx
	jb	LBB0_47
LBB0_26:                                ##   in Loop: Header=BB0_22 Depth=1
	cmpq	$33554433, %rsi                 ## imm = 0x2000001
	je	LBB0_44
## %bb.27:                              ##   in Loop: Header=BB0_22 Depth=1
	cmpq	$50331649, %rsi                 ## imm = 0x3000001
	jne	LBB0_70
## %bb.28:                              ##   in Loop: Header=BB0_22 Depth=1
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	leal	10(%r15), %edx
	leal	9(%r15), %ecx
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	(%rbx), %r8
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%r9d, %r9d
	callq	_amdgpu_vce_cs_reloc
	testl	%eax, %eax
	jne	LBB0_74
## %bb.29:                              ##   in Loop: Header=BB0_22 Depth=1
	leal	12(%r15), %r8d
	leal	11(%r15), %ecx
	movabsq	$-6148914691236517205, %rax     ## imm = 0xAAAAAAAAAAAAAAAB
	mulq	(%rbx)
	movq	%rdx, %rax
	shrq	%rax
	jmp	LBB0_30
	.p2align	4, 0x90
LBB0_31:                                ##   in Loop: Header=BB0_22 Depth=1
	leaq	-83886081(%rsi), %rax
	cmpq	$12, %rax
	ja	LBB0_70
## %bb.32:                              ##   in Loop: Header=BB0_22 Depth=1
	leaq	LJTI0_1(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_69:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	3(%rax), %edx
	leal	2(%rax), %ecx
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %r8
	addq	%r8, %r8
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%r9d, %r9d
	jmp	LBB0_73
	.p2align	4, 0x90
LBB0_33:                                ##   in Loop: Header=BB0_22 Depth=1
	cmpq	$1, %rsi
	je	LBB0_38
## %bb.34:                              ##   in Loop: Header=BB0_22 Depth=1
	cmpq	$2, %rsi
	je	LBB0_40
## %bb.35:                              ##   in Loop: Header=BB0_22 Depth=1
	cmpq	$16777217, %rsi                 ## imm = 0x1000001
	jne	LBB0_70
## %bb.36:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	$1, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	cltq
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	testq	%rax, %rdx
	je	LBB0_45
## %bb.37:                              ##   in Loop: Header=BB0_22 Depth=1
	movl	%eax, %ecx
	notl	%ecx
	movslq	%ecx, %rcx
	andq	%rcx, %rdx
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	orq	%rax, -88(%rbp)
	jmp	LBB0_46
LBB0_38:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	2(%rax), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
	movslq	%eax, %rsi
	movq	%r13, %rdi
	leaq	-88(%rbp), %rdx
	callq	_amdgpu_vce_validate_handle
	testl	%eax, %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	js	LBB0_52
## %bb.39:                              ##   in Loop: Header=BB0_22 Depth=1
	movq	(%r13), %rcx
	movl	%eax, %esi
	shlq	$3, %rsi
	addq	(%rcx), %rsi
	jmp	LBB0_49
LBB0_40:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leal	6(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leal	7(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	jmp	LBB0_47
LBB0_71:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leal	4(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
	movslq	%eax, %r8
	movq	%r8, -112(%rbp)
	leal	3(%rbx), %edx
	leal	2(%rbx), %ecx
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	-60(%rbp), %r9d                 ## 4-byte Reload
	jmp	LBB0_73
LBB0_72:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	3(%rax), %edx
	leal	2(%rax), %ecx
	movl	$4096, %r8d                     ## imm = 0x1000
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	-80(%rbp), %r9                  ## 8-byte Reload
                                        ## kill: def $r9d killed $r9d killed $r9
LBB0_73:                                ##   in Loop: Header=BB0_22 Depth=1
	callq	_amdgpu_vce_cs_reloc
	testl	%eax, %eax
	je	LBB0_47
	jmp	LBB0_74
LBB0_41:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	(%r13), %rax
	cmpl	$130, 16(%rax)
	je	LBB0_47
	jmp	LBB0_68
LBB0_42:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	leal	3(%r15), %edx
	leal	2(%r15), %ecx
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	movq	(%rbx), %r8
	movq	%r13, %rdi
	movq	%r14, %rsi
	xorl	%r9d, %r9d
	callq	_amdgpu_vce_cs_reloc
	testl	%eax, %eax
	jne	LBB0_74
## %bb.43:                              ##   in Loop: Header=BB0_22 Depth=1
	leal	8(%r15), %r8d
	leal	7(%r15), %ecx
	movabsq	$-6148914691236517205, %rax     ## imm = 0xAAAAAAAAAAAAAAAB
	mulq	(%rbx)
	movq	%rdx, %rax
	shrq	$3, %rax
LBB0_30:                                ##   in Loop: Header=BB0_22 Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%r8d, %edx
	movq	%rax, %r8
	xorl	%r9d, %r9d
	callq	_amdgpu_vce_cs_reloc
	testl	%eax, %eax
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_47
	jmp	LBB0_74
LBB0_44:                                ##   in Loop: Header=BB0_22 Depth=1
	movl	$1, %eax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	cltq
	orq	%rax, -72(%rbp)                 ## 8-byte Folded Spill
	jmp	LBB0_47
LBB0_45:                                ##   in Loop: Header=BB0_22 Depth=1
	testq	%rax, -88(%rbp)
	je	LBB0_75
LBB0_46:                                ##   in Loop: Header=BB0_22 Depth=1
	orq	%rax, %r15
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leal	8(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
	movl	%eax, -96(%rbp)                 ## 4-byte Spill
	leal	10(%rbx), %edx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_amdgpu_get_ib_value
                                        ## kill: def $eax killed $eax def $rax
	imull	-96(%rbp), %eax                 ## 4-byte Folded Reload
	shll	$2, %eax
	leal	(%rax,%rax,2), %eax
	cltq
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movq	%rax, (%rcx)
	.p2align	4, 0x90
LBB0_47:                                ##   in Loop: Header=BB0_22 Depth=1
	cmpl	$-1, -44(%rbp)                  ## 4-byte Folded Reload
	je	LBB0_66
## %bb.48:                              ##   in Loop: Header=BB0_22 Depth=1
	movq	-104(%rbp), %rsi                ## 8-byte Reload
LBB0_49:                                ##   in Loop: Header=BB0_22 Depth=1
	sarl	$2, %r12d
	addl	-56(%rbp), %r12d                ## 4-byte Folded Reload
	movl	%r12d, %edx
	movq	-120(%rbp), %rax                ## 8-byte Reload
	cmpl	(%rax), %r12d
	jb	LBB0_22
## %bb.50:
	movq	-88(%rbp), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_55
LBB0_51:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r12, -112(%rbp)
LBB0_52:
	movq	-88(%rbp), %rsi
	jmp	LBB0_60
LBB0_53:
	xorl	%eax, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
LBB0_54:
	xorl	%esi, %esi
	xorl	%r15d, %r15d
LBB0_55:
	notq	%r15
	testq	%r15, -80(%rbp)                 ## 8-byte Folded Reload
	je	LBB0_59
## %bb.56:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsi, %rbx
	callq	_DRM_ERROR
	movq	%rbx, %rsi
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_57:
	movl	(%rax), %eax
	testl	%eax, %eax
	je	LBB0_59
## %bb.58:
	negl	%eax
LBB0_74:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-88(%rbp), %rsi
	jmp	LBB0_60
LBB0_59:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_60:
	movq	_AMDGPU_MAX_VCE_HANDLES@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	testl	%eax, %eax
	jle	LBB0_65
## %bb.61:
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_63
	.p2align	4, 0x90
LBB0_62:                                ##   in Loop: Header=BB0_63 Depth=1
	incq	%rbx
	movslq	%eax, %rcx
	addq	$4, %r15
	cmpq	%rcx, %rbx
	jge	LBB0_65
LBB0_63:                                ## =>This Inner Loop Header: Depth=1
	movl	$1, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	movslq	%edx, %rcx
	testq	%rcx, %rsi
	je	LBB0_62
## %bb.64:                              ##   in Loop: Header=BB0_63 Depth=1
	movq	(%r13), %rax
	movq	8(%rax), %rdi
	addq	%r15, %rdi
	movq	%r13, %r12
	movq	%rsi, %r13
	xorl	%esi, %esi
	callq	_atomic_set
	movq	%r13, %rsi
	movq	%r12, %r13
	movl	(%r14), %eax
	jmp	LBB0_62
LBB0_65:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_66:
	leaq	L_.str.3(%rip), %rdi
LBB0_67:
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_68:
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_57
LBB0_70:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_68
LBB0_75:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_67
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_10
	.long	L0_0_set_14
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_5
	.long	L0_0_set_15
.set L0_1_set_69, LBB0_69-LJTI0_1
.set L0_1_set_47, LBB0_47-LJTI0_1
.set L0_1_set_70, LBB0_70-LJTI0_1
.set L0_1_set_71, LBB0_71-LJTI0_1
.set L0_1_set_72, LBB0_72-LJTI0_1
.set L0_1_set_41, LBB0_41-LJTI0_1
.set L0_1_set_42, LBB0_42-LJTI0_1
LJTI0_1:
	.long	L0_1_set_69
	.long	L0_1_set_47
	.long	L0_1_set_70
	.long	L0_1_set_71
	.long	L0_1_set_72
	.long	L0_1_set_70
	.long	L0_1_set_70
	.long	L0_1_set_70
	.long	L0_1_set_47
	.long	L0_1_set_70
	.long	L0_1_set_70
	.long	L0_1_set_41
	.long	L0_1_set_42
	.end_data_region
                                        ## -- 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	"invalid VCE command (0x%x)!\n"

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

L_.str.4:                               ## @.str.4
	.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       ; -- Begin function amdgpu_vce_ring_parse_cs
	.p2align	2
_amdgpu_vce_ring_parse_cs:              ; @amdgpu_vce_ring_parse_cs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x9, [x8, #8]
	str	xzr, [sp, #40]
	str	xzr, [x8]
	mov	w8, #12
	madd	x27, x1, x8, x9
	ldr	w0, [x27, #4]
	bl	_amdgpu_sa_bo_gpu_addr
	str	w0, [x27, #8]
	ldr	w8, [x27]
	cbz	w8, LBB0_53
; %bb.1:
	str	xzr, [sp, #24]                  ; 8-byte Folded Spill
	mov	w24, #0
	mov	x26, #-83886081
	mov	w28, #1
	movk	w28, #768, lsl #16
                                        ; implicit-def: $x25
Lloh0:
	adrp	x21, lJTI0_0@PAGE
Lloh1:
	add	x21, x21, lJTI0_0@PAGEOFF
	b	LBB0_6
LBB0_2:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w2, w24, #3
	add	w3, w24, #2
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	w4, #0
	mov	w5, #0
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	bl	_amdgpu_vce_validate_bo
	cbnz	w0, LBB0_57
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	w24, w24, w22, asr #2
	ldr	w8, [x27]
	cmp	w24, w8
	b.hs	LBB0_21
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	x2, x24
	bl	_amdgpu_get_ib_value
	mov	x23, x0
	sxtw	x22, w23
	add	w2, w24, #1
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w23, #8
	b.lo	LBB0_19
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	and	x8, x22, #0x3
	cbnz	x8, LBB0_19
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	sxtw	x8, w0
	add	x9, x8, x26
	cmp	x9, #12
	b.hi	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	adr	x8, LBB0_2
	ldrb	w10, [x21, x9]
	add	x8, x8, x10, lsl #2
	br	x8
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w2, w24, #4
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
	mov	x4, x0
	sxtw	x25, w4
	add	w2, w24, #3
	add	w3, w24, #2
	mov	x0, x19
	mov	x1, x20
                                        ; kill: def $w4 killed $w4 killed $x4
	ldr	w5, [sp, #24]                   ; 4-byte Folded Reload
	b	LBB0_4
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	x8, x28
	b.eq	LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	x8, #2
	b.ne	LBB0_5
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	add	w2, w24, #6
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
	str	w0, [sp, #28]                   ; 4-byte Folded Spill
	add	w2, w24, #7
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
	str	w0, [sp, #24]                   ; 4-byte Folded Spill
	b	LBB0_5
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w2, w24, #3
	add	w3, w24, #2
	mov	x0, x19
	mov	x1, x20
	mov	w4, #4096
	ldr	w5, [sp, #28]                   ; 4-byte Folded Reload
	b	LBB0_4
LBB0_15:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w2, w24, #3
	add	w3, w24, #2
	mov	x0, x19
	mov	x1, x20
	mov	w4, #0
	mov	w5, #0
	bl	_amdgpu_vce_validate_bo
	cbnz	w0, LBB0_57
; %bb.16:                               ;   in Loop: Header=BB0_6 Depth=1
	add	w2, w24, #8
	add	w3, w24, #7
	b	LBB0_3
LBB0_17:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w2, w24, #10
	add	w3, w24, #9
	mov	x0, x19
	mov	x1, x20
	mov	w4, #0
	mov	w5, #0
	bl	_amdgpu_vce_validate_bo
	cbnz	w0, LBB0_57
; %bb.18:                               ;   in Loop: Header=BB0_6 Depth=1
	add	w2, w24, #12
	add	w3, w24, #11
	b	LBB0_3
LBB0_19:
	str	x25, [sp, #32]
	str	x22, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	mov	x28, #0
LBB0_20:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cbnz	w8, LBB0_55
	b	LBB0_56
LBB0_21:
	str	x25, [sp, #32]
	cbz	w8, LBB0_53
; %bb.22:
	mov	w24, #0
	mov	x21, #0
	mov	x28, #0
	add	x22, sp, #32
	mov	w23, #-1
Lloh7:
	adrp	x26, lJTI0_1@PAGE
Lloh8:
	add	x26, x26, lJTI0_1@PAGEOFF
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	x2, x24
	bl	_amdgpu_get_ib_value
	mov	x25, x0
	add	w2, w24, #1
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	mov	w9, #83886080
	cmp	x8, x9
	b.gt	LBB0_31
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	w9, #33554432
	cmp	x8, x9
	b.le	LBB0_34
; %bb.25:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	x9, #-67108865
	add	x9, x8, x9
	cmp	x9, #8
	b.hi	LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	w10, #1
	lsl	x9, x10, x9
	mov	w10, #467
	tst	x9, x10
	b.ne	LBB0_50
LBB0_27:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	w9, #1
	movk	w9, #512, lsl #16
	cmp	x8, x9
	b.eq	LBB0_47
; %bb.28:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	w9, #1
	movk	w9, #768, lsl #16
	cmp	x8, x9
	b.ne	LBB0_67
; %bb.29:                               ;   in Loop: Header=BB0_23 Depth=1
	str	x21, [sp, #16]                  ; 8-byte Folded Spill
	add	w2, w24, #10
	add	w3, w24, #9
	mov	x21, x22
	ldr	x4, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w5, #0
	bl	_amdgpu_vce_cs_reloc
	cbnz	w0, LBB0_66
; %bb.30:                               ;   in Loop: Header=BB0_23 Depth=1
	add	w2, w24, #12
	add	w3, w24, #11
	ldr	x8, [x21]
	mov	x9, #-6148914691236517206
	movk	x9, #43691
	umulh	x8, x8, x9
	lsr	x4, x8, #1
	mov	x0, x19
	mov	x1, x20
	mov	w5, #0
	bl	_amdgpu_vce_cs_reloc
	ldr	x21, [sp, #16]                  ; 8-byte Folded Reload
	cbz	w0, LBB0_50
	b	LBB0_66
LBB0_31:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x9, #-83886081
	add	x9, x8, x9
	cmp	x9, #12
	b.hi	LBB0_67
; %bb.32:                               ;   in Loop: Header=BB0_23 Depth=1
	adr	x10, LBB0_33
	ldrb	w11, [x26, x9]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_33:                                ;   in Loop: Header=BB0_23 Depth=1
	add	w2, w24, #3
	add	w3, w24, #2
	ldr	x8, [x22]
	lsl	x4, x8, #1
	mov	x0, x19
	mov	x1, x20
	mov	w5, #0
	bl	_amdgpu_vce_cs_reloc
	cbz	w0, LBB0_50
	b	LBB0_66
LBB0_34:                                ;   in Loop: Header=BB0_23 Depth=1
	cmp	x8, #1
	b.eq	LBB0_39
; %bb.35:                               ;   in Loop: Header=BB0_23 Depth=1
	cmp	x8, #2
	b.eq	LBB0_41
; %bb.36:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	w9, #1
	movk	w9, #256, lsl #16
	cmp	x8, x9
	b.ne	LBB0_67
; %bb.37:                               ;   in Loop: Header=BB0_23 Depth=1
	mov	w8, #1
	lsl	w8, w8, w23
	sxtw	x8, w8
	tst	x28, x8
	b.eq	LBB0_48
; %bb.38:                               ;   in Loop: Header=BB0_23 Depth=1
	mvn	w9, w8
	sxtw	x9, w9
	and	x28, x28, x9
	ldr	x9, [sp, #40]
	orr	x9, x9, x8
	str	x9, [sp, #40]
	b	LBB0_49
LBB0_39:                                ;   in Loop: Header=BB0_23 Depth=1
	add	w2, w24, #2
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x1, w0
	add	x2, sp, #40
	mov	x0, x19
	bl	_amdgpu_vce_validate_handle
	mov	x23, x0
	tbnz	w0, #31, LBB0_58
; %bb.40:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x19]
	ldr	x8, [x8]
	add	x22, x8, w23, uxtw #3
	b	LBB0_51
LBB0_41:                                ;   in Loop: Header=BB0_23 Depth=1
	add	w2, w24, #6
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
	str	w0, [sp, #28]                   ; 4-byte Folded Spill
	add	w2, w24, #7
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
	str	w0, [sp, #24]                   ; 4-byte Folded Spill
	b	LBB0_50
LBB0_42:                                ;   in Loop: Header=BB0_23 Depth=1
	add	w2, w24, #4
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x4, w0
	str	x4, [sp, #32]
	add	w2, w24, #3
	add	w3, w24, #2
	mov	x0, x19
	mov	x1, x20
	ldr	w5, [sp, #24]                   ; 4-byte Folded Reload
	bl	_amdgpu_vce_cs_reloc
	cbz	w0, LBB0_50
	b	LBB0_66
LBB0_43:                                ;   in Loop: Header=BB0_23 Depth=1
	add	w2, w24, #3
	add	w3, w24, #2
	mov	x0, x19
	mov	x1, x20
	mov	w4, #4096
	ldr	w5, [sp, #28]                   ; 4-byte Folded Reload
	bl	_amdgpu_vce_cs_reloc
	cbz	w0, LBB0_50
	b	LBB0_66
LBB0_44:                                ;   in Loop: Header=BB0_23 Depth=1
	ldr	x8, [x19]
	ldr	w8, [x8, #16]
	cmp	w8, #130
	b.eq	LBB0_50
	b	LBB0_20
LBB0_45:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	x26, x21
	add	w2, w24, #3
	add	w3, w24, #2
	mov	x21, x22
	ldr	x4, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	w5, #0
	bl	_amdgpu_vce_cs_reloc
	cbnz	w0, LBB0_66
; %bb.46:                               ;   in Loop: Header=BB0_23 Depth=1
	add	w2, w24, #8
	add	w3, w24, #7
	ldr	x8, [x21]
	mov	x9, #-6148914691236517206
	movk	x9, #43691
	umulh	x8, x8, x9
	lsr	x4, x8, #3
	mov	x0, x19
	mov	x1, x20
	mov	w5, #0
	bl	_amdgpu_vce_cs_reloc
	mov	x21, x26
Lloh9:
	adrp	x26, lJTI0_1@PAGE
Lloh10:
	add	x26, x26, lJTI0_1@PAGEOFF
	cbz	w0, LBB0_50
	b	LBB0_66
LBB0_47:                                ;   in Loop: Header=BB0_23 Depth=1
	mov	w8, #1
	lsl	w8, w8, w23
	sxtw	x8, w8
	orr	x28, x28, x8
	b	LBB0_50
LBB0_48:                                ;   in Loop: Header=BB0_23 Depth=1
	ldr	x9, [sp, #40]
	tst	x9, x8
	b.eq	LBB0_68
LBB0_49:                                ;   in Loop: Header=BB0_23 Depth=1
	orr	x21, x21, x8
	add	w2, w24, #8
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
	mov	x26, x0
	add	w2, w24, #10
	mov	x0, x19
	mov	x1, x20
	bl	_amdgpu_get_ib_value
	mul	w8, w26, w0
	add	w8, w8, w8, lsl #1
	lsl	w8, w8, #2
	sxtw	x8, w8
	str	x8, [x22]
Lloh11:
	adrp	x26, lJTI0_1@PAGE
Lloh12:
	add	x26, x26, lJTI0_1@PAGEOFF
LBB0_50:                                ;   in Loop: Header=BB0_23 Depth=1
	cmn	w23, #1
	b.eq	LBB0_65
LBB0_51:                                ;   in Loop: Header=BB0_23 Depth=1
	add	w24, w24, w25, asr #2
	ldr	w8, [x27]
	cmp	w24, w8
	b.lo	LBB0_23
; %bb.52:
	ldr	x8, [sp, #40]
	bics	xzr, x8, x21
	b.ne	LBB0_54
	b	LBB0_56
LBB0_53:
	mov	x8, #0
	mov	x28, #0
	mov	x21, #0
	bics	xzr, x8, x21
	b.eq	LBB0_56
LBB0_54:
Lloh13:
	adrp	x0, l_.str.4@PAGE
Lloh14:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
Lloh15:
	adrp	x8, _ENOENT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cbz	w8, LBB0_56
LBB0_55:
	neg	w23, w8
	b	LBB0_58
LBB0_56:
	mov	w23, #0
	b	LBB0_59
LBB0_57:
	mov	x23, x0
	str	x25, [sp, #32]
LBB0_58:
	ldr	x28, [sp, #40]
LBB0_59:
Lloh18:
	adrp	x20, _AMDGPU_MAX_VCE_HANDLES@GOTPAGE
Lloh19:
	ldr	x20, [x20, _AMDGPU_MAX_VCE_HANDLES@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_64
; %bb.60:
	mov	x21, #0
	mov	x22, #0
	mov	w24, #1
	b	LBB0_62
LBB0_61:                                ;   in Loop: Header=BB0_62 Depth=1
	add	x22, x22, #1
	add	x21, x21, #4
	cmp	x22, w8, sxtw
	b.ge	LBB0_64
LBB0_62:                                ; =>This Inner Loop Header: Depth=1
	lsl	w9, w24, w22
	sxtw	x9, w9
	tst	x28, x9
	b.eq	LBB0_61
; %bb.63:                               ;   in Loop: Header=BB0_62 Depth=1
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	add	x0, x8, x21
	mov	w1, #0
	bl	_atomic_set
	ldr	w8, [x20]
	b	LBB0_61
LBB0_64:
	mov	x0, x23
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_65:
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_20
LBB0_66:
	mov	x23, x0
	b	LBB0_58
LBB0_67:
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_20
LBB0_68:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_20
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_14-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_15-LBB0_2)>>2
lJTI0_1:
	.byte	(LBB0_33-LBB0_33)>>2
	.byte	(LBB0_50-LBB0_33)>>2
	.byte	(LBB0_67-LBB0_33)>>2
	.byte	(LBB0_42-LBB0_33)>>2
	.byte	(LBB0_43-LBB0_33)>>2
	.byte	(LBB0_67-LBB0_33)>>2
	.byte	(LBB0_67-LBB0_33)>>2
	.byte	(LBB0_67-LBB0_33)>>2
	.byte	(LBB0_50-LBB0_33)>>2
	.byte	(LBB0_67-LBB0_33)>>2
	.byte	(LBB0_67-LBB0_33)>>2
	.byte	(LBB0_44-LBB0_33)>>2
	.byte	(LBB0_45-LBB0_33)>>2
                                        ; -- 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	"invalid VCE command (0x%x)!\n"

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

l_.str.4:                               ; @.str.4
	.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
