	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_alloc_btres_lock
_check_alloc_btres_lock:                ## @check_alloc_btres_lock
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	(%rsi), %r10d
	movl	$1, %eax
	testl	%edx, %r10d
	je	LBB0_1
LBB0_10:
	popq	%rbp
	retq
LBB0_1:
	movq	_RESOURCE_VIDEO_READ@GOTPCREL(%rip), %r8
	movq	_RESOURCE_VIDEO_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r8), %eax
	movl	%eax, %ecx
	andl	%edx, %ecx
	cmovnel	%eax, %ecx
	orl	%edx, %ecx
	movl	(%rdi), %r8d
	xorl	%eax, %eax
	testl	%r8d, %ecx
	jne	LBB0_10
## %bb.2:
	movq	_VIDEO_RESOURCES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r9d
	testl	%edx, %r9d
	je	LBB0_6
## %bb.3:
	andl	%r8d, %r9d
	jne	LBB0_6
## %bb.4:
	movq	24(%rdi), %r9
	xorl	%ecx, %ecx
	cmpl	$0, 16(%rsi)
	setne	%cl
	movq	(%r9,%rcx,8), %r9
	cmpq	%r9, 8(%rdi)
	jg	LBB0_10
## %bb.5:
	movq	%r9, 16(%rdi)
	jmp	LBB0_9
LBB0_6:
	movq	_VBI_RESOURCES@GOTPCREL(%rip), %rcx
	testl	%edx, (%rcx)
	je	LBB0_9
## %bb.7:
	movq	8(%rsi), %r9
	cmpq	16(%rdi), %r9
	jg	LBB0_10
## %bb.8:
	movq	%r9, 8(%rdi)
LBB0_9:
	orl	%edx, %r10d
	movl	%r10d, (%rsi)
	orl	%edx, %r8d
	movl	%r8d, (%rdi)
	movl	$1, %eax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RESOURCE_VIDEO_READ,4,2        ## @RESOURCE_VIDEO_READ
	.comm	_RESOURCE_VIDEO_STREAM,4,2      ## @RESOURCE_VIDEO_STREAM
	.comm	_VIDEO_RESOURCES,4,2            ## @VIDEO_RESOURCES
	.comm	_VBI_RESOURCES,4,2              ## @VBI_RESOURCES
	.no_dead_strip	_check_alloc_btres_lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_alloc_btres_lock
_check_alloc_btres_lock:                ; @check_alloc_btres_lock
	.cfi_startproc
; %bb.0:
	ldr	w9, [x1]
	tst	w9, w2
	b.eq	LBB0_2
LBB0_1:
	mov	w8, #1
	b	LBB0_3
LBB0_2:
	mov	w8, #0
Lloh0:
	adrp	x10, _RESOURCE_VIDEO_READ@GOTPAGE
Lloh1:
	ldr	x10, [x10, _RESOURCE_VIDEO_READ@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
Lloh3:
	adrp	x11, _RESOURCE_VIDEO_STREAM@GOTPAGE
Lloh4:
	ldr	x11, [x11, _RESOURCE_VIDEO_STREAM@GOTPAGEOFF]
Lloh5:
	ldr	w11, [x11]
	orr	w10, w11, w10
	tst	w10, w2
	csel	w10, wzr, w10, eq
	orr	w11, w10, w2
	ldr	w10, [x0]
	tst	w11, w10
	b.eq	LBB0_4
LBB0_3:
	mov	x0, x8
	ret
LBB0_4:
Lloh6:
	adrp	x8, _VIDEO_RESOURCES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VIDEO_RESOURCES@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	and	w11, w8, w2
	and	w8, w8, w10
	cmp	w11, #0
	ccmp	w8, #0, #0, ne
	b.eq	LBB0_8
; %bb.5:
Lloh9:
	adrp	x8, _VBI_RESOURCES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VBI_RESOURCES@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_12
; %bb.6:
	ldr	x8, [x1, #8]
	ldr	x11, [x0, #16]
	cmp	x8, x11
	b.le	LBB0_11
; %bb.7:
	mov	w0, #0
	ret
LBB0_8:
	ldr	x8, [x0, #24]
	ldr	w11, [x1, #16]
	cmp	w11, #0
	cset	w11, ne
	ldr	x8, [x8, w11, uxtw #3]
	ldr	x11, [x0, #8]
	cmp	x11, x8
	b.le	LBB0_10
; %bb.9:
	mov	w0, #0
	ret
LBB0_10:
	str	x8, [x0, #16]
	b	LBB0_12
LBB0_11:
	str	x8, [x0, #8]
LBB0_12:
	orr	w8, w9, w2
	str	w8, [x1]
	orr	w8, w10, w2
	str	w8, [x0]
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_RESOURCE_VIDEO_READ,4,2        ; @RESOURCE_VIDEO_READ
	.comm	_RESOURCE_VIDEO_STREAM,4,2      ; @RESOURCE_VIDEO_STREAM
	.comm	_VIDEO_RESOURCES,4,2            ; @VIDEO_RESOURCES
	.comm	_VBI_RESOURCES,4,2              ; @VBI_RESOURCES
	.no_dead_strip	_check_alloc_btres_lock
.subsections_via_symbols
