	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function exit_func
_exit_func:                             ## @exit_func
	.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	_eglImage@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.1:
	movq	_state@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_eglDestroyImageKHR
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_printf
LBB0_3:
	movq	_GL_COLOR_BUFFER_BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_glClear
	movq	_state@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movl	(%rax), %edi
	movl	8(%rax), %esi
	callq	_eglSwapBuffers
	movq	(%rbx), %rax
	movl	(%rax), %edi
	movq	_EGL_NO_SURFACE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_EGL_NO_CONTEXT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%edx, %esi
	callq	_eglMakeCurrent
	movq	(%rbx), %rax
	movl	(%rax), %edi
	movl	8(%rax), %esi
	callq	_eglDestroySurface
	movq	(%rbx), %rax
	movl	(%rax), %edi
	movl	4(%rax), %esi
	callq	_eglDestroyContext
	movq	(%rbx), %rax
	movl	(%rax), %edi
	callq	_eglTerminate
	leaq	L_str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_puts                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_eglImage,8,3                   ## @eglImage
	.comm	_state,8,3                      ## @state
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"eglDestroyImageKHR failed."

	.comm	_GL_COLOR_BUFFER_BIT,4,2        ## @GL_COLOR_BUFFER_BIT
	.comm	_EGL_NO_SURFACE,4,2             ## @EGL_NO_SURFACE
	.comm	_EGL_NO_CONTEXT,4,2             ## @EGL_NO_CONTEXT
L_str:                                  ## @str
	.asciz	"\ncube closed"

	.no_dead_strip	_exit_func
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function exit_func
_exit_func:                             ; @exit_func
	.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
Lloh0:
	adrp	x8, _eglImage@GOTPAGE
Lloh1:
	ldr	x8, [x8, _eglImage@GOTPAGEOFF]
Lloh2:
	ldr	x1, [x8]
Lloh3:
	adrp	x19, _state@GOTPAGE
Lloh4:
	ldr	x19, [x19, _state@GOTPAGEOFF]
	cbz	x1, LBB0_3
; %bb.1:
	ldr	x8, [x19]
	ldr	w0, [x8]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_eglDestroyImageKHR
	cbnz	w0, LBB0_3
; %bb.2:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
LBB0_3:
Lloh7:
	adrp	x8, _GL_COLOR_BUFFER_BIT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GL_COLOR_BUFFER_BIT@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_glClear
	ldr	x8, [x19]
	ldr	w0, [x8]
	ldr	w1, [x8, #8]
	bl	_eglSwapBuffers
	ldr	x8, [x19]
	ldr	w0, [x8]
Lloh10:
	adrp	x8, _EGL_NO_SURFACE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EGL_NO_SURFACE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x8, _EGL_NO_CONTEXT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EGL_NO_CONTEXT@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	mov	x2, x1
	bl	_eglMakeCurrent
	ldr	x8, [x19]
	ldr	w0, [x8]
	ldr	w1, [x8, #8]
	bl	_eglDestroySurface
	ldr	x8, [x19]
	ldp	w0, w1, [x8]
	bl	_eglDestroyContext
	ldr	x8, [x19]
	ldr	w0, [x8]
	bl	_eglTerminate
Lloh16:
	adrp	x0, l_str@PAGE
Lloh17:
	add	x0, x0, l_str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_puts
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_eglImage,8,3                   ; @eglImage
	.comm	_state,8,3                      ; @state
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"eglDestroyImageKHR failed."

	.comm	_GL_COLOR_BUFFER_BIT,4,2        ; @GL_COLOR_BUFFER_BIT
	.comm	_EGL_NO_SURFACE,4,2             ; @EGL_NO_SURFACE
	.comm	_EGL_NO_CONTEXT,4,2             ; @EGL_NO_CONTEXT
l_str:                                  ; @str
	.asciz	"\ncube closed"

	.no_dead_strip	_exit_func
.subsections_via_symbols
