	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_validation_add_resource    ## -- Begin function vmw_validation_add_resource
	.p2align	4, 0x90
_vmw_validation_add_resource:           ## @vmw_validation_add_resource
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r13
	callq	_vmw_validation_find_res_dup
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %r12
	movl	$0, (%rax)
LBB0_19:
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	testl	%esi, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	je	LBB0_21
## %bb.20:
	movl	$1, 4(%r12)
	movq	_VMW_RES_DIRTY_SET@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	andl	(%rax), %esi
	setne	%cl
	movl	%ecx, 8(%r12)
LBB0_21:
	testq	%r15, %r15
	je	LBB0_23
## %bb.22:
	movl	(%r12), %eax
	movl	%eax, (%r15)
LBB0_23:
	xorl	%r15d, %r15d
	testq	%rdx, %rdx
	je	LBB0_25
## %bb.24:
	addq	$12, %r12
	movq	%r12, (%rdx)
	jmp	LBB0_25
LBB0_2:
	addl	$32, %ebx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_vmw_validation_mem_alloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r12
	movq	%r15, %rbx
	movq	8(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.5:
	leaq	24(%r12), %rsi
	movq	%r14, 24(%r12)
	callq	_drm_ht_insert_item
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	jmp	LBB0_25
LBB0_7:
	movq	%r14, %rdi
	callq	_vmw_resource_reference_unless_doomed
	movl	%eax, 20(%r12)
	testl	%eax, %eax
	je	LBB0_8
## %bb.10:
	movl	$1, (%r12)
	movq	(%r14), %rax
	cmpl	$0, (%rax)
	je	LBB0_11
## %bb.12:
	movq	%r14, %rdi
	callq	_vmw_res_type
	cmpl	$130, %eax
	movq	%rbx, %r15
	je	LBB0_15
## %bb.13:
	cmpl	$129, %eax
	je	LBB0_16
## %bb.14:
	cmpl	$128, %eax
	jne	LBB0_17
LBB0_15:
	movq	%r12, %rdi
	addq	$16, %rdi
	addq	$4, %r13
	movq	%r13, %rsi
	callq	_list_add
	jmp	LBB0_19
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_VMW_DEBUG_USER
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_ESRCH@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_25:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r12, %rdi
	addq	$16, %rdi
	movq	%r13, %rsi
	callq	_list_add_tail
	movq	%rbx, %r15
	jmp	LBB0_19
LBB0_16:
	movq	%r12, %rdi
	addq	$16, %rdi
	addq	$4, %r13
	jmp	LBB0_18
LBB0_17:
	movq	%r12, %rdi
	addq	$16, %rdi
LBB0_18:
	movq	%r13, %rsi
	callq	_list_add_tail
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate a resource validation entry.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Failed to initialize a resource validation entry.\n"

	.comm	_ESRCH,4,2                      ## @ESRCH
	.comm	_VMW_RES_DIRTY_SET,4,2          ## @VMW_RES_DIRTY_SET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_validation_add_resource    ; -- Begin function vmw_validation_add_resource
	.p2align	2
_vmw_validation_add_resource:           ; @vmw_validation_add_resource
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x5
	mov	x19, x4
	mov	x21, x3
	mov	x25, x2
	mov	x24, x1
	mov	x23, x0
	bl	_vmw_validation_find_res_dup
	cbz	x0, LBB0_8
; %bb.1:
	mov	x22, x0
	str	wzr, [x0]
LBB0_2:
	cbz	w21, LBB0_4
; %bb.3:
Lloh0:
	adrp	x8, _VMW_RES_DIRTY_SET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VMW_RES_DIRTY_SET@GOTPAGEOFF]
	mov	w9, #1
Lloh2:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w8, ne
	stp	w9, w8, [x22, #4]
LBB0_4:
	cbz	x20, LBB0_6
; %bb.5:
	ldr	w8, [x22]
	str	w8, [x20]
LBB0_6:
	mov	w25, #0
	cbz	x19, LBB0_21
; %bb.7:
	add	x8, x22, #12
	str	x8, [x19]
	b	LBB0_21
LBB0_8:
	add	w1, w25, #32
	mov	x0, x23
	bl	_vmw_validation_mem_alloc
	cbz	x0, LBB0_18
; %bb.9:
	mov	x22, x0
	ldr	x0, [x23, #8]
	cbz	x0, LBB0_12
; %bb.10:
	mov	x1, x22
	str	x24, [x1, #24]!
	bl	_drm_ht_insert_item
	cbz	w0, LBB0_12
; %bb.11:
	mov	x25, x0
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_21
LBB0_12:
	mov	x0, x24
	bl	_vmw_resource_reference_unless_doomed
	str	w0, [x22, #20]
	cbz	w0, LBB0_19
; %bb.13:
	mov	w8, #1
	str	w8, [x22]
	ldr	x8, [x24]
	ldr	w8, [x8]
	cbz	w8, LBB0_22
; %bb.14:
	mov	x0, x24
	bl	_vmw_res_type
	cmp	w0, #130
	b.eq	LBB0_17
; %bb.15:
	cmp	w0, #129
	b.eq	LBB0_23
; %bb.16:
	cmp	w0, #128
	b.ne	LBB0_22
LBB0_17:
	add	x0, x22, #16
	add	x1, x23, #4
	bl	_list_add
	b	LBB0_2
LBB0_18:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_VMW_DEBUG_USER
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_20
LBB0_19:
Lloh9:
	adrp	x8, _ESRCH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ESRCH@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_21:
	mov	x0, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_22:
	add	x0, x22, #16
	mov	x1, x23
	b	LBB0_24
LBB0_23:
	add	x0, x22, #16
	add	x1, x23, #4
LBB0_24:
	bl	_list_add_tail
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate a resource validation entry.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Failed to initialize a resource validation entry.\n"

	.comm	_ESRCH,4,2                      ; @ESRCH
	.comm	_VMW_RES_DIRTY_SET,4,2          ; @VMW_RES_DIRTY_SET
.subsections_via_symbols
