	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ogg_replace_stream
_ogg_replace_stream:                    ## @ogg_replace_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rdi
	movq	8(%rbx), %r13
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_7
## %bb.1:
	movl	%edx, %r15d
	callq	_avio_tell
	movl	%eax, %r12d
	movq	(%rbx), %rdi
	movl	%r15d, %esi
	callq	_avio_skip
	movq	(%rbx), %rdi
	leaq	-80(%rbp), %r15
	movq	%r15, %rsi
	movl	$32, %edx
	callq	_avio_read
	movq	(%rbx), %rdi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r12d, %esi
	callq	_avio_seek
	movq	%r15, %rdi
	movl	$32, %esi
	callq	_ogg_find_codec
	testq	%rax, %rax
	je	LBB0_9
## %bb.2:
	movl	(%r13), %edx
	testl	%edx, %edx
	jle	LBB0_6
## %bb.3:
	movq	%rax, %rcx
	movq	8(%r13), %rsi
	addq	$16, %rsi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rcx, (%rsi)
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incq	%rax
	addq	$40, %rsi
	cmpq	%rax, %rdx
	jne	LBB0_4
LBB0_6:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ogg_new_stream
                                        ## kill: def $eax killed $eax def $rax
	jmp	LBB0_12
LBB0_7:
	xorl	%eax, %eax
	cmpl	$1, (%r13)
	jne	LBB0_10
LBB0_8:
	movq	8(%r13), %rcx
	movl	%eax, %edx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%r14, 32(%rcx,%rdx,8)
	jmp	LBB0_12
LBB0_9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_avpriv_report_missing_feature
	movq	_AVERROR_PATCHWELCOME@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_14
## %bb.13:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ## @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot identify new stream\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
L_.str.1:                               ## @.str.1
	.asciz	"Changing stream parameters in multistream ogg"

	.comm	_AVERROR_PATCHWELCOME,4,2       ## @AVERROR_PATCHWELCOME
	.comm	_buf,4,2                        ## @buf
	.comm	_bufsize,4,2                    ## @bufsize
	.no_dead_strip	_ogg_replace_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ogg_replace_stream
_ogg_replace_stream:                    ; @ogg_replace_stream
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldp	x0, x23, [x0]
	ldr	w8, [x0]
Lloh3:
	adrp	x9, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.1:
	mov	x21, x2
	bl	_avio_tell
	mov	x22, x0
	ldr	x0, [x20]
	mov	x1, x21
	bl	_avio_skip
	ldr	x0, [x20]
	add	x1, sp, #8
	mov	w2, #32
	bl	_avio_read
	ldr	x0, [x20]
Lloh6:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x1, x22
	bl	_avio_seek
	add	x0, sp, #8
	mov	w1, #32
	bl	_ogg_find_codec
	cbz	x0, LBB0_10
; %bb.2:
	ldr	w9, [x23]
	cmp	w9, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x8, x0
	mov	x0, #0
	ldr	x10, [x23, #8]
	add	x10, x10, #16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10]
	cmp	x11, x8
	b.eq	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x0, x0, #1
	add	x10, x10, #40
	cmp	x9, x0
	b.ne	LBB0_4
LBB0_6:
	mov	x0, x20
	mov	x1, x19
	bl	_ogg_new_stream
                                        ; kill: def $w0 killed $w0 def $x0
	b	LBB0_13
LBB0_7:
	ldr	w8, [x23]
	cmp	w8, #1
	b.ne	LBB0_11
; %bb.8:
	mov	w0, #0
LBB0_9:
	ldr	x8, [x23, #8]
	mov	w9, #40
	umaddl	x8, w0, w9, x8
	str	x19, [x8, #32]
	b	LBB0_13
LBB0_10:
Lloh9:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x2, l_.str@PAGE
Lloh13:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
Lloh14:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_avpriv_report_missing_feature
Lloh18:
	adrp	x8, _AVERROR_PATCHWELCOME@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AVERROR_PATCHWELCOME@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
LBB0_13:
	ldr	x8, [sp, #40]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_15
; %bb.14:
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot identify new stream\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
l_.str.1:                               ; @.str.1
	.asciz	"Changing stream parameters in multistream ogg"

	.comm	_AVERROR_PATCHWELCOME,4,2       ; @AVERROR_PATCHWELCOME
	.comm	_buf,4,2                        ; @buf
	.comm	_bufsize,4,2                    ; @bufsize
	.no_dead_strip	_ogg_replace_stream
.subsections_via_symbols
