	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function egl_surface_pool_free
_egl_surface_pool_free:                 ## @egl_surface_pool_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	cmpl	$0, (%rdi)
	je	LBB0_2
## %bb.1:
	leaq	4(%rbx), %rdi
	callq	_khronos_platform_semaphore_destroy
LBB0_2:
	movl	$0, (%rbx)
	movq	_surface_pool@GOTPCREL(%rip), %rax
	movq	%rbx, %rcx
	subq	8(%rax), %rcx
	shrq	$3, %rcx
	movq	_EGL_SURFACE_POOL_SIZE@GOTPCREL(%rip), %rdx
	cmpl	%ecx, (%rdx)
	jbe	LBB0_4
## %bb.3:
	movl	$-2, %edx
                                        ## kill: def $cl killed $cl killed $rcx
	roll	%cl, %edx
	andl	%edx, (%rax)
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_4:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_khrn_platform_free             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_surface_pool,16,3              ## @surface_pool
	.comm	_EGL_SURFACE_POOL_SIZE,4,2      ## @EGL_SURFACE_POOL_SIZE
	.no_dead_strip	_egl_surface_pool_free
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function egl_surface_pool_free
_egl_surface_pool_free:                 ; @egl_surface_pool_free
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_2
; %bb.1:
	add	x0, x19, #4
	bl	_khronos_platform_semaphore_destroy
LBB0_2:
	str	wzr, [x19]
Lloh0:
	adrp	x8, _surface_pool@GOTPAGE
Lloh1:
	ldr	x8, [x8, _surface_pool@GOTPAGEOFF]
	ldr	x9, [x8, #8]
	sub	x9, x19, x9
	lsr	x9, x9, #3
Lloh2:
	adrp	x10, _EGL_SURFACE_POOL_SIZE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _EGL_SURFACE_POOL_SIZE@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	cmp	w10, w9
	b.ls	LBB0_4
; %bb.3:
	mov	w10, #1
	lsl	w9, w10, w9
	ldr	w10, [x8]
	bic	w9, w10, w9
	str	w9, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_khrn_platform_free
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_surface_pool,16,3              ; @surface_pool
	.comm	_EGL_SURFACE_POOL_SIZE,4,2      ; @EGL_SURFACE_POOL_SIZE
	.no_dead_strip	_egl_surface_pool_free
.subsections_via_symbols
