	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function film_init
_film_init:                             ## @film_init
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	16(%rdi), %rax
	movq	$-1, (%rax)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rax)
	movups	%xmm0, 24(%rax)
	movl	(%rdi), %r15d
	testl	%r15d, %r15d
	jle	LBB0_17
## %bb.1:
	movq	%rdi, %r14
	movq	8(%rdi), %r8
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r10
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r11
	movl	$-1, %edx
	xorl	%ebx, %ebx
	movl	$-1, %esi
	xorl	%r9d, %r9d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-1, %edx
	je	LBB0_10
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%rbx
	cmpq	%rbx, %r15
	je	LBB0_13
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r8,%rbx,8), %rcx
	movq	(%rcx), %rdi
	movq	(%rdi), %rdi
	cmpq	%r10, %rdi
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%esi, %esi
	jns	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, (%rax)
	movl	%ebx, %esi
	movq	%rcx, %r9
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%r11, %rdi
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%edx, %edx
	jns	LBB0_8
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%ebx, 4(%rax)
	movl	%ebx, %edx
	jmp	LBB0_12
LBB0_13:
	testq	%r9, %r9
	je	LBB0_17
## %bb.14:
	movq	(%r9), %rax
	movl	8(%rax), %edi
	callq	_get_audio_codec_id
	testq	%rax, %rax
	js	LBB0_15
LBB0_17:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_16
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_16
LBB0_8:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	jmp	LBB0_16
LBB0_15:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
LBB0_16:
	movq	%r14, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Sega FILM allows a maximum of one audio stream.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ## @AVMEDIA_TYPE_VIDEO
L_.str.1:                               ## @.str.1
	.asciz	"Sega FILM allows a maximum of one video stream.\n"

L_.str.2:                               ## @.str.2
	.asciz	"No video stream present.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Incompatible audio stream format.\n"

	.no_dead_strip	_film_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function film_init
_film_init:                             ; @film_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0, #16]
	movi.2d	v0, #0xffffffffffffffff
	str	d0, [x8]
	movi.2d	v0, #0000000000000000
	stur	q0, [x8, #8]
	stur	q0, [x8, #24]
	ldr	w9, [x0]
	cmp	w9, #1
	b.lt	LBB0_12
; %bb.1:
	mov	x19, x0
	mov	x10, #0
	mov	x12, #0
	ldr	x11, [x0, #8]
Lloh0:
	adrp	x13, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh1:
	ldr	x13, [x13, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh2:
	ldr	x13, [x13]
Lloh3:
	adrp	x14, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh4:
	ldr	x14, [x14, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh5:
	ldr	x14, [x14]
	mov	w15, #-1
	mov	w16, #-1
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmn	w15, #1
	b.eq	LBB0_13
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x10, x10, #1
	cmp	x9, x10
	b.eq	LBB0_10
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x11, x10, lsl #3]
	ldr	x17, [x0]
	ldr	x17, [x17]
	cmp	x17, x13
	b.ne	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	tbz	w16, #31, LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w10, [x8]
	mov	x16, x10
	mov	x12, x0
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	x17, x14
	b.ne	LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	tbz	w15, #31, LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w10, [x8, #4]
	mov	x15, x10
	b	LBB0_3
LBB0_10:
	cbz	x12, LBB0_12
; %bb.11:
	ldr	x8, [x12]
	ldr	w0, [x8, #8]
	bl	_get_audio_codec_id
	tbnz	x0, #63, LBB0_16
LBB0_12:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh6:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str.2@PAGE
Lloh10:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_14:
Lloh11:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_17
LBB0_15:
Lloh16:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh21:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x2, l_.str.3@PAGE
Lloh25:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_17:
	mov	x0, x19
	bl	_av_log
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Sega FILM allows a maximum of one audio stream.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AVMEDIA_TYPE_VIDEO,8,3         ; @AVMEDIA_TYPE_VIDEO
l_.str.1:                               ; @.str.1
	.asciz	"Sega FILM allows a maximum of one video stream.\n"

l_.str.2:                               ; @.str.2
	.asciz	"No video stream present.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Incompatible audio stream format.\n"

	.no_dead_strip	_film_init
.subsections_via_symbols
