	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function select_reference_stream
_select_reference_stream:               ## @select_reference_stream
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %r12
	movl	$-1, (%r12)
	movl	4(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_8
## %bb.1:
	cmpl	$0, (%r13)
	jle	LBB0_23
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rax
	movq	(%rax,%rbx,8), %rsi
	movl	4(%r12), %edx
	movq	%r13, %rdi
	callq	_avformat_match_stream_specifier
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	jne	LBB0_5
## %bb.22:                              ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	(%r13), %rax
	cmpq	%rax, %rbx
	jl	LBB0_3
	jmp	LBB0_23
LBB0_8:
	movq	%rsp, -56(%rbp)                 ## 8-byte Spill
	movq	_AVMEDIA_TYPE_NB@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movl	(%rbx), %ebx
	testl	%ebx, %ebx
	jle	LBB0_10
## %bb.9:
	leaq	(,%rbx,4), %rdx
	movq	%r14, %rdi
	movl	$255, %esi
	callq	_memset
LBB0_10:
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_17
## %bb.11:
	movq	8(%r13), %rcx
	movq	_AV_DISPOSITION_ATTACHED_PIC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	xorl	%esi, %esi
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rsi
	cmpq	%rsi, %rax
	je	LBB0_17
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rsi,8), %rdx
	movq	8(%rdx), %rdi
	movl	(%rdi), %edi
	cmpl	%ebx, %edi
	jae	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$-1, (%r14,%rdi,4)
	jne	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	testl	%r8d, (%rdx)
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	%esi, (%r14,%rdi,4)
	jmp	LBB0_16
LBB0_17:
	leaq	_select_reference_stream.type_priority_list(%rip), %rdi
	callq	_FF_ARRAY_ELEMS
	testl	%eax, %eax
	jle	LBB0_21
## %bb.18:
	xorl	%ebx, %ebx
	leaq	_select_reference_stream.type_priority_list(%rip), %r15
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %eax
	movl	(%r14,%rax,4), %eax
	movl	%eax, (%r12)
	testl	%eax, %eax
	jns	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_20 Depth=1
	incq	%rbx
	leaq	_select_reference_stream.type_priority_list(%rip), %rdi
	callq	_FF_ARRAY_ELEMS
	cltq
	addq	$4, %r15
	cmpq	%rax, %rbx
	jl	LBB0_20
LBB0_21:
	movq	-56(%rbp), %rsp                 ## 8-byte Reload
LBB0_23:
	xorl	%eax, %eax
	cmpl	$0, (%r12)
	jns	LBB0_6
## %bb.24:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r12), %ecx
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_7
## %bb.25:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_5:
	movl	%ebx, (%r12)
	xorl	%eax, %eax
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_7
## %bb.26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"auto"

	.comm	_AVMEDIA_TYPE_NB,4,2            ## @AVMEDIA_TYPE_NB
	.section	__TEXT,__const
	.p2align	4                               ## @select_reference_stream.type_priority_list
_select_reference_stream.type_priority_list:
	.long	128                             ## 0x80
	.long	131                             ## 0x83
	.long	129                             ## 0x81
	.long	130                             ## 0x82
	.long	132                             ## 0x84

	.comm	_AV_DISPOSITION_ATTACHED_PIC,4,2 ## @AV_DISPOSITION_ATTACHED_PIC
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"Could not select stream matching identifier '%s'\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_select_reference_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function select_reference_stream
_select_reference_stream:               ; @select_reference_stream
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x22, [x0, #16]
	mov	w8, #-1
	str	w8, [x22]
	ldr	w0, [x22, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	w0, LBB0_8
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.2:
	mov	x20, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x1, [x8, x20, lsl #3]
	ldr	w2, [x22, #4]
	mov	x0, x19
	bl	_avformat_match_stream_specifier
	tbnz	w0, #31, LBB0_25
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cbnz	w0, LBB0_24
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19]
	cmp	x20, x8
	b.lt	LBB0_3
LBB0_6:
	ldr	w8, [x22]
	tbnz	w8, #31, LBB0_22
LBB0_7:
	mov	w0, #0
	b	LBB0_25
LBB0_8:
	mov	x23, sp
Lloh5:
	adrp	x12, _AVMEDIA_TYPE_NB@GOTPAGE
Lloh6:
	ldr	x12, [x12, _AVMEDIA_TYPE_NB@GOTPAGEOFF]
	ldr	w8, [x12]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh7:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh8:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	w21, [x12]
	cmp	w21, #1
	b.lt	LBB0_10
; %bb.9:
	lsl	x2, x21, #2
	mov	x0, x20
	mov	w1, #255
	bl	_memset
LBB0_10:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.11:
	mov	x9, #0
	ldr	x10, [x19, #8]
Lloh9:
	adrp	x11, _AV_DISPOSITION_ATTACHED_PIC@GOTPAGE
Lloh10:
	ldr	x11, [x11, _AV_DISPOSITION_ATTACHED_PIC@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x9, x9, #1
	cmp	x8, x9
	b.eq	LBB0_17
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x13, [x10, x9, lsl #3]
	ldr	x12, [x13, #8]
	ldr	w12, [x12]
	cmp	w12, w21
	b.hs	LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w14, [x20, x12, lsl #2]
	cmn	w14, #1
	b.ne	LBB0_12
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w13, [x13]
	tst	w11, w13
	b.ne	LBB0_12
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	str	w9, [x20, x12, lsl #2]
	b	LBB0_12
LBB0_17:
Lloh12:
	adrp	x21, _select_reference_stream.type_priority_list@PAGE
Lloh13:
	add	x21, x21, _select_reference_stream.type_priority_list@PAGEOFF
	mov	x0, x21
	bl	_FF_ARRAY_ELEMS
	cmp	w0, #1
	b.lt	LBB0_21
; %bb.18:
	mov	x24, #0
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21, x24, lsl #2]
	ldr	w8, [x20, x8, lsl #2]
	str	w8, [x22]
	tbz	w8, #31, LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	add	x24, x24, #1
	mov	x0, x21
	bl	_FF_ARRAY_ELEMS
	cmp	x24, w0, sxtw
	b.lt	LBB0_19
LBB0_21:
	mov	sp, x23
	ldr	w8, [x22]
	tbz	w8, #31, LBB0_7
LBB0_22:
Lloh14:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ldr	w3, [x22, #4]
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_av_log
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	ldur	x8, [x29, #-56]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.23:
	sub	sp, x29, #48
	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
	b	_AVERROR
LBB0_24:
	mov	w0, #0
	str	w20, [x22]
LBB0_25:
	ldur	x8, [x29, #-56]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.26:
	sub	sp, x29, #48
	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
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"auto"

	.comm	_AVMEDIA_TYPE_NB,4,2            ; @AVMEDIA_TYPE_NB
	.section	__TEXT,__const
	.p2align	2                               ; @select_reference_stream.type_priority_list
_select_reference_stream.type_priority_list:
	.long	128                             ; 0x80
	.long	131                             ; 0x83
	.long	129                             ; 0x81
	.long	130                             ; 0x82
	.long	132                             ; 0x84

	.comm	_AV_DISPOSITION_ATTACHED_PIC,4,2 ; @AV_DISPOSITION_ATTACHED_PIC
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"Could not select stream matching identifier '%s'\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_select_reference_stream
.subsections_via_symbols
