	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function enable_pcr_generation_for_stream
_enable_pcr_generation_for_stream:      ## @enable_pcr_generation_for_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %r12
	movq	24(%rsi), %r15
	movl	4(%r12), %edi
	cmpl	$1, (%r12)
	jg	LBB0_2
## %bb.1:
	testl	%edi, %edi
	jns	LBB0_2
## %bb.5:
	movq	%rsi, %rbx
	movq	16(%rsi), %rdi
	movq	(%rdi), %rax
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.6:
	xorl	%esi, %esi
	callq	_av_get_audio_frame_duration2
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
	movl	$512, %eax                      ## imm = 0x200
LBB0_8:
	movq	_PCR_TIME_BASE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	16(%rbx), %rcx
	movq	8(%rcx), %rdx
	movq	_AV_ROUND_UP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %edi
	jmp	LBB0_12
LBB0_2:
	cmpl	$-1, %edi
	jne	LBB0_4
## %bb.3:
	movq	_PCR_RETRANS_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
LBB0_4:
	movq	_PCR_TIME_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1000, %edx                     ## imm = 0x3E8
	callq	_av_rescale
	jmp	LBB0_15
LBB0_9:
	movq	8(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.11:
	movl	(%rbx), %edi
	movq	_PCR_TIME_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_AV_ROUND_UP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_12:
	callq	_av_rescale_rnd
	movl	%eax, %ecx
	movl	$1, %eax
	testl	%ecx, %ecx
	jle	LBB0_15
## %bb.13:
	movq	_PCR_TIME_BASE@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	imulq	$1717986919, %rdx, %rsi         ## imm = 0x66666667
	movq	%rsi, %rdx
	shrq	$63, %rdx
	sarq	$34, %rsi
	addl	%edx, %esi
	cmpl	%esi, %ecx
	jg	LBB0_15
## %bb.14:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	subl	%edx, %esi
	movl	%esi, %eax
	jmp	LBB0_15
LBB0_10:
	movl	$1, %eax
LBB0_15:
	movl	%eax, (%r15)
	movq	8(%r12), %rcx
	cltq
	subq	%rax, %rcx
	movq	%rcx, 8(%r15)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCR_RETRANS_TIME,4,2           ## @PCR_RETRANS_TIME
	.comm	_PCR_TIME_BASE,4,2              ## @PCR_TIME_BASE
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"frame size not set\n"

	.comm	_AV_ROUND_UP,4,2                ## @AV_ROUND_UP
	.no_dead_strip	_enable_pcr_generation_for_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function enable_pcr_generation_for_stream
_enable_pcr_generation_for_stream:      ; @enable_pcr_generation_for_stream
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x21, [x0]
	ldr	x22, [x1, #24]
	ldp	w9, w8, [x21]
	cmp	w9, #1
	b.gt	LBB0_6
; %bb.1:
	tbz	w8, #31, LBB0_6
; %bb.2:
	mov	x19, x1
	mov	x20, x0
	ldr	x0, [x1, #16]
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.3:
	mov	w1, #0
	bl	_av_get_audio_frame_duration2
	cbnz	w0, LBB0_5
; %bb.4:
Lloh3:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
	mov	w0, #512
LBB0_5:
Lloh8:
	adrp	x8, _PCR_TIME_BASE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PCR_TIME_BASE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	x8, [x19, #16]
	ldr	x2, [x8, #8]
	b	LBB0_9
LBB0_6:
Lloh11:
	adrp	x9, _PCR_RETRANS_TIME@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PCR_RETRANS_TIME@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmn	w8, #1
	csel	w0, w9, w8, eq
Lloh14:
	adrp	x8, _PCR_TIME_BASE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PCR_TIME_BASE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	w2, #1000
	bl	_av_rescale
	b	LBB0_13
LBB0_7:
	ldr	x2, [x19, #8]
	cbz	x2, LBB0_11
; %bb.8:
	ldr	w0, [x19]
Lloh17:
	adrp	x8, _PCR_TIME_BASE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PCR_TIME_BASE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
LBB0_9:
Lloh20:
	adrp	x8, _AV_ROUND_UP@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AV_ROUND_UP@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	bl	_av_rescale_rnd
	cmp	w0, #1
	b.lt	LBB0_11
; %bb.10:
Lloh23:
	adrp	x8, _PCR_TIME_BASE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PCR_TIME_BASE@GOTPAGEOFF]
Lloh25:
	ldrsw	x8, [x8]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w8, w8, w9
	cmp	w0, w8
	b.le	LBB0_12
LBB0_11:
	mov	w0, #1
	b	LBB0_13
LBB0_12:
	sdiv	w8, w8, w0
	mul	w0, w8, w0
LBB0_13:
	str	w0, [x22]
	ldr	x8, [x21, #8]
	sub	x8, x8, w0, sxtw
	str	x8, [x22, #8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_PCR_RETRANS_TIME,4,2           ; @PCR_RETRANS_TIME
	.comm	_PCR_TIME_BASE,4,2              ; @PCR_TIME_BASE
	.comm	_AVMEDIA_TYPE_AUDIO,8,3         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"frame size not set\n"

	.comm	_AV_ROUND_UP,4,2                ; @AV_ROUND_UP
	.no_dead_strip	_enable_pcr_generation_for_stream
.subsections_via_symbols
