	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpegts_add_service
_mpegts_add_service:                    ## @mpegts_add_service
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -104(%rbp)                ## 8-byte Spill
	movq	%rdx, %r15
	movl	%esi, -84(%rbp)                 ## 4-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r12
	leaq	L_.str(%rip), %rsi
	movq	%rdx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_av_dict_get
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_av_dict_get
	movq	%rax, %rbx
LBB0_2:
	leaq	-80(%rbp), %r13
	movq	_DEFAULT_SERVICE_NAME@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	8(%r12), %r8
	incq	%r8
	leaq	L_.str.2(%rip), %rdx
	movq	%r13, %rdi
	movl	$32, %esi
	callq	_snprintf
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.3:
	movq	(%rbx), %r13
LBB0_4:
	leaq	L_.str.3(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_av_dict_get
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	_DEFAULT_PROVIDER_NAME@GOTPCREL(%rip), %rax
LBB0_6:
	movq	(%rax), %r15
	movl	$56, %edi
	callq	_av_mallocz
	testq	%rax, %rax
	je	LBB0_13
## %bb.7:
	movq	%rax, %rbx
	movq	8(%r12), %rax
	addq	24(%r12), %rax
	movq	%rax, 40(%rbx)
	movl	-84(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rbx)
	movl	$8191, 4(%rbx)                  ## imm = 0x1FFF
	movl	52(%rbx), %edi
	movq	%r15, %rsi
	callq	_encode_str8
	testq	%rax, %rax
	js	LBB0_9
## %bb.8:
	movl	48(%rbx), %edi
	movq	%r13, %rsi
	callq	_encode_str8
	testq	%rax, %rax
	js	LBB0_9
## %bb.11:
	leaq	8(%r12), %rsi
	leaq	16(%r12), %rdi
	movq	%rbx, %rdx
	callq	_av_dynarray_add_nofree
	testq	%rax, %rax
	js	LBB0_10
## %bb.12:
	movq	_section_write_packet@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 24(%rbx)
	movl	$15, 16(%rbx)
	movq	_MPEGTS_FLAG_DISCONT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%r12), %eax
	movl	%eax, 20(%rbx)
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	%rax, 8(%rbx)
	movq	%rbx, %r14
	jmp	LBB0_13
LBB0_9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_log
LBB0_10:
	movq	%rbx, %rdi
	callq	_av_free
	xorl	%r14d, %r14d
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	movq	%r14, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"service_name"

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

L_.str.2:                               ## @.str.2
	.asciz	"%s%02d"

	.comm	_DEFAULT_SERVICE_NAME,8,3       ## @DEFAULT_SERVICE_NAME
L_.str.3:                               ## @.str.3
	.asciz	"service_provider"

	.comm	_DEFAULT_PROVIDER_NAME,8,3      ## @DEFAULT_PROVIDER_NAME
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.4:                               ## @.str.4
	.asciz	"Too long service or provider name\n"

	.comm	_section_write_packet,4,2       ## @section_write_packet
	.comm	_MPEGTS_FLAG_DISCONT,4,2        ## @MPEGTS_FLAG_DISCONT
	.no_dead_strip	_mpegts_add_service
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpegts_add_service
_mpegts_add_service:                    ; @mpegts_add_service
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x19, x3
	mov	x22, x2
	mov	x21, 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]
	ldr	x26, [x0]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x2
	mov	x2, #0
	mov	w3, #0
	bl	_av_dict_get
	mov	x25, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, #0
	mov	w3, #0
	bl	_av_dict_get
	mov	x25, x0
LBB0_2:
Lloh7:
	adrp	x8, _DEFAULT_SERVICE_NAME@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DEFAULT_SERVICE_NAME@GOTPAGEOFF]
	add	x24, sp, #8
Lloh9:
	ldr	x3, [x8]
	mov	x23, x26
	ldr	x8, [x23, #8]!
	add	x4, x8, #1
Lloh10:
	adrp	x2, l_.str.2@PAGE
Lloh11:
	add	x2, x2, l_.str.2@PAGEOFF
	add	x0, sp, #8
	mov	w1, #32
	bl	_snprintf
	cbz	x25, LBB0_4
; %bb.3:
	ldr	x24, [x25]
LBB0_4:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x22
	mov	x2, #0
	mov	w3, #0
	bl	_av_dict_get
Lloh14:
	adrp	x8, _DEFAULT_PROVIDER_NAME@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DEFAULT_PROVIDER_NAME@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x0, eq
	ldr	x25, [x8]
	mov	w0, #56
	bl	_av_mallocz
	mov	x22, x0
	cbz	x0, LBB0_11
; %bb.5:
	ldr	x8, [x26, #24]
	ldr	x9, [x26, #8]
	add	x8, x9, x8
	str	x8, [x22, #40]
	mov	w8, #8191
	stp	w21, w8, [x22]
	ldr	w0, [x22, #52]
	mov	x1, x25
	bl	_encode_str8
	tbnz	x0, #63, LBB0_9
; %bb.6:
	ldr	w0, [x22, #48]
	mov	x1, x24
	bl	_encode_str8
	tbnz	x0, #63, LBB0_9
; %bb.7:
	add	x0, x26, #16
	mov	x1, x23
	mov	x2, x22
	bl	_av_dynarray_add_nofree
	tbnz	x0, #63, LBB0_10
; %bb.8:
Lloh16:
	adrp	x8, _section_write_packet@GOTPAGE
Lloh17:
	ldr	x8, [x8, _section_write_packet@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x22, #32]
	str	x20, [x22, #24]
	mov	w8, #15
	str	w8, [x22, #16]
	ldr	w8, [x26]
Lloh19:
	adrp	x9, _MPEGTS_FLAG_DISCONT@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MPEGTS_FLAG_DISCONT@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	and	w8, w9, w8
	str	w8, [x22, #20]
	str	x19, [x22, #8]
	b	LBB0_11
LBB0_9:
Lloh22:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x2, l_.str.4@PAGE
Lloh26:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_av_log
LBB0_10:
	mov	x0, x22
	bl	_av_free
	mov	x22, #0
LBB0_11:
	ldr	x8, [sp, #40]
Lloh27:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh28:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_13:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"service_name"

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

l_.str.2:                               ; @.str.2
	.asciz	"%s%02d"

	.comm	_DEFAULT_SERVICE_NAME,8,3       ; @DEFAULT_SERVICE_NAME
l_.str.3:                               ; @.str.3
	.asciz	"service_provider"

	.comm	_DEFAULT_PROVIDER_NAME,8,3      ; @DEFAULT_PROVIDER_NAME
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.4:                               ; @.str.4
	.asciz	"Too long service or provider name\n"

	.comm	_section_write_packet,4,2       ; @section_write_packet
	.comm	_MPEGTS_FLAG_DISCONT,4,2        ; @MPEGTS_FLAG_DISCONT
	.no_dead_strip	_mpegts_add_service
.subsections_via_symbols
