	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function ScaleSubtitle
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
LCPI0_1:
	.quad	0xbff0000000000000              ## double -1
LCPI0_2:
	.quad	0x3f847ae147ae147b              ## double 0.01
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_ScaleSubtitle:                         ## @ScaleSubtitle
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movsd	(%rsi), %xmm0                   ## xmm0 = mem[0],zero
	movsd	LCPI0_0(%rip), %xmm3            ## xmm3 = mem[0],zero
	xorpd	%xmm2, %xmm2
	ucomisd	%xmm2, %xmm0
	jbe	LBB0_3
## %bb.1:
	movsd	8(%rbx), %xmm1                  ## xmm1 = mem[0],zero
	ucomisd	%xmm2, %xmm1
	jbe	LBB0_3
## %bb.2:
	cvtdq2pd	16(%r14), %xmm3
	unpcklpd	%xmm1, %xmm0                    ## xmm0 = xmm0[0],xmm1[0]
	divpd	%xmm0, %xmm3
	movapd	%xmm3, %xmm0
	unpckhpd	%xmm3, %xmm0                    ## xmm0 = xmm0[1],xmm3[1]
	maxsd	%xmm0, %xmm3
LBB0_3:
	movsd	LCPI0_1(%rip), %xmm0            ## xmm0 = mem[0],zero
	movapd	%xmm3, -176(%rbp)               ## 16-byte Spill
	addsd	%xmm3, %xmm0
	movsd	%xmm0, -152(%rbp)               ## 8-byte Spill
	callq	_ABS
	ucomisd	LCPI0_2(%rip), %xmm0
	ja	LBB0_5
## %bb.4:
	movsd	-152(%rbp), %xmm0               ## 8-byte Reload
                                        ## xmm0 = mem[0],zero
	callq	_ABS
	ucomisd	LCPI0_2(%rip), %xmm0
	jbe	LBB0_12
LBB0_5:
	movq	%r14, -152(%rbp)                ## 8-byte Spill
	xorps	%xmm0, %xmm0
	cvtsi2sdl	16(%rbx), %xmm0
	movapd	-176(%rbp), %xmm1               ## 16-byte Reload
	mulsd	%xmm1, %xmm0
	cvttsd2si	%xmm0, %r13d
	xorps	%xmm0, %xmm0
	cvtsi2sdl	20(%rbx), %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2si	%xmm0, %r14d
	movq	_AV_PIX_FMT_YUVA420P@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r13d, %esi
	movl	%r14d, %edx
	callq	_hb_frame_buffer_init
	testq	%rax, %rax
	je	LBB0_24
## %bb.6:
	movq	%rax, %r12
	movupd	24(%rbx), %xmm0
	movddup	-176(%rbp), %xmm1               ## 16-byte Folded Reload
                                        ## xmm1 = mem[0,0]
	mulpd	%xmm0, %xmm1
	movupd	%xmm1, 24(%rax)
	leaq	-80(%rbp), %rdi
	leaq	-128(%rbp), %rsi
	movq	%rbx, %rdx
	callq	_hb_picture_fill
	leaq	-112(%rbp), %rdi
	leaq	-144(%rbp), %rsi
	movq	%r12, %rdx
	callq	_hb_picture_fill
	movq	16(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.7:
	cmpl	%r13d, (%r15)
	jne	LBB0_9
## %bb.8:
	cmpl	%r14d, 4(%r15)
	je	LBB0_11
LBB0_9:
	callq	_sws_freeContext
LBB0_10:
	xorps	%xmm0, %xmm0
	cvtsi2sdl	16(%rbx), %xmm0
	xorps	%xmm1, %xmm1
	cvtsi2sdl	20(%rbx), %xmm1
	xorps	%xmm2, %xmm2
	cvtsi2sdl	16(%r12), %xmm2
	xorps	%xmm3, %xmm3
	cvtsi2sdl	20(%r12), %xmm3
	movl	40(%rbx), %edi
	movq	_SWS_LANCZOS@GOTPCREL(%rip), %rax
	movq	_SWS_ACCURATE_RND@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_SWS_CS_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%edi, %esi
	callq	_hb_sws_get_context
	movq	%rax, %rdi
	movq	%rax, 16(%r15)
	movl	%r13d, (%r15)
	movl	%r14d, 4(%r15)
LBB0_11:
	xorps	%xmm0, %xmm0
	cvtsi2sdl	20(%rbx), %xmm0
	leaq	-80(%rbp), %rsi
	leaq	-128(%rbp), %rdx
	leaq	-112(%rbp), %r8
	leaq	-144(%rbp), %r9
	xorl	%ecx, %ecx
	callq	_sws_scale
	movq	-152(%rbp), %r14                ## 8-byte Reload
	jmp	LBB0_13
LBB0_24:
	xorl	%r12d, %r12d
	jmp	LBB0_25
LBB0_12:
	movq	%rbx, %rdi
	callq	_hb_buffer_dup
	movq	%rax, %r12
LBB0_13:
	movl	20(%r14), %r8d
	movq	8(%r15), %rcx
	movl	(%rcx), %r9d
	movl	4(%rcx), %r10d
	movl	%r8d, %edi
	subl	%r9d, %edi
	subl	%r10d, %edi
	movslq	%edi, %rax
	imulq	$1374389535, %rax, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rbx
	shrq	$63, %rbx
	sarq	$36, %rdx
	addl	%ebx, %edx
	cmpl	$20, %edx
	movl	$20, %ebx
	cmovll	%edx, %ebx
	movl	20(%r12), %edx
	subl	%ebx, %eax
	subl	%ebx, %eax
	cmpl	%eax, %edx
	jle	LBB0_15
## %bb.14:
	subl	%edx, %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	addl	%r9d, %eax
	movl	%eax, %r9d
	jmp	LBB0_18
LBB0_15:
	movsd	32(%r12), %xmm0                 ## xmm0 = mem[0],zero
	addl	%ebx, %r9d
	xorps	%xmm1, %xmm1
	cvtsi2sd	%r9d, %xmm1
	ucomisd	%xmm0, %xmm1
	ja	LBB0_18
## %bb.16:
	addl	%edx, %r10d
	addl	%ebx, %r10d
	subl	%r10d, %r8d
	xorps	%xmm1, %xmm1
	cvtsi2sd	%r8d, %xmm1
	ucomisd	%xmm1, %xmm0
	movl	%r8d, %r9d
	ja	LBB0_18
## %bb.17:
	cvttsd2si	%xmm0, %r9d
LBB0_18:
	movl	16(%r12), %edi
	movl	16(%r14), %esi
	movl	8(%rcx), %edx
	movl	12(%rcx), %ecx
	leal	(%rdx,%rcx), %ebx
	movl	%ebx, %eax
	negl	%eax
	addl	%esi, %eax
	addl	$-40, %eax
	cmpl	%eax, %edi
	jle	LBB0_20
## %bb.19:
	subl	%ebx, %esi
	subl	%edi, %esi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	addl	%edx, %eax
	movl	%eax, %edx
	jmp	LBB0_23
LBB0_20:
	movsd	24(%r12), %xmm0                 ## xmm0 = mem[0],zero
	addl	$20, %edx
	xorps	%xmm1, %xmm1
	cvtsi2sd	%edx, %xmm1
	ucomisd	%xmm0, %xmm1
	ja	LBB0_23
## %bb.21:
	addl	%ecx, %edi
	subl	%edi, %esi
	addl	$-20, %esi
	xorps	%xmm1, %xmm1
	cvtsi2sd	%esi, %xmm1
	ucomisd	%xmm1, %xmm0
	movl	%esi, %edx
	ja	LBB0_23
## %bb.22:
	cvttsd2si	%xmm0, %edx
LBB0_23:
	xorps	%xmm0, %xmm0
	cvtsi2sd	%edx, %xmm0
	movsd	%xmm0, 24(%r12)
	xorps	%xmm0, %xmm0
	cvtsi2sd	%r9d, %xmm0
	movsd	%xmm0, 32(%r12)
LBB0_25:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_27
## %bb.26:
	movq	%r12, %rax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_PIX_FMT_YUVA420P,4,2        ## @AV_PIX_FMT_YUVA420P
	.comm	_SWS_LANCZOS,4,2                ## @SWS_LANCZOS
	.comm	_SWS_ACCURATE_RND,4,2           ## @SWS_ACCURATE_RND
	.comm	_SWS_CS_DEFAULT,4,2             ## @SWS_CS_DEFAULT
	.no_dead_strip	_ScaleSubtitle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ScaleSubtitle
_ScaleSubtitle:                         ; @ScaleSubtitle
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	d9, d8, [sp, #128]              ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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 b8, -72
	.cfi_offset b9, -80
	mov	x19, x2
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	d0, [x1]
	fmov	d2, #1.00000000
	fcmp	d0, #0.0
	b.le	LBB0_3
; %bb.1:
	ldr	d1, [x22, #8]
	fcmp	d1, #0.0
	b.le	LBB0_3
; %bb.2:
	ldp	s2, s3, [x19, #16]
	sshll.2d	v2, v2, #0
	scvtf	d2, d2
	fdiv	d0, d2, d0
	sshll.2d	v2, v3, #0
	scvtf	d2, d2
	fdiv	d1, d2, d1
	fcmp	d0, d1
	fcsel	d2, d0, d1, gt
LBB0_3:
	fmov	d0, #-1.00000000
	str	q2, [sp]                        ; 16-byte Folded Spill
	fadd	d8, d2, d0
	fmov	d0, d8
	bl	_ABS
	mov	x8, #5243
	movk	x8, #18350, lsl #16
	movk	x8, #31457, lsl #32
	movk	x8, #16260, lsl #48
	fmov	d1, x8
	fcmp	d0, d1
	b.gt	LBB0_5
; %bb.4:
	fmov	d0, d8
	bl	_ABS
	mov	x8, #5243
	movk	x8, #18350, lsl #16
	movk	x8, #31457, lsl #32
	movk	x8, #16260, lsl #48
	fmov	d1, x8
	fcmp	d0, d1
	b.le	LBB0_12
LBB0_5:
	ldp	s0, s1, [x22, #16]
	sshll.2d	v0, v0, #0
	scvtf	d0, d0
	ldr	q2, [sp]                        ; 16-byte Folded Reload
	fmul	d0, d2, d0
	fcvtzs	w23, d0
	sshll.2d	v0, v1, #0
	scvtf	d0, d0
	fmul	d0, d2, d0
	fcvtzs	w24, d0
Lloh3:
	adrp	x8, _AV_PIX_FMT_YUVA420P@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_PIX_FMT_YUVA420P@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x23
	mov	x2, x24
	bl	_hb_frame_buffer_init
	mov	x20, x0
	cbz	x0, LBB0_22
; %bb.6:
	ldur	q0, [x22, #24]
	ldr	q1, [sp]                        ; 16-byte Folded Reload
	fmul.2d	v0, v0, v1[0]
	stur	q0, [x20, #24]
	add	x0, sp, #88
	add	x1, sp, #40
	mov	x2, x22
	bl	_hb_picture_fill
	add	x0, sp, #56
	add	x1, sp, #24
	mov	x2, x20
	bl	_hb_picture_fill
	ldr	x0, [x21, #16]
	cbz	x0, LBB0_10
; %bb.7:
	ldr	w8, [x21]
	cmp	w8, w23
	b.ne	LBB0_9
; %bb.8:
	ldr	w8, [x21, #4]
	cmp	w8, w24
	b.eq	LBB0_11
LBB0_9:
	bl	_sws_freeContext
LBB0_10:
	ldp	s0, s1, [x22, #16]
	sshll.2d	v0, v0, #0
	scvtf	d0, d0
	sshll.2d	v1, v1, #0
	scvtf	d1, d1
	ldr	w0, [x22, #40]
	ldp	s2, s3, [x20, #16]
	sshll.2d	v2, v2, #0
	scvtf	d2, d2
	sshll.2d	v3, v3, #0
	scvtf	d3, d3
Lloh6:
	adrp	x8, _SWS_LANCZOS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SWS_LANCZOS@GOTPAGEOFF]
Lloh8:
	adrp	x9, _SWS_ACCURATE_RND@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SWS_ACCURATE_RND@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh12:
	adrp	x8, _SWS_CS_DEFAULT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SWS_CS_DEFAULT@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	mov	x1, x0
	bl	_hb_sws_get_context
	str	x0, [x21, #16]
	stp	w23, w24, [x21]
LBB0_11:
	ldr	s0, [x22, #20]
	sshll.2d	v0, v0, #0
	scvtf	d0, d0
	add	x1, sp, #88
	add	x2, sp, #40
	add	x4, sp, #56
	add	x5, sp, #24
	mov	w3, #0
	bl	_sws_scale
	b	LBB0_13
LBB0_12:
	mov	x0, x22
	bl	_hb_buffer_dup
	mov	x20, x0
LBB0_13:
	ldr	w10, [x19, #20]
	ldr	x9, [x21, #8]
	ldp	w8, w11, [x9]
	add	w12, w8, w11
	sub	w12, w10, w12
	mov	w13, #34079
	movk	w13, #20971, lsl #16
	smull	x13, w12, w13
	lsr	x14, x13, #63
	asr	x13, x13, #36
	add	w13, w13, w14
	mov	w14, #20
	cmp	w13, #20
	csel	w13, w13, w14, lt
	ldr	w14, [x20, #20]
	sub	w15, w12, w13, lsl #1
	cmp	w14, w15
	b.le	LBB0_15
; %bb.14:
	sub	w10, w12, w14
	cmp	w10, #0
	cinc	w10, w10, lt
	add	w8, w8, w10, asr #1
	b	LBB0_18
LBB0_15:
	ldr	d0, [x20, #32]
	add	w8, w13, w8
	scvtf	d1, w8
	fcmp	d0, d1
	b.mi	LBB0_18
; %bb.16:
	add	w8, w11, w14
	add	w8, w8, w13
	sub	w8, w10, w8
	scvtf	d1, w8
	fcmp	d0, d1
	b.gt	LBB0_18
; %bb.17:
	fcvtzs	w8, d0
LBB0_18:
	ldr	w10, [x20, #16]
	ldr	w12, [x19, #16]
	ldp	w11, w9, [x9, #8]
	add	w13, w11, w9
	sub	w13, w12, w13
	sub	w14, w13, #40
	cmp	w10, w14
	b.le	LBB0_20
; %bb.19:
	sub	w9, w13, w10
	cmp	w9, #0
	cinc	w9, w9, lt
	add	w9, w11, w9, asr #1
	b	LBB0_21
LBB0_20:
	add	w11, w11, #20
	scvtf	d0, w11
	ldr	d1, [x20, #24]
	add	w9, w10, w9
	sub	w9, w12, w9
	sub	w9, w9, #20
	scvtf	d2, w9
	fcmp	d1, d2
	fcvtzs	w10, d1
	csel	w9, w9, w10, gt
	fcmp	d1, d0
	csel	w9, w11, w9, mi
LBB0_21:
	scvtf	d0, w9
	str	d0, [x20, #24]
	scvtf	d0, w8
	str	d0, [x20, #32]
LBB0_22:
	ldur	x8, [x29, #-72]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.23:
	mov	x0, x20
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #128]              ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_PIX_FMT_YUVA420P,4,2        ; @AV_PIX_FMT_YUVA420P
	.comm	_SWS_LANCZOS,4,2                ; @SWS_LANCZOS
	.comm	_SWS_ACCURATE_RND,4,2           ; @SWS_ACCURATE_RND
	.comm	_SWS_CS_DEFAULT,4,2             ; @SWS_CS_DEFAULT
	.no_dead_strip	_ScaleSubtitle
.subsections_via_symbols
