	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ffmmal_read_frame
_ffmmal_read_frame:                     ## @ffmmal_read_frame
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r13
	cmpl	$0, (%r13)
	je	LBB0_2
## %bb.1:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	jmp	LBB0_32
LBB0_2:
	movq	%rdi, %r15
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	leaq	40(%r13), %r12
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movq	%r12, %rdi
	callq	_atomic_load
	movq	_MAX_DELAYED_FRAMES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 32(%r13)
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 24(%r13)
	je	LBB0_8
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r13), %edi
	movl	$100, %esi
	callq	_mmal_queue_timedwait
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_10
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%r13), %edi
	callq	_mmal_queue_get
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_MMAL_BUFFER_HEADER_FLAG_EOS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	(%rbx), %eax
	setne	%cl
	orl	%ecx, (%r13)
	jne	LBB0_30
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%rbx), %rdi
	movq	_MMAL_EVENT_FORMAT_CHANGED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_12
## %bb.25:                              ##   in Loop: Header=BB0_3 Depth=1
	testq	%rdi, %rdi
	jne	LBB0_26
## %bb.27:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 16(%rbx)
	jne	LBB0_28
LBB0_24:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_mmal_buffer_header_release
	jmp	LBB0_3
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%r13), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_mmal_event_format_changed_get
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_AV_LOG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	leaq	L_.str.1(%rip), %rdx
	xorl	%eax, %eax
	callq	_av_log
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %rdi
	callq	_mmal_port_disable
	testq	%rax, %rax
	jne	LBB0_13
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	8(%r13), %edi
	callq	_mmal_queue_get
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_15 Depth=2
	movq	%rax, %rdi
	callq	_mmal_buffer_header_release
	jmp	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	callq	_mmal_format_copy
	movq	%r15, %rdi
	callq	_ffmal_update_format
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_17
## %bb.19:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax), %rdi
	movq	_output_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mmal_port_enable
	testq	%rax, %rax
	jne	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdi
	callq	_ffmmal_fill_output_port
	testl	%eax, %eax
	js	LBB0_22
## %bb.23:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdi
	callq	_ffmmal_fill_input_port
	movl	%eax, %r14d
	testl	%eax, %eax
	jns	LBB0_24
	jmp	LBB0_17
LBB0_26:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	callq	_av_fourcc2str
	leaq	L_.str.2(%rip), %rdx
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_31
LBB0_28:
	incl	4(%r13)
	movq	%r15, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_ffmal_copy_frame
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_30
## %bb.29:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
LBB0_30:
	xorl	%r13d, %r13d
LBB0_31:
	movq	%rbx, %rdi
	callq	_mmal_buffer_header_release
LBB0_32:
	movl	%r14d, %eax
	testl	%r14d, %r14d
	js	LBB0_34
## %bb.33:
	movq	_AVERROR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_34:
	testq	%r13, %r13
	cmovnel	%eax, %r14d
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_AVERROR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_32
LBB0_9:
	xorl	%r13d, %r13d
	jmp	LBB0_32
LBB0_13:
	movq	%rax, %r13
	jmp	LBB0_31
LBB0_20:
	movq	%rax, %r13
	jmp	LBB0_18
LBB0_22:
	movl	%eax, %r14d
LBB0_17:
	xorl	%r13d, %r13d
LBB0_18:
	testq	%rbx, %rbx
	jne	LBB0_31
	jmp	LBB0_32
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_DELAYED_FRAMES,8,3         ## @MAX_DELAYED_FRAMES
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Did not get output frame from MMAL.\n"

	.comm	_AVERROR_UNKNOWN,4,2            ## @AVERROR_UNKNOWN
	.comm	_MMAL_BUFFER_HEADER_FLAG_EOS,4,2 ## @MMAL_BUFFER_HEADER_FLAG_EOS
	.comm	_MMAL_EVENT_FORMAT_CHANGED,8,3  ## @MMAL_EVENT_FORMAT_CHANGED
	.comm	_AV_LOG_INFO,4,2                ## @AV_LOG_INFO
L_.str.1:                               ## @.str.1
	.asciz	"Changing output format.\n"

	.comm	_output_callback,4,2            ## @output_callback
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
L_.str.2:                               ## @.str.2
	.asciz	"Unknown MMAL event %s on output port\n"

	.no_dead_strip	_ffmmal_read_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ffmmal_read_frame
_ffmmal_read_frame:                     ; @ffmmal_read_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x25, [x0]
	ldr	w8, [x25]
Lloh0:
	adrp	x23, _AVERROR_UNKNOWN@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AVERROR_UNKNOWN@GOTPAGEOFF]
	cbz	w8, LBB0_2
; %bb.1:
	mov	x26, #0
	mov	w19, #0
	b	LBB0_26
LBB0_2:
	mov	x26, x2
	mov	x21, x0
	str	x1, [sp, #24]                   ; 8-byte Folded Spill
	mov	w19, #0
	add	x24, x25, #40
Lloh2:
	adrp	x28, _MAX_DELAYED_FRAMES@GOTPAGE
Lloh3:
	ldr	x28, [x28, _MAX_DELAYED_FRAMES@GOTPAGEOFF]
Lloh4:
	adrp	x22, _MMAL_BUFFER_HEADER_FLAG_EOS@GOTPAGE
Lloh5:
	ldr	x22, [x22, _MMAL_BUFFER_HEADER_FLAG_EOS@GOTPAGEOFF]
Lloh6:
	adrp	x27, _MMAL_EVENT_FORMAT_CHANGED@GOTPAGE
Lloh7:
	ldr	x27, [x27, _MMAL_EVENT_FORMAT_CHANGED@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
	mov	x0, x24
	bl	_atomic_load
	ldr	x8, [x28]
	cmp	x0, x8
	b.gt	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x25, #32]
	cbz	x8, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x25, #24]
	cbz	x8, LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x25, #8]
	mov	w1, #100
	bl	_mmal_queue_timedwait
	mov	x20, x0
	cbnz	x0, LBB0_8
	b	LBB0_27
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x25, #8]
	bl	_mmal_queue_get
	mov	x20, x0
	cbz	x0, LBB0_28
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x20]
	ldr	w9, [x22]
	tst	w9, w8
	cset	w8, ne
	ldr	w9, [x25]
	orr	w8, w9, w8
	str	w8, [x25]
	cbnz	w8, LBB0_24
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x20, #8]
	ldr	x8, [x27]
	cmp	x0, x8
	b.eq	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	cbnz	x0, LBB0_21
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_22
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	bl	_mmal_buffer_header_release
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
	str	x26, [sp, #8]                   ; 8-byte Folded Spill
	ldr	x23, [x25, #16]
	mov	x0, x20
	bl	_mmal_event_format_changed_get
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
Lloh8:
	adrp	x8, _AV_LOG_INFO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_INFO@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x21
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_av_log
	ldr	x8, [x23]
	ldr	x0, [x8]
	bl	_mmal_port_disable
	cbz	x0, LBB0_15
	b	LBB0_29
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=2
	bl	_mmal_buffer_header_release
LBB0_15:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w0, [x25, #8]
	bl	_mmal_queue_get
	cbnz	x0, LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x23]
	ldr	x8, [x8]
	ldr	w0, [x8]
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	ldr	w1, [x8]
	bl	_mmal_format_copy
	mov	x0, x21
	bl	_ffmal_update_format
	mov	x19, x0
	tbnz	w0, #31, LBB0_30
; %bb.17:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x23]
	ldr	x0, [x8]
Lloh13:
	adrp	x8, _output_callback@GOTPAGE
Lloh14:
	ldr	x8, [x8, _output_callback@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_mmal_port_enable
	cbnz	x0, LBB0_31
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_ffmmal_fill_output_port
Lloh16:
	adrp	x23, _AVERROR_UNKNOWN@GOTPAGE
Lloh17:
	ldr	x23, [x23, _AVERROR_UNKNOWN@GOTPAGEOFF]
	tbnz	w0, #31, LBB0_33
; %bb.19:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	bl	_ffmmal_fill_input_port
	mov	x19, x0
	tbnz	w0, #31, LBB0_34
; %bb.20:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x20
	bl	_mmal_buffer_header_release
	ldr	x26, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_3
LBB0_21:
Lloh18:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh20:
	ldr	w22, [x8]
	bl	_av_fourcc2str
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh21:
	adrp	x2, l_.str.2@PAGE
Lloh22:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x1, x22
	bl	_av_log
	b	LBB0_24
LBB0_22:
	ldr	w8, [x25, #4]
	add	w8, w8, #1
	str	w8, [x25, #4]
	mov	x0, x21
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	mov	x2, x20
	bl	_ffmal_copy_frame
	mov	x19, x0
	tbnz	w0, #31, LBB0_24
; %bb.23:
	mov	x9, x26
	mov	x26, #0
	mov	w8, #1
	str	w8, [x9]
	b	LBB0_25
LBB0_24:
	mov	x26, #0
LBB0_25:
	mov	x0, x20
	bl	_mmal_buffer_header_release
LBB0_26:
	cmn	w19, #1
	ccmp	x26, #0, #4, gt
	ldr	w8, [x23]
	csel	w0, w8, w19, ne
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_27:
Lloh23:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x2, l_.str@PAGE
Lloh27:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	bl	_av_log
	mov	x26, #0
	ldr	w19, [x23]
	b	LBB0_26
LBB0_28:
	mov	x26, #0
	b	LBB0_26
LBB0_29:
	mov	x26, x0
Lloh28:
	adrp	x23, _AVERROR_UNKNOWN@GOTPAGE
Lloh29:
	ldr	x23, [x23, _AVERROR_UNKNOWN@GOTPAGEOFF]
	b	LBB0_25
LBB0_30:
	mov	x26, #0
	b	LBB0_32
LBB0_31:
	mov	x26, x0
LBB0_32:
Lloh30:
	adrp	x23, _AVERROR_UNKNOWN@GOTPAGE
Lloh31:
	ldr	x23, [x23, _AVERROR_UNKNOWN@GOTPAGEOFF]
	cbnz	x20, LBB0_25
	b	LBB0_26
LBB0_33:
	mov	x19, x0
LBB0_34:
	mov	x26, #0
	cbnz	x20, LBB0_25
	b	LBB0_26
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_DELAYED_FRAMES,8,3         ; @MAX_DELAYED_FRAMES
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Did not get output frame from MMAL.\n"

	.comm	_AVERROR_UNKNOWN,4,2            ; @AVERROR_UNKNOWN
	.comm	_MMAL_BUFFER_HEADER_FLAG_EOS,4,2 ; @MMAL_BUFFER_HEADER_FLAG_EOS
	.comm	_MMAL_EVENT_FORMAT_CHANGED,8,3  ; @MMAL_EVENT_FORMAT_CHANGED
	.comm	_AV_LOG_INFO,4,2                ; @AV_LOG_INFO
l_.str.1:                               ; @.str.1
	.asciz	"Changing output format.\n"

	.comm	_output_callback,4,2            ; @output_callback
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
l_.str.2:                               ; @.str.2
	.asciz	"Unknown MMAL event %s on output port\n"

	.no_dead_strip	_ffmmal_read_frame
.subsections_via_symbols
