	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function raspitexutil_gl_common
_raspitexutil_gl_common:                ## @raspitexutil_gl_common
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_vcos_log_trace
	cmpq	$0, 32(%r12)
	je	LBB0_1
## %bb.2:
	movq	_EGL_DEFAULT_DISPLAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_eglGetDisplay
	movq	%rax, (%r12)
	movq	_EGL_NO_DISPLAY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movl	(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_14
LBB0_1:
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_14
LBB0_4:
	movq	%rax, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_eglInitialize
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movq	(%r12), %rdi
	leaq	-36(%rbp), %rdx
	leaq	-40(%rbp), %r8
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	_eglChooseConfig
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	-36(%rbp), %esi
	movq	(%r12), %rdi
	movq	32(%r12), %rdx
	xorl	%ecx, %ecx
	callq	_eglCreateWindowSurface
	movl	%eax, 24(%r12)
	movq	_EGL_NO_SURFACE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_10
## %bb.9:
	movl	(%rbx), %esi
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_14
LBB0_5:
	movl	(%rbx), %esi
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_14
LBB0_7:
	movl	(%rbx), %esi
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_14
LBB0_10:
	movq	(%r12), %rdi
	movl	-36(%rbp), %esi
	movq	_EGL_NO_CONTEXT@GOTPCREL(%rip), %r15
	movq	(%r15), %rdx
	movq	%r14, %rcx
	callq	_eglCreateContext
	movq	%rax, 8(%r12)
	cmpq	(%r15), %rax
	jne	LBB0_12
## %bb.11:
	movl	(%rbx), %esi
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_14
LBB0_12:
	movq	(%r12), %rdi
	movl	24(%r12), %edx
	movl	%edx, %esi
	movq	%rax, %rcx
	callq	_eglMakeCurrent
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_15
## %bb.13:
	movl	(%rbx), %esi
	leaq	L_.str.7(%rip), %rdi
LBB0_14:
	xorl	%eax, %eax
	callq	_vcos_log_error
	movl	(%rbx), %ebx
	xorl	%eax, %eax
	callq	_eglGetError
	leaq	L_.str.8(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_vcos_log_error
	movq	%r12, %rdi
	callq	*16(%r12)
	movl	$-1, %eax
LBB0_15:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s"

	.comm	_VCOS_FUNCTION,4,2              ## @VCOS_FUNCTION
L_.str.1:                               ## @.str.1
	.asciz	"%s: No native window"

	.comm	_EGL_DEFAULT_DISPLAY,4,2        ## @EGL_DEFAULT_DISPLAY
	.comm	_EGL_NO_DISPLAY,8,3             ## @EGL_NO_DISPLAY
L_.str.2:                               ## @.str.2
	.asciz	"%s: Failed to get EGL display"

L_.str.3:                               ## @.str.3
	.asciz	"%s: eglInitialize failed"

L_.str.4:                               ## @.str.4
	.asciz	"%s: eglChooseConfig failed"

	.comm	_EGL_NO_SURFACE,4,2             ## @EGL_NO_SURFACE
L_.str.5:                               ## @.str.5
	.asciz	"%s: eglCreateWindowSurface failed"

	.comm	_EGL_NO_CONTEXT,8,3             ## @EGL_NO_CONTEXT
L_.str.6:                               ## @.str.6
	.asciz	"%s: eglCreateContext failed"

L_.str.7:                               ## @.str.7
	.asciz	"%s: Failed to activate EGL context"

L_.str.8:                               ## @.str.8
	.asciz	"%s: EGL error 0x%08x"

	.no_dead_strip	_raspitexutil_gl_common
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function raspitexutil_gl_common
_raspitexutil_gl_common:                ; @raspitexutil_gl_common
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x22, _VCOS_FUNCTION@GOTPAGE
Lloh1:
	ldr	x22, [x22, _VCOS_FUNCTION@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_vcos_log_trace
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_3
; %bb.1:
Lloh4:
	adrp	x8, _EGL_DEFAULT_DISPLAY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EGL_DEFAULT_DISPLAY@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_eglGetDisplay
	str	x0, [x19]
Lloh7:
	adrp	x8, _EGL_NO_DISPLAY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EGL_NO_DISPLAY@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:
	ldr	w1, [x22]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_3:
	ldr	w1, [x22]
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_4:
	mov	w1, #0
	mov	w2, #0
	bl	_eglInitialize
	cbz	w0, LBB0_8
; %bb.5:
	ldr	x0, [x19]
	add	x2, sp, #12
	add	x4, sp, #8
	mov	x1, x21
	mov	w3, #1
	bl	_eglChooseConfig
	cbz	w0, LBB0_9
; %bb.6:
	ldr	x0, [x19]
	ldr	w1, [sp, #12]
	ldr	x2, [x19, #32]
	mov	x3, #0
	bl	_eglCreateWindowSurface
	str	w0, [x19, #24]
Lloh14:
	adrp	x8, _EGL_NO_SURFACE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EGL_NO_SURFACE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.7:
	ldr	w1, [x22]
Lloh17:
	adrp	x0, l_.str.5@PAGE
Lloh18:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_15
LBB0_8:
	ldr	w1, [x22]
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_15
LBB0_9:
	ldr	w1, [x22]
Lloh21:
	adrp	x0, l_.str.4@PAGE
Lloh22:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_15
LBB0_10:
	ldr	x0, [x19]
	ldr	w1, [sp, #12]
Lloh23:
	adrp	x21, _EGL_NO_CONTEXT@GOTPAGE
Lloh24:
	ldr	x21, [x21, _EGL_NO_CONTEXT@GOTPAGEOFF]
	ldr	x2, [x21]
	mov	x3, x20
	bl	_eglCreateContext
	str	x0, [x19, #8]
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_12
; %bb.11:
	ldr	w1, [x22]
Lloh25:
	adrp	x0, l_.str.6@PAGE
Lloh26:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_15
LBB0_12:
	mov	x3, x0
	ldr	x0, [x19]
	ldr	w1, [x19, #24]
	mov	x2, x1
	bl	_eglMakeCurrent
	cbz	w0, LBB0_14
; %bb.13:
	mov	w0, #0
	b	LBB0_16
LBB0_14:
	ldr	w1, [x22]
Lloh27:
	adrp	x0, l_.str.7@PAGE
Lloh28:
	add	x0, x0, l_.str.7@PAGEOFF
LBB0_15:
	bl	_vcos_log_error
	ldr	w20, [x22]
	bl	_eglGetError
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh29:
	adrp	x0, l_.str.8@PAGE
Lloh30:
	add	x0, x0, l_.str.8@PAGEOFF
	mov	x1, x20
	bl	_vcos_log_error
	ldr	x8, [x19, #16]
	mov	x0, x19
	blr	x8
	mov	w0, #-1
LBB0_16:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s"

	.comm	_VCOS_FUNCTION,4,2              ; @VCOS_FUNCTION
l_.str.1:                               ; @.str.1
	.asciz	"%s: No native window"

	.comm	_EGL_DEFAULT_DISPLAY,4,2        ; @EGL_DEFAULT_DISPLAY
	.comm	_EGL_NO_DISPLAY,8,3             ; @EGL_NO_DISPLAY
l_.str.2:                               ; @.str.2
	.asciz	"%s: Failed to get EGL display"

l_.str.3:                               ; @.str.3
	.asciz	"%s: eglInitialize failed"

l_.str.4:                               ; @.str.4
	.asciz	"%s: eglChooseConfig failed"

	.comm	_EGL_NO_SURFACE,4,2             ; @EGL_NO_SURFACE
l_.str.5:                               ; @.str.5
	.asciz	"%s: eglCreateWindowSurface failed"

	.comm	_EGL_NO_CONTEXT,8,3             ; @EGL_NO_CONTEXT
l_.str.6:                               ; @.str.6
	.asciz	"%s: eglCreateContext failed"

l_.str.7:                               ; @.str.7
	.asciz	"%s: Failed to activate EGL context"

l_.str.8:                               ; @.str.8
	.asciz	"%s: EGL error 0x%08x"

	.no_dead_strip	_raspitexutil_gl_common
.subsections_via_symbols
