	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ApplyPGSSubs
_ApplyPGSSubs:                          ## @ApplyPGSSubs
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	(%rdi), %edi
	callq	_hb_list_count
	cmpl	$2, %eax
	jl	LBB0_5
## %bb.1:
	movl	%eax, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	leal	-1(%rbx), %r12d
	movl	(%r15), %edi
	movl	%r12d, %esi
	callq	_hb_list_item
	movq	%rax, -40(%rbp)
	movq	(%rax), %rax
	cmpq	(%r14), %rax
	jle	LBB0_3
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %ebx
	cmpl	$1, %r12d
	ja	LBB0_2
	jmp	LBB0_5
LBB0_3:
	leaq	-56(%rbp), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	leal	-2(%rbx), %esi
	callq	_hb_list_item
	movq	%rax, -56(%rbp)
	movl	(%r15), %edi
	movq	%rax, %rsi
	callq	_hb_list_rem
	movq	%r12, %rdi
	callq	_hb_buffer_close
	decl	%ebx
	cmpl	$1, %ebx
	ja	LBB0_4
LBB0_5:
	movl	(%r15), %edi
	callq	_hb_list_count
	testl	%eax, %eax
	jle	LBB0_10
## %bb.6:
	leaq	-40(%rbp), %rbx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r15), %edi
	movq	%rax, %rsi
	callq	_hb_list_rem
	movq	%rbx, %rdi
	callq	_hb_buffer_close
	movl	(%r15), %edi
	callq	_hb_list_count
	testl	%eax, %eax
	jle	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	xorl	%esi, %esi
	callq	_hb_list_item
	movq	%rax, -40(%rbp)
	cmpq	$0, 8(%rax)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpq	$0, 16(%rax)
	je	LBB0_9
LBB0_10:
	movl	(%r15), %edi
	callq	_hb_list_count
	testl	%eax, %eax
	jle	LBB0_13
## %bb.11:
	movl	(%r15), %edi
	xorl	%esi, %esi
	callq	_hb_list_item
	movq	%rax, -40(%rbp)
	movq	(%rax), %rcx
	cmpq	(%r14), %rcx
	jg	LBB0_13
## %bb.12:
	movq	%r15, %rdi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_ScaleSubtitle
	movq	%rax, -48(%rbp)
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	callq	_ApplySub
	leaq	-48(%rbp), %rdi
	callq	_hb_buffer_close
LBB0_13:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ApplyPGSSubs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ApplyPGSSubs
_ApplyPGSSubs:                          ; @ApplyPGSSubs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0]
	bl	_hb_list_count
	cmp	w0, #1
	b.le	LBB0_5
; %bb.1:
	mov	x21, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	sub	w22, w21, #1
	ldr	w0, [x20]
	mov	x1, x22
	bl	_hb_list_item
	str	x0, [sp, #16]
	ldr	x8, [x0]
	ldr	x9, [x19]
	cmp	x8, x9
	b.le	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x21, x22
	cmp	w22, #1
	b.hi	LBB0_2
	b	LBB0_5
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	sub	w1, w21, #2
	bl	_hb_list_item
	mov	x1, x0
	str	x0, [sp, #24]
	ldr	w0, [x20]
	bl	_hb_list_rem
	add	x0, sp, #24
	bl	_hb_buffer_close
	sub	w21, w21, #1
	cmp	w21, #1
	b.hi	LBB0_4
LBB0_5:
	ldr	w0, [x20]
	bl	_hb_list_count
	cmp	w0, #1
	b.ge	LBB0_7
	b	LBB0_9
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x20]
	bl	_hb_list_rem
	add	x0, sp, #16
	bl	_hb_buffer_close
	ldr	w0, [x20]
	bl	_hb_list_count
	cmp	w0, #0
	b.le	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	mov	w1, #0
	bl	_hb_list_item
	mov	x1, x0
	str	x0, [sp, #16]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x1, #16]
	cbz	x8, LBB0_6
LBB0_9:
	ldr	w0, [x20]
	bl	_hb_list_count
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.10:
	ldr	w0, [x20]
	mov	w1, #0
	bl	_hb_list_item
	str	x0, [sp, #16]
	ldr	x8, [x0]
	ldr	x9, [x19]
	cmp	x8, x9
	b.gt	LBB0_12
; %bb.11:
	mov	x1, x0
	mov	x0, x20
	mov	x2, x19
	bl	_ScaleSubtitle
	mov	x2, x0
	str	x0, [sp, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_ApplySub
	add	x0, sp, #8
	bl	_hb_buffer_close
LBB0_12:
	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
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ApplyPGSSubs
.subsections_via_symbols
