	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function spdif_do_processing
_spdif_do_processing:                   ## @spdif_do_processing
	.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), %rax
	movq	(%rax), %r13
	movq	(%r13), %rax
	movq	8(%rax), %rax
	xorl	%r12d, %r12d
	cmpq	$0, 8(%rax)
	jne	LBB0_23
## %bb.1:
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	(%rax), %r14
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	callq	_mmal_queue_get
	testq	%rax, %rax
	je	LBB0_23
## %bb.2:
	movq	%rax, %r15
	cmpq	$0, 40(%rax)
	je	LBB0_9
## %bb.3:
	movq	%r15, %rdi
	callq	_mmal_event_format_changed_get
	testq	%rax, %rax
	je	LBB0_14
## %bb.4:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	8(%r13), %rdi
	movl	(%rax), %esi
	callq	_mmal_format_full_copy
	movq	%rax, (%r14)
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_6
## %bb.5:
	movq	(%r13), %rax
	movq	%r13, %rdi
	callq	*(%rax)
	movq	%rax, (%r14)
	movq	(%r12), %rcx
LBB0_6:
	cmpq	%rcx, %rax
	je	LBB0_15
## %bb.7:
	movl	16(%r13), %esi
	leaq	L_.str(%rip), %rdi
	movq	%r13, %rdx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_LOG_ERROR
	movq	(%r14), %rsi
	movq	%rbx, %rdi
	callq	_mmal_event_error_send
	cmpq	(%r12), %rax
	je	LBB0_15
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG_ERROR
	jmp	LBB0_15
LBB0_9:
	movq	(%r14), %rax
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
## %bb.10:
	movl	(%r15), %esi
	movl	4(%r15), %eax
	movl	%esi, %ecx
	orl	%eax, %ecx
	je	LBB0_13
## %bb.11:
	movq	_MMAL_BUFFER_HEADER_FLAG_CONFIG@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_18
## %bb.12:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG_DEBUG
	movl	$0, (%r15)
LBB0_13:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_14:
	movl	40(%r15), %esi
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	16(%r13), %edx
	leaq	L_.str.2(%rip), %rdi
	movq	%r13, %rcx
	xorl	%eax, %eax
	callq	_LOG_ERROR
LBB0_15:
	movl	$0, (%r15)
	movq	%r13, %rdi
LBB0_16:
	movq	%r15, %rsi
LBB0_17:
	callq	_mmal_port_buffer_header_callback
	movl	$1, %r12d
	jmp	LBB0_23
LBB0_18:
	movq	(%r13), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	callq	_mmal_queue_get
	testq	%rax, %rax
	je	LBB0_21
## %bb.19:
	movq	8(%r13), %rcx
	movq	(%rcx), %rdx
	movq	_MMAL_ENCODING_EAC3@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rdx
	jne	LBB0_24
## %bb.20:
	movq	_SPDIF_EAC3_FRAME_SIZE@GOTPCREL(%rip), %rcx
	jmp	LBB0_25
LBB0_21:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
LBB0_22:
	callq	_mmal_queue_put_back
LBB0_23:
	movl	%r12d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movq	_SPDIF_AC3_FRAME_SIZE@GOTPCREL(%rip), %rcx
LBB0_25:
	movl	(%rcx), %esi
	cmpl	%esi, 8(%rax)
	jae	LBB0_29
## %bb.26:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_MMAL_EINVAL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%rsi, (%r14)
	movq	%rbx, %rdi
	callq	_mmal_event_error_send
	movq	_MMAL_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_28
## %bb.27:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG_ERROR
LBB0_28:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_mmal_queue_put_back
	movq	(%r13), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_22
LBB0_29:
	movl	(%r15), %edx
	testl	%edx, %edx
	je	LBB0_45
LBB0_30:
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movl	32(%r15), %esi
	movq	%rax, %r14
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG_DEBUG
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_mmal_buffer_header_mem_lock
	movq	%r15, %rdi
	callq	_mmal_buffer_header_mem_lock
	movl	(%r15), %esi
	cmpl	$4, %esi
	jg	LBB0_33
## %bb.31:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG_ERROR
LBB0_32:
	movq	%r15, %rdi
	callq	_mmal_buffer_header_mem_unlock
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_mmal_buffer_header_mem_unlock
	movl	$0, (%r15)
	movq	(%r13), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_mmal_queue_put_back
	jmp	LBB0_13
LBB0_33:
	movslq	24(%r15), %rdi
	shlq	$2, %rdi
	addq	16(%r15), %rdi
	movl	(%rdi), %edx
	cmpl	$11, %edx
	je	LBB0_37
## %bb.34:
	cmpl	$119, %edx
	je	LBB0_37
## %bb.35:
	movl	4(%rdi), %ecx
	cmpl	$11, %ecx
	je	LBB0_37
## %bb.36:
	cmpl	$119, %ecx
	jne	LBB0_51
LBB0_37:
	movl	$192, %eax
	andl	16(%rdi), %eax
	cmpl	$128, %eax
	movl	$32000, %ecx                    ## imm = 0x7D00
	movl	$48000, %edx                    ## imm = 0xBB80
	cmovel	%ecx, %edx
	cmpl	$64, %eax
	movl	$44100, %r12d                   ## imm = 0xAC44
	cmovnel	%edx, %r12d
	movq	8(%r13), %rax
	movq	8(%rax), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r12d
	jne	LBB0_47
## %bb.38:
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leal	-8(%rax), %ebx
	cmpl	%ebx, %esi
	jbe	LBB0_40
## %bb.39:
	leaq	L_.str.8(%rip), %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_LOG_ERROR
	movl	(%r15), %esi
LBB0_40:
	movl	%esi, %edi
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	callq	_MMAL_MIN
	movl	%eax, %ebx
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	16(%r12), %rdi
	leaq	_spdif_do_processing.ac3_spdif_header(%rip), %rsi
	movl	$24, %edx
	callq	_memcpy
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movl	20(%rsi), %eax
	andl	$7, %eax
	movq	16(%r12), %rdi
	movl	%eax, 20(%rdi)
	movzbl	%r14b, %eax
	movl	%eax, 24(%rdi)
	movl	%r14d, %eax
	shrl	$8, %eax
	movl	%eax, 28(%rdi)
	cmpl	$11, (%rsi)
	jne	LBB0_48
## %bb.41:
	incl	%ebx
	cmpl	$3, %ebx
	jb	LBB0_44
## %bb.42:
	cmpl	$2, %r14d
	movl	$1, %eax
	cmovael	%r14d, %eax
	addq	%rax, %rax
	xorl	%ecx, %ecx
LBB0_43:                                ## =>This Inner Loop Header: Depth=1
	movl	24(%r15), %edx
	addl	%ecx, %edx
	incl	%edx
	movl	(%rsi,%rdx,4), %edx
	leal	8(%rcx), %ebx
	movl	%edx, (%rdi,%rbx,4)
	movl	24(%r15), %edx
	addl	%ecx, %edx
	movl	(%rsi,%rdx,4), %edx
	leal	9(%rcx), %ebx
	movl	%edx, (%rdi,%rbx,4)
	addq	$2, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_43
LBB0_44:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_49
LBB0_45:
	movl	4(%r15), %ecx
	testl	%ecx, %ecx
	je	LBB0_30
## %bb.46:
	movl	$0, (%rax)
	jmp	LBB0_50
LBB0_47:
	leaq	L_.str.7(%rip), %rdi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_LOG_INFO
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	8(%r14), %rdx
	movq	8(%rdx), %rax
	movl	%r12d, (%rax)
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_spdif_send_event_format_changed
	movq	%r15, %rdi
	callq	_mmal_buffer_header_mem_unlock
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_mmal_buffer_header_mem_unlock
	movq	(%r14), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_mmal_queue_put_back
	movq	(%r13), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_mmal_queue_put_back
	xorl	%r12d, %r12d
	jmp	LBB0_23
LBB0_48:
	addq	$32, %rdi
	movl	(%r15), %edx
	callq	_memcpy
	movq	16(%r12), %rdi
LBB0_49:
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	addl	%r14d, %r14d
	leaq	(%rdi,%r14,4), %rdi
	addq	$32, %rdi
	subl	%r14d, %edx
	xorl	%esi, %esi
	callq	_memset
	movq	%r15, %rdi
	callq	_mmal_buffer_header_mem_unlock
	movq	%r12, %rdi
	callq	_mmal_buffer_header_mem_unlock
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, (%r12)
	movl	4(%r15), %ecx
	movq	%r12, %rax
LBB0_50:
	movl	$0, 24(%rax)
	movl	%ecx, 4(%rax)
	movq	32(%r15), %rcx
	movq	%rcx, 32(%rax)
	movl	28(%r15), %ecx
	movl	%ecx, 28(%rax)
	movl	$0, (%r15)
	movq	%rax, %rbx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_mmal_port_buffer_header_callback
	movq	%r13, %rdi
	movq	%rbx, %rsi
	jmp	LBB0_17
LBB0_51:
	movl	8(%rdi), %r8d
	movl	12(%rdi), %r9d
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_LOG_ERROR
	jmp	LBB0_32
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @spdif_do_processing.ac3_spdif_header
_spdif_do_processing.ac3_spdif_header:
	.long	114                             ## 0x72
	.long	248                             ## 0xf8
	.long	31                              ## 0x1f
	.long	78                              ## 0x4e
	.long	1                               ## 0x1
	.long	0                               ## 0x0

	.comm	_MMAL_SUCCESS,8,3               ## @MMAL_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"format not set on port %s %p (%i)"

L_.str.1:                               ## @.str.1
	.asciz	"unable to send an error event buffer"

L_.str.2:                               ## @.str.2
	.asciz	"discarding event %i on port %s %p"

	.comm	_MMAL_BUFFER_HEADER_FLAG_CONFIG,4,2 ## @MMAL_BUFFER_HEADER_FLAG_CONFIG
L_.str.3:                               ## @.str.3
	.asciz	"config buffer %ibytes"

	.comm	_SPDIF_AC3_FRAME_SIZE,4,2       ## @SPDIF_AC3_FRAME_SIZE
	.comm	_MMAL_ENCODING_EAC3,8,3         ## @MMAL_ENCODING_EAC3
	.comm	_SPDIF_EAC3_FRAME_SIZE,4,2      ## @SPDIF_EAC3_FRAME_SIZE
	.comm	_MMAL_EINVAL,8,3                ## @MMAL_EINVAL
L_.str.4:                               ## @.str.4
	.asciz	"frame: %lld, size %i"

L_.str.5:                               ## @.str.5
	.asciz	"invalid data size (%i bytes)"

L_.str.6:                               ## @.str.6
	.asciz	"invalid data (%i bytes): %2.2x,%2.2x,%2.2x,%2.2x"

L_.str.7:                               ## @.str.7
	.asciz	"format change: %i->%i"

L_.str.8:                               ## @.str.8
	.asciz	"frame too big, truncating (%i/%i bytes)"

	.no_dead_strip	_spdif_do_processing
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function spdif_do_processing
_spdif_do_processing:                   ; @spdif_do_processing
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x8, [x0]
	ldr	x21, [x8]
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_19
LBB0_2:
	mov	x23, x0
	ldp	x9, x8, [x0, #8]
	ldr	x24, [x8]
	ldr	x20, [x9]
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	bl	_mmal_queue_get
	cbz	x0, LBB0_19
; %bb.3:
	mov	x19, x0
	ldr	x8, [x0, #40]
	cbz	x8, LBB0_10
; %bb.4:
	mov	x0, x19
	bl	_mmal_event_format_changed_get
	cbz	x0, LBB0_14
; %bb.5:
	ldr	x8, [x20, #8]
	ldr	w1, [x0]
	mov	x0, x8
	bl	_mmal_format_full_copy
	str	x0, [x24]
Lloh0:
	adrp	x21, _MMAL_SUCCESS@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MMAL_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.6:
	ldr	x8, [x20]
	ldr	x8, [x8]
	mov	x0, x20
	blr	x8
	str	x0, [x24]
	ldr	x8, [x21]
LBB0_7:
	cmp	x0, x8
	b.eq	LBB0_16
; %bb.8:
	ldr	w8, [x20, #16]
	stp	x20, x0, [sp, #8]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_LOG_ERROR
	ldr	x1, [x24]
	mov	x0, x23
	bl	_mmal_event_error_send
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_16
; %bb.9:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_10:
	ldr	x8, [x24]
Lloh6:
	adrp	x25, _MMAL_SUCCESS@GOTPAGE
Lloh7:
	ldr	x25, [x25, _MMAL_SUCCESS@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_24
; %bb.11:
	ldp	w1, w8, [x19]
	orr	w9, w1, w8
	cbz	w9, LBB0_17
; %bb.12:
Lloh8:
	adrp	x9, _MMAL_BUFFER_HEADER_FLAG_CONFIG@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MMAL_BUFFER_HEADER_FLAG_CONFIG@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.13:
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_LOG_DEBUG
	b	LBB0_16
LBB0_14:
	ldr	x8, [x19, #40]
	ldr	w9, [x20, #16]
	stp	x9, x20, [sp, #8]
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_15:
	bl	_LOG_ERROR
LBB0_16:
	str	wzr, [x19]
LBB0_17:
	mov	x0, x20
	mov	x1, x19
LBB0_18:
	bl	_mmal_port_buffer_header_callback
	mov	w0, #1
LBB0_19:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_20:
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	bl	_mmal_queue_get
	cbz	x0, LBB0_24
; %bb.21:
	mov	x22, x0
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _MMAL_ENCODING_EAC3@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MMAL_ENCODING_EAC3@GOTPAGEOFF]
Lloh17:
	adrp	x10, _SPDIF_EAC3_FRAME_SIZE@GOTPAGE
Lloh18:
	ldr	x10, [x10, _SPDIF_EAC3_FRAME_SIZE@GOTPAGEOFF]
Lloh19:
	adrp	x11, _SPDIF_AC3_FRAME_SIZE@GOTPAGE
Lloh20:
	ldr	x11, [x11, _SPDIF_AC3_FRAME_SIZE@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	w26, [x8]
	ldr	w8, [x0, #8]
	cmp	w8, w26
	b.hs	LBB0_26
; %bb.22:
Lloh22:
	adrp	x8, _MMAL_EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MMAL_EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	x1, [x8]
	str	x1, [x24]
	mov	x0, x23
	bl	_mmal_event_error_send
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_43
; %bb.23:
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_LOG_ERROR
	b	LBB0_43
LBB0_24:
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	mov	x1, x19
LBB0_25:
	bl	_mmal_queue_put_back
	b	LBB0_1
LBB0_26:
	ldr	w9, [x19]
	cbz	w9, LBB0_40
LBB0_27:
	ldr	w1, [x19, #32]
	str	x9, [sp]
Lloh27:
	adrp	x0, l_.str.4@PAGE
Lloh28:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_LOG_DEBUG
	mov	x0, x22
	bl	_mmal_buffer_header_mem_lock
	mov	x0, x19
	bl	_mmal_buffer_header_mem_lock
	ldr	w0, [x19]
	cmp	w0, #4
	b.gt	LBB0_30
; %bb.28:
	str	x0, [sp]
Lloh29:
	adrp	x0, l_.str.5@PAGE
Lloh30:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_29:
	bl	_LOG_ERROR
	mov	x0, x19
	bl	_mmal_buffer_header_mem_unlock
	mov	x0, x22
	bl	_mmal_buffer_header_mem_unlock
	str	wzr, [x19]
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	mov	x1, x22
	bl	_mmal_queue_put_back
	b	LBB0_17
LBB0_30:
	ldr	x8, [x19, #16]
	ldrsw	x9, [x19, #24]
	add	x24, x8, x9, lsl #2
	ldr	w8, [x24]
	cmp	w8, #11
	b.eq	LBB0_33
; %bb.31:
	ldr	w9, [x24, #4]
	cmp	w8, #119
	ccmp	w9, #11, #4, ne
	b.eq	LBB0_33
; %bb.32:
	cmp	w9, #119
	b.ne	LBB0_47
LBB0_33:
	ldr	w8, [x24, #16]
	and	w8, w8, #0xc0
	mov	w9, #48000
	mov	w10, #32000
	cmp	w8, #128
	csel	w9, w10, w9, eq
	mov	w10, #44100
	cmp	w8, #64
	csel	w25, w10, w9, eq
	ldr	x8, [x21, #8]
	ldr	x8, [x8, #8]
	ldr	w1, [x8]
	cmp	w25, w1
	b.ne	LBB0_42
; %bb.34:
	sub	w23, w26, #8
	cmp	w0, w23
	b.ls	LBB0_36
; %bb.35:
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
	stp	x0, x23, [sp]
Lloh31:
	adrp	x0, l_.str.8@PAGE
Lloh32:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_LOG_ERROR
	ldr	w0, [x19]
LBB0_36:
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	x1, x23
	bl	_MMAL_MIN
	mov	x25, x0
	cmp	w0, #0
	cinc	w8, w0, lt
	asr	w27, w8, #1
	ldr	x0, [x22, #16]
Lloh33:
	adrp	x1, _spdif_do_processing.ac3_spdif_header@PAGE
Lloh34:
	add	x1, x1, _spdif_do_processing.ac3_spdif_header@PAGEOFF
	mov	w2, #24
	bl	_memcpy
	ldr	w8, [x24, #20]
	and	w9, w8, #0x7
	ldr	x8, [x22, #16]
	and	w10, w27, #0xff
	stp	w9, w10, [x8, #20]
	lsr	w9, w27, #8
	str	w9, [x8, #28]
	ldr	w9, [x24]
	cmp	w9, #11
	b.ne	LBB0_44
; %bb.37:
	add	w9, w25, #1
	cmp	w9, #3
	b.lo	LBB0_45
; %bb.38:
	mov	x9, #0
	cmp	w27, #1
	csinc	w10, w27, wzr, hi
	lsl	x10, x10, #1
LBB0_39:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x19, #24]
	add	w11, w9, w11
	add	w11, w11, #1
	ldr	w11, [x24, w11, uxtw #2]
	add	w12, w9, #8
	str	w11, [x8, w12, uxtw #2]
	ldr	w11, [x19, #24]
	add	w11, w9, w11
	ldr	w11, [x24, w11, uxtw #2]
	add	w12, w9, #9
	str	w11, [x8, w12, uxtw #2]
	add	x9, x9, #2
	cmp	x10, x9
	b.ne	LBB0_39
	b	LBB0_45
LBB0_40:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_27
; %bb.41:
	str	wzr, [x22]
	b	LBB0_46
LBB0_42:
Lloh35:
	adrp	x0, l_.str.7@PAGE
Lloh36:
	add	x0, x0, l_.str.7@PAGEOFF
	mov	x2, x25
	bl	_LOG_INFO
	ldr	x2, [x20, #8]
	ldr	x8, [x2, #8]
	str	w25, [x8]
	mov	x0, x23
	mov	x1, x21
	bl	_spdif_send_event_format_changed
	mov	x0, x19
	bl	_mmal_buffer_header_mem_unlock
	mov	x0, x22
	bl	_mmal_buffer_header_mem_unlock
LBB0_43:
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_mmal_queue_put_back
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	mov	x1, x22
	b	LBB0_25
LBB0_44:
	add	x0, x8, #32
	ldr	w2, [x19]
	mov	x1, x24
	bl	_memcpy
	ldr	x8, [x22, #16]
LBB0_45:
	lsl	w9, w27, #1
	add	x8, x8, w9, uxtw #2
	add	x0, x8, #32
	sub	w2, w23, w9
	mov	w1, #0
	bl	_memset
	mov	x0, x19
	bl	_mmal_buffer_header_mem_unlock
	mov	x0, x22
	bl	_mmal_buffer_header_mem_unlock
	str	w26, [x22]
	ldr	w8, [x19, #4]
LBB0_46:
	str	w8, [x22, #4]
	ldr	x8, [x19, #32]
	str	x8, [x22, #32]
	ldr	w8, [x19, #28]
	stp	wzr, w8, [x22, #24]
	str	wzr, [x19]
	mov	x0, x20
	mov	x1, x19
	bl	_mmal_port_buffer_header_callback
	mov	x0, x21
	mov	x1, x22
	b	LBB0_18
LBB0_47:
	ldp	w10, w11, [x24, #8]
	stp	x10, x11, [sp, #24]
	stp	x8, x9, [sp, #8]
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
	str	x0, [sp]
Lloh37:
	adrp	x0, l_.str.6@PAGE
Lloh38:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_29
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @spdif_do_processing.ac3_spdif_header
_spdif_do_processing.ac3_spdif_header:
	.long	114                             ; 0x72
	.long	248                             ; 0xf8
	.long	31                              ; 0x1f
	.long	78                              ; 0x4e
	.long	1                               ; 0x1
	.long	0                               ; 0x0

	.comm	_MMAL_SUCCESS,8,3               ; @MMAL_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"format not set on port %s %p (%i)"

l_.str.1:                               ; @.str.1
	.asciz	"unable to send an error event buffer"

l_.str.2:                               ; @.str.2
	.asciz	"discarding event %i on port %s %p"

	.comm	_MMAL_BUFFER_HEADER_FLAG_CONFIG,4,2 ; @MMAL_BUFFER_HEADER_FLAG_CONFIG
l_.str.3:                               ; @.str.3
	.asciz	"config buffer %ibytes"

	.comm	_SPDIF_AC3_FRAME_SIZE,4,2       ; @SPDIF_AC3_FRAME_SIZE
	.comm	_MMAL_ENCODING_EAC3,8,3         ; @MMAL_ENCODING_EAC3
	.comm	_SPDIF_EAC3_FRAME_SIZE,4,2      ; @SPDIF_EAC3_FRAME_SIZE
	.comm	_MMAL_EINVAL,8,3                ; @MMAL_EINVAL
l_.str.4:                               ; @.str.4
	.asciz	"frame: %lld, size %i"

l_.str.5:                               ; @.str.5
	.asciz	"invalid data size (%i bytes)"

l_.str.6:                               ; @.str.6
	.asciz	"invalid data (%i bytes): %2.2x,%2.2x,%2.2x,%2.2x"

l_.str.7:                               ; @.str.7
	.asciz	"format change: %i->%i"

l_.str.8:                               ; @.str.8
	.asciz	"frame too big, truncating (%i/%i bytes)"

	.no_dead_strip	_spdif_do_processing
.subsections_via_symbols
