	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gx_priv_restore                ## -- Begin function gx_priv_restore
	.p2align	4, 0x90
_gx_priv_restore:                       ## @gx_priv_restore
	.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	_vcos_thread_current
	movl	%eax, %edi
	callq	_vcos_thread_get_name
	movl	24(%rbx), %ecx
	movl	16(%rbx), %r8d
	movl	(%rbx), %edx
	movl	8(%rbx), %r9d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_GX_TRACE
	movq	_display@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_EGL_NO_SURFACE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_EGL_NO_CONTEXT@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rsi
	callq	_eglMakeCurrent
	movl	%eax, %edi
	callq	_vcos_assert
	movl	32(%rbx), %edi
	callq	_eglBindAPI
	movl	%eax, %edi
	callq	_vcos_assert
	movl	(%r14), %edi
	movq	24(%rbx), %rsi
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	callq	_eglMakeCurrent
	movl	%eax, %edi
	callq	_vcos_assert
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	$0, (%rax)
LBB0_2:
	movq	_lock@GOTPCREL(%rip), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_vcos_mutex_unlock              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"gx_priv_restore: eglMakeCurrent: %s, res %x draw_surface %x, surface %x, cxt %x"

	.comm	_display,4,2                    ## @display
	.comm	_EGL_NO_SURFACE,8,3             ## @EGL_NO_SURFACE
	.comm	_EGL_NO_CONTEXT,8,3             ## @EGL_NO_CONTEXT
	.comm	_lock,4,2                       ## @lock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gx_priv_restore                ; -- Begin function gx_priv_restore
	.p2align	2
_gx_priv_restore:                       ; @gx_priv_restore
	.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	_vcos_thread_current
	bl	_vcos_thread_get_name
	mov	x1, x0
	ldr	w2, [x19]
	ldr	w3, [x19, #24]
	ldr	w4, [x19, #16]
	ldr	w5, [x19, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_GX_TRACE
Lloh2:
	adrp	x20, _display@GOTPAGE
Lloh3:
	ldr	x20, [x20, _display@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh4:
	adrp	x8, _EGL_NO_SURFACE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EGL_NO_SURFACE@GOTPAGEOFF]
Lloh6:
	ldr	x1, [x8]
Lloh7:
	adrp	x8, _EGL_NO_CONTEXT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EGL_NO_CONTEXT@GOTPAGEOFF]
Lloh9:
	ldr	x3, [x8]
	mov	x2, x1
	bl	_eglMakeCurrent
	bl	_vcos_assert
	ldr	w0, [x19, #32]
	bl	_eglBindAPI
	bl	_vcos_assert
	ldr	w0, [x20]
	ldp	x2, x1, [x19, #16]
	ldr	x3, [x19, #8]
	bl	_eglMakeCurrent
	bl	_vcos_assert
	ldr	x8, [x19]
	cbz	x8, LBB0_2
; %bb.1:
	str	xzr, [x8]
LBB0_2:
Lloh10:
	adrp	x0, _lock@GOTPAGE
Lloh11:
	ldr	x0, [x0, _lock@GOTPAGEOFF]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_vcos_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gx_priv_restore: eglMakeCurrent: %s, res %x draw_surface %x, surface %x, cxt %x"

	.comm	_display,4,2                    ; @display
	.comm	_EGL_NO_SURFACE,8,3             ; @EGL_NO_SURFACE
	.comm	_EGL_NO_CONTEXT,8,3             ; @EGL_NO_CONTEXT
	.comm	_lock,4,2                       ; @lock
.subsections_via_symbols
