	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_ctx_vc_image_buffer_init
_gfx_ctx_vc_image_buffer_init:          ## @gfx_ctx_vc_image_buffer_init
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_EGL_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movl	(%rdi), %eax
	movl	%eax, -76(%rbp)
	movq	_EGL_HEIGHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -72(%rbp)
	movl	%eax, -68(%rbp)
	movq	_EGL_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	_vc_api@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	_GFX_CTX_OPENVG_API@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	je	LBB0_15
## %bb.1:
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_egl_get_proc_address
	movq	_peglCreateImageKHR@GOTPCREL(%rip), %r13
	movq	%rax, (%r13)
	leaq	L_.str.1(%rip), %rdi
	callq	_egl_get_proc_address
	movq	_peglDestroyImageKHR@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	cmpq	$0, (%r13)
	je	LBB0_15
## %bb.2:
	testq	%rax, %rax
	je	LBB0_15
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_gfx_ctx_vc_egl_query_extension
	testl	%eax, %eax
	je	LBB0_15
## %bb.4:
	movq	_RARCH_SCALE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	imull	(%r14), %eax
	movl	%eax, (%r15)
	movq	_EGL_OPENVG_API@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_eglBindAPI
	movl	40(%r15), %edi
	movl	44(%r15), %esi
	leaq	-80(%rbp), %rdx
	callq	_eglCreatePbufferSurface
	movq	%rax, 8(%r15)
	movq	_EGL_NO_SURFACE@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_10
LBB0_6:
	movl	40(%r15), %edi
	movl	44(%r15), %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_eglCreateContext
	movq	%rax, 16(%r15)
	movq	_EGL_NO_CONTEXT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_10
LBB0_8:
	movl	40(%r15), %edi
	movq	8(%r15), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rcx
	callq	_eglMakeCurrent
	movq	_EGL_FALSE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.9:
	leaq	L_.str.5(%rip), %rdi
LBB0_10:
	callq	_RARCH_ERR
	movq	8(%r15), %rsi
	cmpq	(%rbx), %rsi
	je	LBB0_12
## %bb.11:
	movl	40(%r15), %edi
	callq	_eglDestroySurface
	movq	(%rbx), %rax
	movq	%rax, 8(%r15)
LBB0_12:
	movq	16(%r15), %rsi
	movq	_EGL_NO_CONTEXT@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rsi
	je	LBB0_14
## %bb.13:
	movl	40(%r15), %edi
	callq	_eglDestroyContext
	movq	(%rbx), %rax
	movq	%rax, 8(%r15)
LBB0_14:
	movq	(%r12), %rsi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_gfx_ctx_vc_bind_api
	movl	40(%r15), %edi
	movq	24(%r15), %rdx
	movq	32(%r15), %rcx
	movq	%rdx, %rsi
	callq	_eglMakeCurrent
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_18
## %bb.16:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	(%r12), %rsi
	xorl	%edi, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_gfx_ctx_vc_bind_api
	movl	40(%r15), %edi
	movq	24(%r15), %rdx
	movq	32(%r15), %rcx
	movq	%rdx, %rsi
	callq	_eglMakeCurrent
	movl	4(%r14), %eax
	movl	%eax, 48(%r15)
	movl	$1, %ebx
	jmp	LBB0_15
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EGL_WIDTH,4,2                  ## @EGL_WIDTH
	.comm	_EGL_HEIGHT,4,2                 ## @EGL_HEIGHT
	.comm	_EGL_NONE,4,2                   ## @EGL_NONE
	.comm	_vc_api,8,3                     ## @vc_api
	.comm	_GFX_CTX_OPENVG_API,8,3         ## @GFX_CTX_OPENVG_API
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"eglCreateImageKHR"

	.comm	_peglCreateImageKHR,8,3         ## @peglCreateImageKHR
L_.str.1:                               ## @.str.1
	.asciz	"eglDestroyImageKHR"

	.comm	_peglDestroyImageKHR,8,3        ## @peglDestroyImageKHR
L_.str.2:                               ## @.str.2
	.asciz	"KHR_image"

	.comm	_RARCH_SCALE_BASE,4,2           ## @RARCH_SCALE_BASE
	.comm	_EGL_OPENVG_API,4,2             ## @EGL_OPENVG_API
	.comm	_EGL_NO_SURFACE,8,3             ## @EGL_NO_SURFACE
L_.str.3:                               ## @.str.3
	.asciz	"[VideoCore:EGLImage] failed to create PbufferSurface\n"

	.comm	_EGL_NO_CONTEXT,8,3             ## @EGL_NO_CONTEXT
L_.str.4:                               ## @.str.4
	.asciz	"[VideoCore:EGLImage] failed to create context\n"

	.comm	_EGL_FALSE,8,3                  ## @EGL_FALSE
L_.str.5:                               ## @.str.5
	.asciz	"[VideoCore:EGLImage] failed to make context current\n"

	.no_dead_strip	_gfx_ctx_vc_image_buffer_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_ctx_vc_image_buffer_init
_gfx_ctx_vc_image_buffer_init:          ; @gfx_ctx_vc_image_buffer_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
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_WIDTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EGL_WIDTH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x0]
	stp	w8, w9, [sp, #4]
Lloh6:
	adrp	x8, _EGL_HEIGHT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EGL_HEIGHT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	stp	w8, w9, [sp, #12]
Lloh9:
	adrp	x8, _EGL_NONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EGL_NONE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x21, _vc_api@GOTPAGE
Lloh13:
	ldr	x21, [x21, _vc_api@GOTPAGEOFF]
	str	w8, [sp, #20]
	ldr	x8, [x21]
Lloh14:
	adrp	x9, _GFX_CTX_OPENVG_API@GOTPAGE
Lloh15:
	ldr	x9, [x9, _GFX_CTX_OPENVG_API@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_15
; %bb.1:
	mov	x20, x1
	mov	x19, x0
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_egl_get_proc_address
Lloh19:
	adrp	x22, _peglCreateImageKHR@GOTPAGE
Lloh20:
	ldr	x22, [x22, _peglCreateImageKHR@GOTPAGEOFF]
	str	x0, [x22]
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_egl_get_proc_address
	mov	x8, x0
	mov	w0, #0
Lloh23:
	adrp	x9, _peglDestroyImageKHR@GOTPAGE
Lloh24:
	ldr	x9, [x9, _peglDestroyImageKHR@GOTPAGEOFF]
Lloh25:
	str	x8, [x9]
	ldr	x9, [x22]
	cbz	x9, LBB0_16
; %bb.2:
	cbz	x8, LBB0_16
; %bb.3:
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_gfx_ctx_vc_egl_query_extension
	cbz	w0, LBB0_16
; %bb.4:
	ldr	w8, [x20]
Lloh28:
	adrp	x9, _RARCH_SCALE_BASE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _RARCH_SCALE_BASE@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	mul	w8, w9, w8
	str	w8, [x19]
Lloh31:
	adrp	x8, _EGL_OPENVG_API@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EGL_OPENVG_API@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	bl	_eglBindAPI
	ldp	w0, w1, [x19, #40]
	add	x2, sp, #4
	bl	_eglCreatePbufferSurface
	str	x0, [x19, #8]
Lloh34:
	adrp	x23, _EGL_NO_SURFACE@GOTPAGE
Lloh35:
	ldr	x23, [x23, _EGL_NO_SURFACE@GOTPAGEOFF]
	ldr	x8, [x23]
Lloh36:
	adrp	x22, _EGL_NO_CONTEXT@GOTPAGE
Lloh37:
	ldr	x22, [x22, _EGL_NO_CONTEXT@GOTPAGEOFF]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.5:
Lloh38:
	adrp	x0, l_.str.3@PAGE
Lloh39:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_6:
	ldp	w0, w1, [x19, #40]
	mov	x2, #0
	mov	x3, #0
	bl	_eglCreateContext
	str	x0, [x19, #16]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:
Lloh40:
	adrp	x0, l_.str.4@PAGE
Lloh41:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_10
LBB0_8:
	mov	x3, x0
	ldr	w0, [x19, #40]
	ldr	x1, [x19, #8]
	mov	x2, x1
	bl	_eglMakeCurrent
Lloh42:
	adrp	x8, _EGL_FALSE@GOTPAGE
Lloh43:
	ldr	x8, [x8, _EGL_FALSE@GOTPAGEOFF]
Lloh44:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_18
; %bb.9:
Lloh45:
	adrp	x0, l_.str.5@PAGE
Lloh46:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_10:
	bl	_RARCH_ERR
	ldr	x1, [x19, #8]
	ldr	x8, [x23]
	cmp	x1, x8
	b.eq	LBB0_12
; %bb.11:
	ldr	w0, [x19, #40]
	bl	_eglDestroySurface
	ldr	x8, [x23]
	str	x8, [x19, #8]
LBB0_12:
	ldr	x1, [x19, #16]
	ldr	x8, [x22]
	cmp	x1, x8
	b.eq	LBB0_14
; %bb.13:
	ldr	w0, [x19, #40]
	bl	_eglDestroyContext
	ldr	x8, [x22]
	str	x8, [x19, #8]
LBB0_14:
	ldr	x1, [x21]
	mov	x0, #0
	mov	w2, #0
	mov	w3, #0
	bl	_gfx_ctx_vc_bind_api
	ldr	w0, [x19, #40]
	ldp	x1, x3, [x19, #24]
	mov	x2, x1
	bl	_eglMakeCurrent
LBB0_15:
	mov	w0, #0
LBB0_16:
	ldr	x8, [sp, #24]
Lloh47:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh48:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.17:
	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
	add	sp, sp, #96
	ret
LBB0_18:
	ldr	x1, [x21]
	mov	x0, #0
	mov	w2, #0
	mov	w3, #0
	bl	_gfx_ctx_vc_bind_api
	ldr	w0, [x19, #40]
	ldp	x1, x3, [x19, #24]
	mov	x2, x1
	bl	_eglMakeCurrent
	ldr	w8, [x20, #4]
	str	w8, [x19, #48]
	mov	w0, #1
	b	LBB0_16
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_EGL_WIDTH,4,2                  ; @EGL_WIDTH
	.comm	_EGL_HEIGHT,4,2                 ; @EGL_HEIGHT
	.comm	_EGL_NONE,4,2                   ; @EGL_NONE
	.comm	_vc_api,8,3                     ; @vc_api
	.comm	_GFX_CTX_OPENVG_API,8,3         ; @GFX_CTX_OPENVG_API
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"eglCreateImageKHR"

	.comm	_peglCreateImageKHR,8,3         ; @peglCreateImageKHR
l_.str.1:                               ; @.str.1
	.asciz	"eglDestroyImageKHR"

	.comm	_peglDestroyImageKHR,8,3        ; @peglDestroyImageKHR
l_.str.2:                               ; @.str.2
	.asciz	"KHR_image"

	.comm	_RARCH_SCALE_BASE,4,2           ; @RARCH_SCALE_BASE
	.comm	_EGL_OPENVG_API,4,2             ; @EGL_OPENVG_API
	.comm	_EGL_NO_SURFACE,8,3             ; @EGL_NO_SURFACE
l_.str.3:                               ; @.str.3
	.asciz	"[VideoCore:EGLImage] failed to create PbufferSurface\n"

	.comm	_EGL_NO_CONTEXT,8,3             ; @EGL_NO_CONTEXT
l_.str.4:                               ; @.str.4
	.asciz	"[VideoCore:EGLImage] failed to create context\n"

	.comm	_EGL_FALSE,8,3                  ; @EGL_FALSE
l_.str.5:                               ; @.str.5
	.asciz	"[VideoCore:EGLImage] failed to make context current\n"

	.no_dead_strip	_gfx_ctx_vc_image_buffer_init
.subsections_via_symbols
