	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function encoder_buffer_callback
_encoder_buffer_callback:               ## @encoder_buffer_callback
	.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, %r12
	movq	%rdi, %r15
	movq	8(%rdi), %r14
	testq	%r14, %r14
	je	LBB0_6
## %bb.1:
	xorl	%r13d, %r13d
	cmpl	$0, (%r12)
	je	LBB0_5
## %bb.2:
	cmpq	$0, 16(%r14)
	je	LBB0_5
## %bb.3:
	movq	%r12, %rdi
	callq	_mmal_buffer_header_mem_lock
	movl	(%r12), %edx
	movl	8(%r12), %edi
	movq	16(%r14), %rcx
	movl	$1, %esi
	callq	_fwrite
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mmal_buffer_header_mem_unlock
	cmpl	(%r12), %ebx
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_vcos_log_error
	movl	$1, %r13d
LBB0_5:
	movq	_MMAL_BUFFER_HEADER_FLAG_FRAME_END@GOTPCREL(%rip), %rax
	movq	_MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, 4(%r12)
	movl	$1, %ebx
	cmovel	%r13d, %ebx
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	callq	_vcos_log_error
	xorl	%ebx, %ebx
LBB0_7:
	movq	%r12, %rdi
	callq	_mmal_buffer_header_release
	cmpq	$0, (%r15)
	je	LBB0_11
## %bb.8:
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_mmal_queue_get
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_mmal_port_send_buffer
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_11
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	callq	_vcos_log_error
LBB0_11:
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.13:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vcos_semaphore_post            ## TAILCALL
LBB0_12:
	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	"Unable to write buffer to file - aborting"

	.comm	_MMAL_BUFFER_HEADER_FLAG_FRAME_END,4,2 ## @MMAL_BUFFER_HEADER_FLAG_FRAME_END
	.comm	_MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED,4,2 ## @MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED
L_.str.1:                               ## @.str.1
	.asciz	"Received a encoder buffer callback with no state"

	.comm	_MMAL_SUCCESS,8,3               ## @MMAL_SUCCESS
L_.str.2:                               ## @.str.2
	.asciz	"Unable to return a buffer to the encoder port"

	.no_dead_strip	_encoder_buffer_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function encoder_buffer_callback
_encoder_buffer_callback:               ; @encoder_buffer_callback
	.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	x21, x1
	mov	x20, x0
	ldr	x19, [x0, #8]
	cbz	x19, LBB0_5
; %bb.1:
	ldr	w8, [x21]
	cbz	w8, LBB0_7
; %bb.2:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_7
; %bb.3:
	mov	x0, x21
	bl	_mmal_buffer_header_mem_lock
	ldr	w0, [x21, #8]
	ldr	w2, [x21]
	ldr	x3, [x19, #16]
	mov	w1, #1
	bl	_fwrite
	mov	x22, x0
	mov	x0, x21
	bl	_mmal_buffer_header_mem_unlock
	ldr	w8, [x21]
	cmp	w22, w8
	b.ne	LBB0_6
; %bb.4:
	mov	w8, #0
	b	LBB0_7
LBB0_5:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_vcos_log_error
	mov	w22, #0
	b	LBB0_8
LBB0_6:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_vcos_log_error
	mov	w8, #1
LBB0_7:
	ldr	w9, [x21, #4]
Lloh4:
	adrp	x10, _MMAL_BUFFER_HEADER_FLAG_FRAME_END@GOTPAGE
Lloh5:
	ldr	x10, [x10, _MMAL_BUFFER_HEADER_FLAG_FRAME_END@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
Lloh7:
	adrp	x11, _MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED@GOTPAGE
Lloh8:
	ldr	x11, [x11, _MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED@GOTPAGEOFF]
Lloh9:
	ldr	w11, [x11]
	orr	w10, w11, w10
	tst	w10, w9
	csinc	w22, w8, wzr, eq
LBB0_8:
	mov	x0, x21
	bl	_mmal_buffer_header_release
	ldr	x8, [x20]
	cbz	x8, LBB0_12
; %bb.9:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_mmal_queue_get
	cbz	x0, LBB0_11
; %bb.10:
	mov	x1, x0
	mov	x0, x20
	bl	_mmal_port_send_buffer
Lloh10:
	adrp	x8, _MMAL_SUCCESS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MMAL_SUCCESS@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_12
LBB0_11:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_vcos_log_error
LBB0_12:
	cbz	w22, LBB0_14
; %bb.13:
	mov	x0, x19
	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
	b	_vcos_semaphore_post
LBB0_14:
	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	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to write buffer to file - aborting"

	.comm	_MMAL_BUFFER_HEADER_FLAG_FRAME_END,4,2 ; @MMAL_BUFFER_HEADER_FLAG_FRAME_END
	.comm	_MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED,4,2 ; @MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED
l_.str.1:                               ; @.str.1
	.asciz	"Received a encoder buffer callback with no state"

	.comm	_MMAL_SUCCESS,8,3               ; @MMAL_SUCCESS
l_.str.2:                               ; @.str.2
	.asciz	"Unable to return a buffer to the encoder port"

	.no_dead_strip	_encoder_buffer_callback
.subsections_via_symbols
