	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_egl_init_context               ## -- Begin function egl_init_context
	.p2align	4, 0x90
_egl_init_context:                      ## @egl_init_context
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	%r8, %r12
	movq	%rcx, %rbx
	movq	%rdx, %r13
	movq	%rdi, %r15
	movl	$0, -44(%rbp)
	movl	%esi, %edi
	movq	%rdx, %rsi
	callq	_get_egl_display
	movq	_EGL_NO_DISPLAY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	callq	_RARCH_ERR
	jmp	LBB0_3
LBB0_4:
	movq	%rax, 16(%r15)
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_eglInitialize
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	movl	(%rbx), %esi
	movl	(%r12), %edx
	leaq	L_.str.1(%rip), %rdi
	callq	_RARCH_LOG
	movq	16(%r15), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	%r14, %rcx
	callq	_eglGetConfigs
	testl	%eax, %eax
	je	LBB0_15
## %bb.6:
	movl	(%r14), %edi
	testl	%edi, %edi
	jle	LBB0_15
## %bb.7:
	shll	$2, %edi
	callq	_malloc
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_17
## %bb.8:
	movq	%rax, %r12
	movq	16(%rbp), %rsi
	movq	16(%r15), %rdi
	movl	(%r14), %ecx
	leaq	-44(%rbp), %r8
	movq	%rax, %rdx
	callq	_eglChooseConfig
	testl	%eax, %eax
	je	LBB0_18
## %bb.9:
	cmpl	$0, -44(%rbp)
	je	LBB0_18
## %bb.10:
	cmpl	$0, (%r14)
	jle	LBB0_20
## %bb.11:
	movq	24(%rbp), %rcx
	xorl	%ebx, %ebx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	testq	%rcx, %rcx
	je	LBB0_19
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	16(%r15), %rsi
	movl	(%r12,%rbx,4), %edx
	movq	%r13, %rdi
	movq	%r15, %r13
	movq	%r14, %r15
	movq	%r12, %r14
	movq	%rcx, %r12
	callq	*%rcx
	movq	%r12, %rcx
	movq	%r14, %r12
	movq	%r15, %r14
	movq	%r13, %r15
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	testq	%rax, %rax
	jne	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_12
	jmp	LBB0_21
LBB0_3:
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_15:
	leaq	L_.str.2(%rip), %rdi
LBB0_16:
	callq	_RARCH_ERR
LBB0_17:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_16
LBB0_19:
	movl	(%r12,%rbx,4), %eax
	movl	%eax, 8(%r15)
	jmp	LBB0_21
LBB0_20:
	xorl	%ebx, %ebx
LBB0_21:
	movq	%r12, %rdi
	callq	_free
	cmpl	(%r14), %ebx
	jne	LBB0_23
## %bb.22:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_2
LBB0_23:
	movq	_g_egl_major@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r15)
	movq	_g_egl_minor@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	$1, %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_EGL_NO_DISPLAY,8,3             ## @EGL_NO_DISPLAY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[EGL]: Couldn't get EGL display.\n"

L_.str.1:                               ## @.str.1
	.asciz	"[EGL]: EGL version: %d.%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"[EGL]: No configs to choose from.\n"

L_.str.3:                               ## @.str.3
	.asciz	"[EGL]: No EGL configs with appropriate attributes.\n"

L_.str.4:                               ## @.str.4
	.asciz	"[EGL]: No EGL config found which satifies requirements.\n"

	.comm	_g_egl_major,4,2                ## @g_egl_major
	.comm	_g_egl_minor,4,2                ## @g_egl_minor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_egl_init_context               ; -- Begin function egl_init_context
	.p2align	2
_egl_init_context:                      ; @egl_init_context
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x7
	mov	x23, x6
	mov	x20, x5
	mov	x24, x4
	mov	x25, x3
	mov	x22, x2
	mov	x19, x0
	str	wzr, [sp, #12]
	mov	x0, x1
	mov	x1, x2
	bl	_get_egl_display
Lloh0:
	adrp	x8, _EGL_NO_DISPLAY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EGL_NO_DISPLAY@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_2:
	str	x0, [x19, #16]
	mov	x1, x25
	mov	x2, x24
	bl	_eglInitialize
	cbz	w0, LBB0_15
; %bb.3:
	ldr	w1, [x25]
	ldr	w2, [x24]
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_LOG
	ldr	x0, [x19, #16]
	mov	x1, #0
	mov	w2, #0
	mov	x3, x20
	bl	_eglGetConfigs
	cbz	w0, LBB0_13
; %bb.4:
	ldr	w8, [x20]
	cmp	w8, #0
	b.le	LBB0_13
; %bb.5:
	lsl	w0, w8, #2
	bl	_malloc
	cbz	x0, LBB0_15
; %bb.6:
	mov	x24, x0
	ldr	x0, [x19, #16]
	ldr	w3, [x20]
	add	x4, sp, #12
	mov	x1, x23
	mov	x2, x24
	bl	_eglChooseConfig
	cbz	w0, LBB0_16
; %bb.7:
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_16
; %bb.8:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.9:
	mov	x23, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	cbz	x21, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x1, [x19, #16]
	ldr	w2, [x24, x23, lsl #2]
	mov	x0, x22
	blr	x21
	cbnz	x0, LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x20]
	cmp	x23, x8
	b.lt	LBB0_10
	b	LBB0_19
LBB0_13:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_14:
	bl	_RARCH_ERR
	mov	w0, #0
LBB0_15:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_16:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_14
LBB0_17:
	ldr	w8, [x24, x23, lsl #2]
	str	w8, [x19, #8]
	b	LBB0_19
LBB0_18:
	mov	w23, #0
LBB0_19:
	mov	x0, x24
	bl	_free
	ldr	w8, [x20]
	cmp	w23, w8
	b.ne	LBB0_21
; %bb.20:
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_14
LBB0_21:
Lloh13:
	adrp	x8, _g_egl_major@GOTPAGE
Lloh14:
	ldr	x8, [x8, _g_egl_major@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _g_egl_minor@GOTPAGE
Lloh17:
	ldr	x9, [x9, _g_egl_minor@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	stp	w9, w8, [x19]
	mov	w0, #1
	b	LBB0_15
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_EGL_NO_DISPLAY,8,3             ; @EGL_NO_DISPLAY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[EGL]: Couldn't get EGL display.\n"

l_.str.1:                               ; @.str.1
	.asciz	"[EGL]: EGL version: %d.%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"[EGL]: No configs to choose from.\n"

l_.str.3:                               ; @.str.3
	.asciz	"[EGL]: No EGL configs with appropriate attributes.\n"

l_.str.4:                               ; @.str.4
	.asciz	"[EGL]: No EGL config found which satifies requirements.\n"

	.comm	_g_egl_major,4,2                ; @g_egl_major
	.comm	_g_egl_minor,4,2                ; @g_egl_minor
.subsections_via_symbols
