	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_egl_create_surface             ## -- Begin function egl_create_surface
	.p2align	4, 0x90
_egl_create_surface:                    ## @egl_create_surface
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rdx
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	_EGL_RENDER_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -36(%rbp)
	movq	_EGL_BACK_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movq	_EGL_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movl	8(%rdi), %edi
	movl	12(%rbx), %esi
	leaq	-36(%rbp), %rcx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_eglCreateWindowSurface
	movl	%eax, 4(%rbx)
	movq	_EGL_NO_SURFACE@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpl	(%rcx), %eax
	je	LBB0_3
## %bb.1:
	movl	(%rbx), %ecx
	movl	8(%rbx), %edi
	movl	%eax, %esi
	movl	%eax, %edx
	callq	_eglMakeCurrent
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_eglGetCurrentContext
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	callq	_RARCH_LOG
	movl	$1, %r14d
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	movl	%r14d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EGL_RENDER_BUFFER,4,2          ## @EGL_RENDER_BUFFER
	.comm	_EGL_BACK_BUFFER,4,2            ## @EGL_BACK_BUFFER
	.comm	_EGL_NONE,4,2                   ## @EGL_NONE
	.comm	_EGL_NO_SURFACE,4,2             ## @EGL_NO_SURFACE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[EGL]: Current context: %p.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_egl_create_surface             ; -- Begin function egl_create_surface
	.p2align	2
_egl_create_surface:                    ; @egl_create_surface
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x2, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _EGL_RENDER_BUFFER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EGL_RENDER_BUFFER@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _EGL_BACK_BUFFER@GOTPAGE
Lloh7:
	ldr	x9, [x9, _EGL_BACK_BUFFER@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #12]
Lloh9:
	adrp	x8, _EGL_NONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EGL_NONE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [sp, #20]
	ldr	w0, [x0, #8]
	ldr	w1, [x19, #12]
	add	x3, sp, #12
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_eglCreateWindowSurface
	str	w0, [x19, #4]
Lloh12:
	adrp	x8, _EGL_NO_SURFACE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EGL_NO_SURFACE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_4
LBB0_2:
	mov	x1, x0
	ldr	w0, [x19, #8]
	ldr	w3, [x19]
	mov	x2, x1
	bl	_eglMakeCurrent
	cbz	w0, LBB0_4
; %bb.3:
	bl	_eglGetCurrentContext
	mov	x1, x0
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
	mov	w0, #1
LBB0_4:
	ldr	x8, [sp, #24]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_EGL_RENDER_BUFFER,4,2          ; @EGL_RENDER_BUFFER
	.comm	_EGL_BACK_BUFFER,4,2            ; @EGL_BACK_BUFFER
	.comm	_EGL_NONE,4,2                   ; @EGL_NONE
	.comm	_EGL_NO_SURFACE,4,2             ; @EGL_NO_SURFACE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[EGL]: Current context: %p.\n"

.subsections_via_symbols
