	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_raspitex_capture               ## -- Begin function raspitex_capture
	.p2align	4, 0x90
_raspitex_capture:                      ## @raspitex_capture
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_vcos_log_trace
	xorl	%r14d, %r14d
	testq	%rbx, %rbx
	je	LBB0_5
## %bb.1:
	testq	%r15, %r15
	je	LBB0_5
## %bb.2:
	leaq	24(%rbx), %r13
	movq	%r13, %rdi
	callq	_vcos_semaphore_wait
	movl	$1, 8(%rbx)
	leaq	40(%rbx), %rdi
	callq	_vcos_semaphore_wait
	movq	16(%rbx), %r12
	movq	32(%rbx), %r14
	movl	$0, 8(%rbx)
	movq	$0, 32(%rbx)
	movq	$0, 16(%rbx)
	movq	%r13, %rdi
	callq	_vcos_semaphore_post
	testq	%r12, %r12
	je	LBB0_4
## %bb.3:
	testq	%r14, %r14
	je	LBB0_4
## %bb.6:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_raspitexutil_brga_to_rgba
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	movq	%r15, %rdi
	movq	%r14, %rcx
	movq	%r12, %r8
	callq	_write_tga
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_fflush
	jmp	LBB0_7
LBB0_4:
	movq	_VCOS_FUNCTION@GOTPCREL(%rip), %r12
LBB0_5:
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_vcos_log_error
	movl	$-1, %ebx
LBB0_7:
	movq	%r14, %rdi
	callq	_free
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: state %p file %p"

	.comm	_VCOS_FUNCTION,4,2              ## @VCOS_FUNCTION
L_.str.1:                               ## @.str.1
	.asciz	"%s: capture failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_raspitex_capture               ; -- Begin function raspitex_capture
	.p2align	2
_raspitex_capture:                      ; @raspitex_capture
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x24, _VCOS_FUNCTION@GOTPAGE
Lloh1:
	ldr	x24, [x24, _VCOS_FUNCTION@GOTPAGEOFF]
	ldr	w1, [x24]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x20
	bl	_vcos_log_trace
	mov	x19, #0
	cbz	x21, LBB0_5
; %bb.1:
	cbz	x20, LBB0_5
; %bb.2:
	add	x23, x21, #24
	mov	x0, x23
	bl	_vcos_semaphore_wait
	mov	w8, #1
	str	w8, [x21, #8]
	add	x0, x21, #40
	bl	_vcos_semaphore_wait
	ldr	x19, [x21, #32]
	ldr	x22, [x21, #16]
	str	wzr, [x21, #8]
	str	xzr, [x21, #32]
	str	xzr, [x21, #16]
	mov	x0, x23
	bl	_vcos_semaphore_post
	cbz	x22, LBB0_5
; %bb.3:
	cbz	x19, LBB0_5
; %bb.4:
	mov	x0, x19
	mov	x1, x22
	bl	_raspitexutil_brga_to_rgba
	ldp	w2, w1, [x21]
	mov	x0, x20
	mov	x3, x19
	mov	x4, x22
	bl	_write_tga
	mov	x21, x0
	mov	x0, x20
	bl	_fflush
	b	LBB0_6
LBB0_5:
	ldr	w1, [x24]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_vcos_log_error
	mov	w21, #-1
LBB0_6:
	mov	x0, x19
	bl	_free
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: state %p file %p"

	.comm	_VCOS_FUNCTION,4,2              ; @VCOS_FUNCTION
l_.str.1:                               ; @.str.1
	.asciz	"%s: capture failed"

.subsections_via_symbols
