	.file	"extr_RaspiTexUtil.c_raspitexutil_capture_bgra.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s: %dx%d %d"
	.text
	.p2align 4
	.globl	raspitexutil_capture_bgra
	.type	raspitexutil_capture_bgra, @function
raspitexutil_capture_bgra:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r8d, 4
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rsi
	mov	ecx, DWORD PTR 4[rdi]
	mov	edx, DWORD PTR [rdi]
	mov	esi, DWORD PTR VCOS_FUNCTION[rip]
	lea	rdi, .LC0[rip]
	call	vcos_log_trace@PLT
	mov	edi, DWORD PTR [r12]
	imul	edi, DWORD PTR 4[r12]
	mov	esi, 1
	sal	edi, 2
	movsx	rdi, edi
	mov	QWORD PTR 0[rbp], rdi
	call	calloc@PLT
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	je	.L2
	sub	rsp, 8
	.cfi_def_cfa_offset 40
	mov	ecx, DWORD PTR 4[r12]
	mov	edx, DWORD PTR [r12]
	xor	esi, esi
	push	rax
	.cfi_def_cfa_offset 48
	mov	r9d, DWORD PTR GL_UNSIGNED_BYTE[rip]
	xor	edi, edi
	mov	r8d, DWORD PTR GL_RGBA[rip]
	call	glReadPixels@PLT
	xor	eax, eax
	call	glGetError@PLT
	cmp	rax, QWORD PTR GL_NO_ERROR[rip]
	pop	rdx
	.cfi_def_cfa_offset 40
	pop	rcx
	.cfi_def_cfa_offset 32
	jne	.L11
	xor	eax, eax
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	rdi, QWORD PTR [rbx]
	mov	QWORD PTR 0[rbp], 0
	test	rdi, rdi
	je	.L4
	call	free@PLT
.L4:
	mov	QWORD PTR [rbx], 0
	mov	eax, -1
	jmp	.L1
.L2:
	mov	QWORD PTR 0[rbp], 0
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	raspitexutil_capture_bgra, .-raspitexutil_capture_bgra
	.comm	VCOS_FUNCTION,4,4
	.comm	GL_UNSIGNED_BYTE,4,4
	.comm	GL_RGBA,4,4
	.comm	GL_NO_ERROR,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_RaspiTexUtil.c_raspitexutil_capture_bgra.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%s: %dx%d %d\000"
	.text
	.align	2
	.global	raspitexutil_capture_bgra
	.syntax unified
	.arm
	.fpu softvfp
	.type	raspitexutil_capture_bgra, %function
raspitexutil_capture_bgra:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	mov	r4, r0
	mov	r0, #4
	mov	r6, r2
	ldm	r4, {r2, r3}
	sub	sp, sp, #20
	mov	r5, r1
	ldr	r1, .L9
	str	r0, [sp]
	ldr	r1, [r1]
	ldr	r0, .L9+4
	bl	vcos_log_trace
	ldr	r7, [r4]
	ldr	r4, [r4, #4]
	mov	r1, #1
	mul	r0, r4, r7
	lsl	r0, r0, #2
	str	r0, [r6]
	bl	calloc
	cmp	r0, #0
	str	r0, [r5]
	beq	.L5
	mov	r1, #0
	ldr	r2, .L9+8
	ldr	r3, .L9+12
	ldr	lr, [r2]
	ldr	ip, [r3]
	mov	r2, r7
	mov	r3, r4
	stm	sp, {ip, lr}
	str	r0, [sp, #8]
	mov	r0, r1
	bl	glReadPixels
	bl	glGetError
	ldr	r3, .L9+16
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L5
	mov	r0, #0
.L1:
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L5:
	mov	r3, #0
	ldr	r0, [r5]
	str	r3, [r6]
	cmp	r0, r3
	beq	.L4
	bl	free
.L4:
	mov	r3, #0
	mvn	r0, #0
	str	r3, [r5]
	b	.L1
.L10:
	.align	2
.L9:
	.word	VCOS_FUNCTION
	.word	.LC0
	.word	GL_UNSIGNED_BYTE
	.word	GL_RGBA
	.word	GL_NO_ERROR
	.size	raspitexutil_capture_bgra, .-raspitexutil_capture_bgra
	.comm	VCOS_FUNCTION,4,4
	.comm	GL_UNSIGNED_BYTE,4,4
	.comm	GL_RGBA,4,4
	.comm	GL_NO_ERROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
