	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function seg_write_header
_seg_write_header:                      ## @seg_write_header
	.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	48(%rdi), %r12
	movq	24(%r12), %rbx
	cmpl	$0, 20(%r12)
	jne	LBB0_10
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rdi)
	jle	LBB0_9
## %bb.2:
	movq	32(%rdi), %rax
	xorl	%r13d, %r13d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rbx), %rax
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, 8(%r12)
	movq	32(%rdi), %rax
	movq	(%rax,%r13,8), %rcx
	movl	4(%rcx), %edx
	movl	%edx, 4(%r14)
	movl	(%rcx), %ecx
	movl	%ecx, (%r14)
	incq	%r13
	movslq	(%rdi), %rcx
	cmpq	%rcx, %r13
	jge	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	32(%r15), %rcx
	movq	(%rcx,%r13,8), %r14
	movq	(%rax,%r13,8), %rax
	movq	8(%rax), %rbx
	movq	8(%r14), %r12
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_avcodec_parameters_copy
	movq	40(%r15), %rax
	movl	(%rax), %edi
	testl	%edi, %edi
	je	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rbx), %rsi
	callq	_av_codec_get_id
	cmpq	(%r12), %rax
	je	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	40(%rax), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rsi
	callq	_av_codec_get_tag
	testq	%rax, %rax
	jle	LBB0_3
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_4
LBB0_9:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_avformat_write_header
	testl	%eax, %eax
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	js	LBB0_19
LBB0_10:
	cmpl	$0, 16(%r12)
	movq	8(%r12), %rax
	je	LBB0_13
## %bb.11:
	testq	%rax, %rax
	jne	LBB0_14
## %bb.12:
	xorl	%r14d, %r14d
	jmp	LBB0_20
LBB0_13:
	testq	%rax, %rax
	je	LBB0_21
LBB0_14:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_av_write_frame
	leaq	16(%rbx), %rsi
	movq	%rbx, %rdi
	callq	_ff_format_io_close
LBB0_15:
	leaq	16(%rbx), %r15
	movl	24(%rbx), %edx
	movq	_AVIO_FLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movq	%r15, %rsi
	xorl	%r8d, %r8d
	callq	*8(%rbx)
	testl	%eax, %eax
	js	LBB0_19
## %bb.16:
	cmpl	$0, (%r12)
	jne	LBB0_20
## %bb.17:
	movq	(%r15), %rax
	movq	$0, (%rax)
	jmp	LBB0_20
LBB0_19:
	movl	%eax, %r14d
LBB0_20:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	leaq	16(%rbx), %rdi
	callq	_close_null_ctxp
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_AVIO_FLAG_WRITE,4,2            ## @AVIO_FLAG_WRITE
	.no_dead_strip	_seg_write_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function seg_write_header
_seg_write_header:                      ; @seg_write_header
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x23, [x0, #48]
	ldr	x19, [x23, #24]
	ldr	w8, [x23, #20]
	cbnz	w8, LBB0_10
; %bb.1:
	mov	x20, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.2:
	mov	x24, #0
	ldr	x8, [x20, #32]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x22, #8]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20, #32]
	ldr	x10, [x8, x24, lsl #3]
	str	x9, [x21, #8]
	ldr	d0, [x10]
	str	d0, [x25]
	add	x24, x24, #1
	ldrsw	x9, [x20]
	cmp	x24, x9
	b.ge	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #32]
	lsl	x10, x24, #3
	ldr	x25, [x9, x10]
	ldr	x8, [x8, x10]
	ldr	x22, [x8, #8]
	ldr	x21, [x25, #8]
	mov	x0, x21
	mov	x1, x22
	bl	_avcodec_parameters_copy
	ldr	x8, [x19, #40]
	ldr	w0, [x8]
	cbz	w0, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [x22, #8]
	bl	_av_codec_get_id
	ldr	x8, [x21]
	cmp	x0, x8
	b.eq	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19, #40]
	ldr	w0, [x8]
	ldr	x1, [x22]
	bl	_av_codec_get_tag
	cmp	x0, #0
	b.le	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x9, #0
	b	LBB0_4
LBB0_9:
	mov	x0, x19
	mov	x1, #0
	bl	_avformat_write_header
	tbnz	w0, #31, LBB0_18
LBB0_10:
	ldr	w9, [x23, #16]
	ldr	x8, [x23, #8]
	cbz	w9, LBB0_12
; %bb.11:
	cbnz	x8, LBB0_13
	b	LBB0_16
LBB0_12:
	cbz	x8, LBB0_19
LBB0_13:
	mov	x0, x19
	mov	x1, #0
	bl	_av_write_frame
	add	x1, x19, #16
	mov	x0, x19
	bl	_ff_format_io_close
LBB0_14:
	ldr	x8, [x19, #8]
	add	x20, x19, #16
	ldr	w2, [x19, #24]
Lloh0:
	adrp	x9, _AVIO_FLAG_WRITE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVIO_FLAG_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x9]
	mov	x0, x19
	mov	x1, x20
	mov	x4, #0
	blr	x8
	tbnz	w0, #31, LBB0_18
; %bb.15:
	ldr	w8, [x23]
	cbz	w8, LBB0_17
LBB0_16:
	mov	w0, #0
	b	LBB0_18
LBB0_17:
	mov	w0, #0
	ldr	x8, [x20]
	str	xzr, [x8]
LBB0_18:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_19:
	add	x0, x19, #16
	bl	_close_null_ctxp
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIO_FLAG_WRITE,4,2            ; @AVIO_FLAG_WRITE
	.no_dead_strip	_seg_write_header
.subsections_via_symbols
