	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_ctx_x_destroy_resources
_gfx_ctx_x_destroy_resources:           ## @gfx_ctx_x_destroy_resources
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_x11_input_ctx_destroy
	movq	_g_x11_dpy@GOTPCREL(%rip), %r14
	movq	_g_x11_win@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.1:
	cmpq	$0, (%r14)
	je	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	callq	_x11_window_destroy
LBB0_3:
	xorl	%eax, %eax
	callq	_x11_colormap_destroy
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.4:
	cmpl	$0, (%rbx)
	je	LBB0_6
## %bb.5:
	callq	_x11_exit_fullscreen
	movl	$0, (%rbx)
LBB0_6:
	xorl	%eax, %eax
	callq	_video_driver_is_video_cache_context
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	(%r14), %rdi
	callq	_XCloseDisplay
	movq	$0, (%r14)
LBB0_8:
	movq	_g_major@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_g_minor@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movl	$0, 4(%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_g_x11_dpy,8,3                  ## @g_x11_dpy
	.comm	_x_api,4,2                      ## @x_api
	.comm	_g_x11_win,8,3                  ## @g_x11_win
	.comm	_g_major,8,3                    ## @g_major
	.comm	_g_minor,8,3                    ## @g_minor
	.comm	_None,4,2                       ## @None
	.comm	_g_pglSwapInterval,8,3          ## @g_pglSwapInterval
	.comm	_g_pglSwapIntervalEXT,8,3       ## @g_pglSwapIntervalEXT
	.comm	_g_pglSwapIntervalSGI,8,3       ## @g_pglSwapIntervalSGI
	.no_dead_strip	_gfx_ctx_x_destroy_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_ctx_x_destroy_resources
_gfx_ctx_x_destroy_resources:           ; @gfx_ctx_x_destroy_resources
	.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
	bl	_x11_input_ctx_destroy
Lloh0:
	adrp	x20, _g_x11_dpy@GOTPAGE
Lloh1:
	ldr	x20, [x20, _g_x11_dpy@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _g_x11_win@GOTPAGE
Lloh3:
	ldr	x9, [x9, _g_x11_win@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x9, #0
	ccmp	x8, #0, #4, ne
	b.eq	LBB0_2
; %bb.1:
	mov	w0, #0
	bl	_x11_window_destroy
LBB0_2:
	bl	_x11_colormap_destroy
	ldr	x0, [x20]
	cbz	x0, LBB0_7
; %bb.3:
	ldr	w8, [x19]
	cbz	w8, LBB0_5
; %bb.4:
	bl	_x11_exit_fullscreen
	str	wzr, [x19]
LBB0_5:
	bl	_video_driver_is_video_cache_context
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	x0, [x20]
	bl	_XCloseDisplay
	str	xzr, [x20]
LBB0_7:
Lloh5:
	adrp	x8, _g_major@GOTPAGE
Lloh6:
	ldr	x8, [x8, _g_major@GOTPAGEOFF]
Lloh7:
	str	xzr, [x8]
Lloh8:
	adrp	x8, _g_minor@GOTPAGE
Lloh9:
	ldr	x8, [x8, _g_minor@GOTPAGEOFF]
Lloh10:
	str	xzr, [x8]
	str	wzr, [x19, #4]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_g_x11_dpy,8,3                  ; @g_x11_dpy
	.comm	_x_api,4,2                      ; @x_api
	.comm	_g_x11_win,8,3                  ; @g_x11_win
	.comm	_g_major,8,3                    ; @g_major
	.comm	_g_minor,8,3                    ; @g_minor
	.comm	_None,4,2                       ; @None
	.comm	_g_pglSwapInterval,8,3          ; @g_pglSwapInterval
	.comm	_g_pglSwapIntervalEXT,8,3       ; @g_pglSwapIntervalEXT
	.comm	_g_pglSwapIntervalSGI,8,3       ; @g_pglSwapIntervalSGI
	.no_dead_strip	_gfx_ctx_x_destroy_resources
.subsections_via_symbols
