	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_raspitexutil_capture_bgra      ## -- Begin function raspitexutil_capture_bgra
	.p2align	4, 0x90
_raspitexutil_capture_bgra:             ## @raspitexutil_capture_bgra
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rdi), %edx
	movl	4(%rdi), %ecx
	leaq	L_.str(%rip), %rdi
	movl	$4, %r8d
	callq	_vcos_log_trace
	movl	(%rbx), %eax
	imull	4(%rbx), %eax
	shll	$2, %eax
	movslq	%eax, %rdi
	movq	%rdi, (%r14)
	movl	$1, %esi
	callq	_calloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %edx
	movl	4(%rbx), %ecx
	movq	_GL_RGBA@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	movq	_GL_UNSIGNED_BYTE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	movq	%rax, (%rsp)
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_glReadPixels
	xorl	%eax, %eax
	callq	_glGetError
	movq	_GL_NO_ERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.3:
	movq	(%r15), %rdi
	movq	$0, (%r14)
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_free
	jmp	LBB0_5
LBB0_1:
	movq	$0, (%r14)
LBB0_5:
	movq	$0, (%r15)
	movl	$-1, %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: %dx%d %d"

	.comm	_VCOS_FUNCTION,4,2              ## @VCOS_FUNCTION
	.comm	_GL_RGBA,4,2                    ## @GL_RGBA
	.comm	_GL_UNSIGNED_BYTE,4,2           ## @GL_UNSIGNED_BYTE
	.comm	_GL_NO_ERROR,8,3                ## @GL_NO_ERROR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_raspitexutil_capture_bgra      ; -- Begin function raspitexutil_capture_bgra
	.p2align	2
_raspitexutil_capture_bgra:             ; @raspitexutil_capture_bgra
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _VCOS_FUNCTION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VCOS_FUNCTION@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldp	w2, w3, [x0]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	w4, #4
	bl	_vcos_log_trace
	ldp	w8, w9, [x21]
	mul	w8, w8, w9
	lsl	w8, w8, #2
	sxtw	x0, w8
	str	x0, [x20]
	mov	w1, #1
	bl	_calloc
	str	x0, [x19]
	cbz	x0, LBB0_4
; %bb.1:
	mov	x6, x0
	ldp	w2, w3, [x21]
Lloh5:
	adrp	x8, _GL_RGBA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GL_RGBA@GOTPAGEOFF]
Lloh7:
	ldr	w4, [x8]
Lloh8:
	adrp	x8, _GL_UNSIGNED_BYTE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GL_UNSIGNED_BYTE@GOTPAGEOFF]
Lloh10:
	ldr	w5, [x8]
	mov	w0, #0
	mov	w1, #0
	bl	_glReadPixels
	bl	_glGetError
	mov	x8, x0
	mov	w0, #0
Lloh11:
	adrp	x9, _GL_NO_ERROR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _GL_NO_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_6
; %bb.2:
	ldr	x0, [x19]
	str	xzr, [x20]
	cbz	x0, LBB0_5
; %bb.3:
	bl	_free
	b	LBB0_5
LBB0_4:
	str	xzr, [x20]
LBB0_5:
	str	xzr, [x19]
	mov	w0, #-1
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: %dx%d %d"

	.comm	_VCOS_FUNCTION,4,2              ; @VCOS_FUNCTION
	.comm	_GL_RGBA,4,2                    ; @GL_RGBA
	.comm	_GL_UNSIGNED_BYTE,4,2           ; @GL_UNSIGNED_BYTE
	.comm	_GL_NO_ERROR,8,3                ; @GL_NO_ERROR
.subsections_via_symbols
