	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function segment_start
_segment_start:                         ## @segment_start
	.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
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	8(%rdi), %r14
	movq	32(%r14), %r15
	testl	%esi, %esi
	je	LBB0_3
## %bb.1:
	movq	%r15, %rdi
	callq	_avformat_free_context
	movq	$0, 32(%r14)
	movq	%r12, %rdi
	callq	_segment_mux_init
	testl	%eax, %eax
	js	LBB0_17
## %bb.2:
	movq	32(%r14), %r15
LBB0_3:
	movl	(%r14), %eax
	movl	4(%r14), %ecx
	incl	%eax
	movl	%eax, (%r14)
	testl	%ecx, %ecx
	je	LBB0_6
## %bb.4:
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	LBB0_6
## %bb.5:
	incl	24(%r14)
LBB0_6:
	movq	%r12, %rdi
	callq	_set_segment_filename
	testl	%eax, %eax
	js	LBB0_17
## %bb.7:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	leaq	24(%r15), %r13
	movl	32(%r15), %edx
	movq	_AVIO_FLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rdi
	movq	%r13, %rsi
	xorl	%r8d, %r8d
	callq	*(%r12)
	testl	%eax, %eax
	js	LBB0_18
## %bb.8:
	cmpl	$0, 20(%r14)
	jne	LBB0_10
## %bb.9:
	movq	(%r13), %rax
	movq	$0, (%rax)
LBB0_10:
	movq	16(%r15), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.11:
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_13
## %bb.12:
	leaq	L_.str.1(%rip), %rsi
	leaq	L_.str.2(%rip), %rdx
	xorl	%ecx, %ecx
	callq	_av_opt_set
LBB0_13:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_15
## %bb.14:
	movq	$0, -56(%rbp)
	movl	16(%r14), %esi
	leaq	-56(%rbp), %r12
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_av_dict_copy
	leaq	L_.str.3(%rip), %rsi
	leaq	L_.str.4(%rip), %rdx
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_av_dict_set
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_avformat_write_header
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_av_dict_free
	testl	%ebx, %ebx
	js	LBB0_19
LBB0_15:
	movq	$0, 8(%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_17:
	movl	%eax, %ebx
	jmp	LBB0_19
LBB0_18:
	movl	%eax, %ebx
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	32(%r15), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
LBB0_19:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVIO_FLAG_WRITE,4,2            ## @AVIO_FLAG_WRITE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to open segment '%s'\n"

L_.str.1:                               ## @.str.1
	.asciz	"mpegts_flags"

L_.str.2:                               ## @.str.2
	.asciz	"+resend_headers"

L_.str.3:                               ## @.str.3
	.asciz	"fflags"

L_.str.4:                               ## @.str.4
	.asciz	"-autobsf"

	.no_dead_strip	_segment_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function segment_start
_segment_start:                         ; @segment_start
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x21, x0
	ldr	x24, [x0, #8]
	ldr	x19, [x24, #32]
	cbz	w1, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_avformat_free_context
	str	xzr, [x24, #32]
	mov	x0, x21
	bl	_segment_mux_init
	tbnz	w0, #31, LBB0_16
; %bb.2:
	ldr	x19, [x24, #32]
LBB0_3:
	ldp	w9, w8, [x24]
	add	w9, w9, #1
	str	w9, [x24]
	cbz	w8, LBB0_6
; %bb.4:
	sdiv	w10, w9, w8
	msub	w8, w10, w8, w9
	cbnz	w8, LBB0_6
; %bb.5:
	ldr	w8, [x24, #24]
	add	w8, w8, #1
	str	w8, [x24, #24]
LBB0_6:
	mov	x0, x21
	bl	_set_segment_filename
	tbnz	w0, #31, LBB0_16
; %bb.7:
	ldr	x8, [x21]
	add	x23, x19, #24
	ldr	w2, [x19, #32]
Lloh0:
	adrp	x9, _AVIO_FLAG_WRITE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVIO_FLAG_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x9]
	mov	x0, x21
	mov	x1, x23
	mov	x4, #0
	blr	x8
	tbnz	w0, #31, LBB0_17
; %bb.8:
	ldr	w8, [x24, #20]
	cbnz	w8, LBB0_10
; %bb.9:
	ldr	x8, [x23]
	str	xzr, [x8]
LBB0_10:
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_13
; %bb.11:
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_13
; %bb.12:
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
Lloh5:
	adrp	x2, l_.str.2@PAGE
Lloh6:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w3, #0
	bl	_av_opt_set
LBB0_13:
	cbz	w20, LBB0_15
; %bb.14:
	str	xzr, [sp, #8]
	ldr	w1, [x24, #16]
	add	x0, sp, #8
	mov	w2, #0
	bl	_av_dict_copy
Lloh7:
	adrp	x1, l_.str.3@PAGE
Lloh8:
	add	x1, x1, l_.str.3@PAGEOFF
Lloh9:
	adrp	x2, l_.str.4@PAGE
Lloh10:
	add	x2, x2, l_.str.4@PAGEOFF
	add	x0, sp, #8
	mov	w3, #0
	bl	_av_dict_set
	add	x1, sp, #8
	mov	x0, x19
	bl	_avformat_write_header
	mov	x22, x0
	add	x0, sp, #8
	bl	_av_dict_free
	tbnz	w22, #31, LBB0_18
LBB0_15:
	mov	w22, #0
	str	xzr, [x24, #8]
	b	LBB0_18
LBB0_16:
	mov	x22, x0
	b	LBB0_18
LBB0_17:
	mov	x22, x0
Lloh11:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w3, [x19, #32]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	bl	_av_log
LBB0_18:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AVIO_FLAG_WRITE,4,2            ; @AVIO_FLAG_WRITE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to open segment '%s'\n"

l_.str.1:                               ; @.str.1
	.asciz	"mpegts_flags"

l_.str.2:                               ; @.str.2
	.asciz	"+resend_headers"

l_.str.3:                               ; @.str.3
	.asciz	"fflags"

l_.str.4:                               ; @.str.4
	.asciz	"-autobsf"

	.no_dead_strip	_segment_start
.subsections_via_symbols
