	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmw_cmd_res_check
_vmw_cmd_res_check:                     ## @vmw_cmd_res_check
	.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	%r9, %r12
	movl	%edx, %r15d
	movq	%rsi, %r13
	movq	16(%rbp), %r14
	movq	24(%rsi), %rbx
	testq	%r14, %r14
	je	LBB0_2
## %bb.1:
	movq	$0, (%r14)
LBB0_2:
	movq	(%r12), %rax
	movq	_SVGA3D_INVALID_ID@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	jne	LBB0_5
## %bb.3:
	movq	_vmw_res_context@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	cmpl	%r15d, (%rax)
	jne	LBB0_14
## %bb.4:
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_VMW_DEBUG_USER
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_5:
	movl	%r15d, %edx
	leaq	(%rdx,%rdx,4), %rdx
	cmpl	$0, (%rbx,%rdx,8)
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	je	LBB0_7
## %bb.6:
	xorl	%edi, %edi
	cmpq	8(%rbx,%rdx,8), %rax
	sete	%dil
	jmp	LBB0_8
LBB0_7:
	xorl	%edi, %edi
LBB0_8:
	callq	_likely
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rbx,%rax,8), %r15
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	testl	%edx, %edx
	je	LBB0_11
## %bb.10:
	movl	16(%r13), %edi
	movl	32(%rbx,%rax,8), %esi
	callq	_vmw_validation_res_set_dirty
LBB0_11:
	movl	(%r13), %edi
	movq	%r12, %rsi
	callq	_vmw_ptr_diff
	movq	_vmw_res_rel_normal@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_vmw_resource_relocation_add
	xorl	%r12d, %r12d
	testq	%r14, %r14
	je	LBB0_14
## %bb.12:
	movq	%r15, (%r14)
	jmp	LBB0_14
LBB0_13:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_vmw_execbuf_res_size
	movl	16(%r13), %edi
	movl	%eax, %esi
	callq	_vmw_validation_preload_res
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_15
LBB0_14:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	8(%r13), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	(%r12), %rdx
	movq	%rbx, %rdi
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	callq	_vmw_user_resource_noref_lookup_handle
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_VMW_DEBUG_USER
	movq	%r15, %rdi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_17:
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_vmw_execbuf_res_noref_val_add
	movl	%eax, %r12d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_14
## %bb.18:
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	cmpq	$0, 24(%rcx,%rdx,8)
	je	LBB0_21
## %bb.19:
	cmpq	%r15, 16(%rcx,%rdx,8)
	je	LBB0_22
LBB0_21:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_22:
	leaq	(%rcx,%rdx,8), %rax
	movl	$1, (%rax)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	(%r12), %rax
	movq	%rax, 8(%rcx,%rdx,8)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_SVGA3D_INVALID_ID,8,3          ## @SVGA3D_INVALID_ID
	.comm	_vmw_res_context,4,2            ## @vmw_res_context
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Illegal context invalid id.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Could not find/use resource 0x%08x.\n"

	.comm	_vmw_res_rel_normal,4,2         ## @vmw_res_rel_normal
	.no_dead_strip	_vmw_cmd_res_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmw_cmd_res_check
_vmw_cmd_res_check:                     ; @vmw_cmd_res_check
	.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, x6
	mov	x21, x5
	mov	x23, x4
	mov	x22, x3
	mov	x25, x2
	mov	x20, x1
	mov	x24, x0
	ldr	x26, [x1, #24]
	cbz	x6, LBB0_2
; %bb.1:
	str	xzr, [x19]
LBB0_2:
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _SVGA3D_INVALID_ID@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SVGA3D_INVALID_ID@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
Lloh3:
	adrp	x8, _vmw_res_context@GOTPAGE
Lloh4:
	ldr	x8, [x8, _vmw_res_context@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w25
	b.ne	LBB0_11
; %bb.4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_VMW_DEBUG_USER
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_14
LBB0_5:
	mov	w27, w25
	mov	w9, #40
	madd	x28, x27, x9, x26
	ldr	w9, [x28]
	cbz	w9, LBB0_12
; %bb.6:
	mov	w9, #40
	madd	x9, x27, x9, x26
	ldr	x9, [x9, #8]
	cmp	x8, x9
	cset	w0, eq
	bl	_likely
	cbz	x0, LBB0_13
LBB0_7:
	mov	w8, #40
	madd	x8, x27, x8, x26
	ldr	x23, [x8, #16]
	cbz	w22, LBB0_9
; %bb.8:
	ldr	w0, [x20, #16]
	mov	w8, #40
	madd	x8, x27, x8, x26
	ldr	w1, [x8, #32]
	mov	x2, x22
	bl	_vmw_validation_res_set_dirty
LBB0_9:
	ldr	w0, [x20]
	mov	x1, x21
	bl	_vmw_ptr_diff
	mov	x2, x0
Lloh11:
	adrp	x8, _vmw_res_rel_normal@GOTPAGE
Lloh12:
	ldr	x8, [x8, _vmw_res_rel_normal@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x23
	bl	_vmw_resource_relocation_add
	mov	w25, #0
	cbz	x19, LBB0_14
; %bb.10:
	str	x23, [x19]
	b	LBB0_14
LBB0_11:
	mov	w25, #0
	b	LBB0_14
LBB0_12:
	mov	w0, #0
	bl	_likely
	cbnz	x0, LBB0_7
LBB0_13:
	mov	x0, x24
	mov	x1, x25
	bl	_vmw_execbuf_res_size
	mov	x1, x0
	ldr	w0, [x20, #16]
	bl	_vmw_validation_preload_res
	mov	x25, x0
	cbz	w0, LBB0_15
LBB0_14:
	mov	x0, x25
	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
LBB0_15:
	ldr	x8, [x20, #8]
	ldr	w1, [x8]
	ldr	x2, [x21]
	mov	x0, x24
	mov	x3, x23
	bl	_vmw_user_resource_noref_lookup_handle
	mov	x23, x0
	bl	_IS_ERR
	cbz	x0, LBB0_17
; %bb.16:
	ldr	x8, [x21]
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_VMW_DEBUG_USER
	mov	x0, x23
	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
	b	_PTR_ERR
LBB0_17:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x22
	bl	_vmw_execbuf_res_noref_val_add
	mov	x25, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_14
; %bb.18:
	mov	w8, #40
	madd	x8, x27, x8, x26
	ldr	x8, [x8, #24]
	cbz	x8, LBB0_9
; %bb.19:
	mov	w8, #40
	madd	x8, x27, x8, x26
	ldr	x8, [x8, #16]
	cmp	x8, x23
	b.ne	LBB0_9
; %bb.20:
	mov	w8, #1
	str	w8, [x28]
	ldr	x8, [x21]
	mov	w9, #40
	madd	x9, x27, x9, x26
	str	x8, [x9, #8]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_SVGA3D_INVALID_ID,8,3          ; @SVGA3D_INVALID_ID
	.comm	_vmw_res_context,4,2            ; @vmw_res_context
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Illegal context invalid id.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Could not find/use resource 0x%08x.\n"

	.comm	_vmw_res_rel_normal,4,2         ; @vmw_res_rel_normal
	.no_dead_strip	_vmw_cmd_res_check
.subsections_via_symbols
