	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_egl_destroy                    ## -- Begin function egl_destroy
	.p2align	4, 0x90
_egl_destroy:                           ## @egl_destroy
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	32(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.1:
	movq	_EGL_NO_SURFACE@GOTPCREL(%rip), %r14
	movq	(%r14), %rdx
	movq	_EGL_NO_CONTEXT@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movq	%rdx, %rsi
	callq	_eglMakeCurrent
	movq	(%rbx), %rsi
	cmpq	(%r15), %rsi
	je	LBB0_3
## %bb.2:
	movq	32(%rbx), %rdi
	callq	_eglDestroyContext
	movq	(%r15), %rsi
LBB0_3:
	movq	8(%rbx), %rax
	cmpq	%rsi, %rax
	je	LBB0_5
## %bb.4:
	movq	32(%rbx), %rdi
	movq	%rax, %rsi
	callq	_eglDestroyContext
LBB0_5:
	movq	16(%rbx), %rsi
	cmpq	(%r14), %rsi
	je	LBB0_7
## %bb.6:
	movq	32(%rbx), %rdi
	callq	_eglDestroySurface
LBB0_7:
	movq	32(%rbx), %rdi
	callq	_eglTerminate
LBB0_8:
	movq	_EGL_NO_CONTEXT@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rcx, (%rbx)
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	movq	_EGL_NO_SURFACE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rbx)
	movq	_EGL_NO_DISPLAY@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%rbx)
	movq	$0, 24(%rbx)
	movq	_g_egl_inited@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_frontend_driver_destroy_signal_handler_state ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EGL_NO_SURFACE,8,3             ## @EGL_NO_SURFACE
	.comm	_EGL_NO_CONTEXT,8,3             ## @EGL_NO_CONTEXT
	.comm	_EGL_NO_DISPLAY,8,3             ## @EGL_NO_DISPLAY
	.comm	_g_egl_inited,4,2               ## @g_egl_inited
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_egl_destroy                    ; -- Begin function egl_destroy
	.p2align	2
_egl_destroy:                           ; @egl_destroy
	.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
	mov	x19, x0
	ldr	x0, [x0, #32]
Lloh0:
	adrp	x21, _EGL_NO_CONTEXT@GOTPAGE
Lloh1:
	ldr	x21, [x21, _EGL_NO_CONTEXT@GOTPAGEOFF]
Lloh2:
	adrp	x20, _EGL_NO_SURFACE@GOTPAGE
Lloh3:
	ldr	x20, [x20, _EGL_NO_SURFACE@GOTPAGEOFF]
	cbz	x0, LBB0_8
; %bb.1:
	ldr	x1, [x20]
	ldr	x3, [x21]
	mov	x2, x1
	bl	_eglMakeCurrent
	ldr	x1, [x19]
	ldr	x8, [x21]
	cmp	x1, x8
	b.eq	LBB0_3
; %bb.2:
	ldr	x0, [x19, #32]
	bl	_eglDestroyContext
	ldr	x1, [x21]
LBB0_3:
	ldr	x8, [x19, #8]
	cmp	x8, x1
	b.eq	LBB0_5
; %bb.4:
	ldr	x0, [x19, #32]
	mov	x1, x8
	bl	_eglDestroyContext
LBB0_5:
	ldr	x1, [x19, #16]
	ldr	x8, [x20]
	cmp	x1, x8
	b.eq	LBB0_7
; %bb.6:
	ldr	x0, [x19, #32]
	bl	_eglDestroySurface
LBB0_7:
	ldr	x0, [x19, #32]
	bl	_eglTerminate
LBB0_8:
	ldr	x8, [x21]
	str	x8, [x19]
	ldr	x8, [x21]
	ldr	x9, [x20]
	stp	x8, x9, [x19, #8]
Lloh4:
	adrp	x8, _EGL_NO_DISPLAY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EGL_NO_DISPLAY@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	stp	xzr, x8, [x19, #24]
Lloh7:
	adrp	x8, _g_egl_inited@GOTPAGE
Lloh8:
	ldr	x8, [x8, _g_egl_inited@GOTPAGEOFF]
Lloh9:
	str	wzr, [x8]
	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
	b	_frontend_driver_destroy_signal_handler_state
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_EGL_NO_SURFACE,8,3             ; @EGL_NO_SURFACE
	.comm	_EGL_NO_CONTEXT,8,3             ; @EGL_NO_CONTEXT
	.comm	_EGL_NO_DISPLAY,8,3             ; @EGL_NO_DISPLAY
	.comm	_g_egl_inited,4,2               ; @g_egl_inited
.subsections_via_symbols
