	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function egl_init_vcsm
_egl_init_vcsm:                         ## @egl_init_vcsm
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_vcsm_malloc_cache@GOTPCREL(%rip), %r15
	movl	$1, %r14d
	cmpq	$0, (%r15)
	jne	LBB0_8
## %bb.1:
	movq	_RTLD_LAZY@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	callq	_dlopen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_dlopen
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_7
LBB0_3:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dlsym
	movq	%rax, (%r15)
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dlsym
	movq	_vcsm_vc_hdl_from_hdl@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_dlsym
	movq	_vcsm_free@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	cmpq	$0, (%r15)
	je	LBB0_6
## %bb.4:
	cmpq	$0, (%r12)
	je	LBB0_6
## %bb.5:
	testq	%rax, %rax
	jne	LBB0_8
LBB0_6:
	movq	$0, (%r15)
	movq	$0, (%r12)
	movq	$0, (%rcx)
LBB0_7:
	leaq	L_.str.5(%rip), %rdi
	callq	_vcos_log_error
	xorl	%r14d, %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_vcsm_malloc_cache,8,3          ## @vcsm_malloc_cache
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"libvcsm.so"

	.comm	_RTLD_LAZY,4,2                  ## @RTLD_LAZY
L_.str.1:                               ## @.str.1
	.asciz	"/opt/vc/lib/libvcsm.so"

L_.str.2:                               ## @.str.2
	.asciz	"vcsm_malloc_cache"

L_.str.3:                               ## @.str.3
	.asciz	"vcsm_vc_hdl_from_hdl"

	.comm	_vcsm_vc_hdl_from_hdl,8,3       ## @vcsm_vc_hdl_from_hdl
L_.str.4:                               ## @.str.4
	.asciz	"vcsm_free"

	.comm	_vcsm_free,8,3                  ## @vcsm_free
L_.str.5:                               ## @.str.5
	.asciz	"Unable to load libvcsm.so for target EGL_IMAGE_BRCM_VCSM"

	.no_dead_strip	_egl_init_vcsm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function egl_init_vcsm
_egl_init_vcsm:                         ; @egl_init_vcsm
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x20, _vcsm_malloc_cache@GOTPAGE
Lloh1:
	ldr	x20, [x20, _vcsm_malloc_cache@GOTPAGEOFF]
	ldr	x8, [x20]
	cbnz	x8, LBB0_6
; %bb.1:
Lloh2:
	adrp	x21, _RTLD_LAZY@GOTPAGE
Lloh3:
	ldr	x21, [x21, _RTLD_LAZY@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dlopen
	mov	x19, x0
	cbnz	x0, LBB0_3
; %bb.2:
	ldr	w1, [x21]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dlopen
	mov	x19, x0
	cbz	x0, LBB0_5
LBB0_3:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dlsym
	str	x0, [x20]
Lloh10:
	adrp	x1, l_.str.3@PAGE
Lloh11:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dlsym
Lloh12:
	adrp	x21, _vcsm_vc_hdl_from_hdl@GOTPAGE
Lloh13:
	ldr	x21, [x21, _vcsm_vc_hdl_from_hdl@GOTPAGEOFF]
	str	x0, [x21]
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dlsym
Lloh16:
	adrp	x8, _vcsm_free@GOTPAGE
Lloh17:
	ldr	x8, [x8, _vcsm_free@GOTPAGEOFF]
	str	x0, [x8]
	ldr	x9, [x20]
	ldr	x10, [x21]
	cmp	x9, #0
	ccmp	x10, #0, #4, ne
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_6
; %bb.4:
	str	xzr, [x20]
	str	xzr, [x21]
	str	xzr, [x8]
LBB0_5:
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_vcos_log_error
	mov	w0, #0
	b	LBB0_7
LBB0_6:
	mov	w0, #1
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_vcsm_malloc_cache,8,3          ; @vcsm_malloc_cache
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"libvcsm.so"

	.comm	_RTLD_LAZY,4,2                  ; @RTLD_LAZY
l_.str.1:                               ; @.str.1
	.asciz	"/opt/vc/lib/libvcsm.so"

l_.str.2:                               ; @.str.2
	.asciz	"vcsm_malloc_cache"

l_.str.3:                               ; @.str.3
	.asciz	"vcsm_vc_hdl_from_hdl"

	.comm	_vcsm_vc_hdl_from_hdl,8,3       ; @vcsm_vc_hdl_from_hdl
l_.str.4:                               ; @.str.4
	.asciz	"vcsm_free"

	.comm	_vcsm_free,8,3                  ; @vcsm_free
l_.str.5:                               ; @.str.5
	.asciz	"Unable to load libvcsm.so for target EGL_IMAGE_BRCM_VCSM"

	.no_dead_strip	_egl_init_vcsm
.subsections_via_symbols
