	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dispmanx_surface_free
_dispmanx_surface_free:                 ## @dispmanx_surface_free
	.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
	pushq	%rax
	.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, %r15
	movq	(%rsi), %r12
	movl	12(%rdi), %edi
	callq	_slock_lock
	cmpq	$0, (%r15)
	jle	LBB0_2
## %bb.1:
	movl	12(%r15), %esi
	movl	16(%r15), %edi
	callq	_scond_wait
LBB0_2:
	movl	12(%r15), %edi
	callq	_slock_unlock
	cmpl	$0, (%r12)
	jle	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movl	28(%rax,%rbx), %edi
	callq	_vc_dispmanx_resource_delete
	movq	16(%r12), %rax
	movl	$0, 4(%rax,%rbx)
	movl	24(%rax,%rbx), %edi
	callq	_slock_free
	incq	%r13
	movslq	(%r12), %rax
	addq	$32, %rbx
	cmpq	%rax, %r13
	jl	LBB0_4
LBB0_5:
	movq	16(%r12), %rdi
	callq	_free
	xorl	%edi, %edi
	callq	_vc_dispmanx_update_start
	movl	%eax, 8(%r15)
	movl	8(%r12), %esi
	movl	%eax, %edi
	callq	_vc_dispmanx_element_remove
	movl	8(%r15), %edi
	callq	_vc_dispmanx_update_submit_sync
	movq	%r12, %rdi
	callq	_free
	movq	$0, (%r14)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_dispmanx_surface_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dispmanx_surface_free
_dispmanx_surface_free:                 ; @dispmanx_surface_free
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x21, x0
	ldr	x20, [x1]
	ldr	w0, [x0, #12]
	bl	_slock_lock
	ldr	x8, [x21]
	cmp	x8, #1
	b.lt	LBB0_2
; %bb.1:
	ldp	w1, w0, [x21, #12]
	bl	_scond_wait
LBB0_2:
	ldr	w0, [x21, #12]
	bl	_slock_unlock
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x22, #0
	mov	x23, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	add	x8, x8, x22
	ldr	w0, [x8, #28]
	bl	_vc_dispmanx_resource_delete
	ldr	x8, [x20, #16]
	add	x8, x8, x22
	str	wzr, [x8, #4]
	ldr	w0, [x8, #24]
	bl	_slock_free
	add	x23, x23, #1
	ldrsw	x8, [x20]
	add	x22, x22, #32
	cmp	x23, x8
	b.lt	LBB0_4
LBB0_5:
	ldr	x0, [x20, #16]
	bl	_free
	mov	w0, #0
	bl	_vc_dispmanx_update_start
	str	w0, [x21, #8]
	ldr	w1, [x20, #8]
	bl	_vc_dispmanx_element_remove
	ldr	w0, [x21, #8]
	bl	_vc_dispmanx_update_submit_sync
	mov	x0, x20
	bl	_free
	str	xzr, [x19]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_dispmanx_surface_free
.subsections_via_symbols
