	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hb_ps_stream_decode
_hb_ps_stream_decode:                   ## @hb_ps_stream_decode
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_HB_DVD_READ_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_hb_buffer_init
	movq	%rax, %rbx
	movq	%rax, -48(%rbp)
	movq	$0, (%rax)
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_hb_ps_read_packet
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	leaq	-88(%rbp), %r15
	movq	_TS_HAS_PCR@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	28(%r14)
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	$0, (%rbx)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_hb_ps_read_packet
	testl	%eax, %eax
	je	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdx
	movq	8(%rbx), %rsi
	movq	%r14, %rdi
	movq	%r15, %rcx
	callq	_hb_parse_ps
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-88(%rbp), %esi
	cmpl	$186, %esi
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, 8(%r14)
	movl	(%r13), %eax
	orl	%eax, (%r14)
	movl	-56(%rbp), %eax
	movl	%eax, 12(%r14)
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, 8(%r14)
	je	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$187, %esi
	je	LBB0_6
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$189, %esi
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	-60(%rbp), %edx
	movq	%r14, %rdi
	movl	$189, %esi
	jmp	LBB0_14
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %eax
	testl	%eax, (%r14)
	jne	LBB0_6
	jmp	LBB0_10
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	-64(%rbp), %edx
	movq	%r14, %rdi
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	callq	_index_of_ps_stream
	testl	%eax, %eax
	js	LBB0_6
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r14), %rcx
	movl	%eax, %r12d
	movl	(%rcx,%r12,4), %ecx
	movq	_OTHER_BUF@GOTPCREL(%rip), %rax
	cmpl	$128, %ecx
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_VIDEO_BUF@GOTPCREL(%rip), %rax
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$129, %ecx
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_AUDIO_BUF@GOTPCREL(%rip), %rax
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rax), %rcx
	movq	%rcx, 16(%rbx)
	cmpl	$0, 4(%r14)
	je	LBB0_27
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_VIDEO_BUF@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rcx
	jne	LBB0_24
## %bb.21:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx), %rdx
	movq	8(%rbx), %rsi
	movq	%r14, %rdi
	callq	_isIframe
	movq	16(%rbx), %rcx
	testl	%eax, %eax
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%rcx, %rax
	jmp	LBB0_26
LBB0_23:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_VIDEO_BUF@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_24:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpq	%rax, %rcx
	jne	LBB0_6
## %bb.25:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r14), %ecx
	leal	1(%rcx), %edx
	movl	%edx, 4(%r14)
	cmpl	$599, %ecx                      ## imm = 0x257
	jl	LBB0_6
LBB0_26:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	$0, 4(%r14)
	movq	%rax, %rcx
LBB0_27:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_VIDEO_BUF@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_29
## %bb.28:                              ##   in Loop: Header=BB0_2 Depth=1
	incl	24(%r14)
LBB0_29:                                ##   in Loop: Header=BB0_2 Depth=1
	shlq	$2, %r12
	addq	16(%r14), %r12
	movq	%r12, %rdi
	callq	_get_id
	movl	%eax, 36(%rbx)
	movl	12(%r14), %eax
	movl	%eax, 32(%rbx)
	movl	-68(%rbp), %eax
	movl	%eax, 28(%rbx)
	movl	-72(%rbp), %eax
	movl	%eax, 24(%rbx)
	movq	(%rbx), %rdx
	movq	8(%rbx), %rdi
	movq	-80(%rbp), %rsi
	subq	%rsi, %rdx
	addq	%rdi, %rsi
	callq	_memmove
	movq	-80(%rbp), %rax
	subq	%rax, (%rbx)
	je	LBB0_6
## %bb.30:
	movq	_AV_NOPTS_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	jmp	LBB0_31
LBB0_7:
	leaq	-48(%rbp), %rdi
	callq	_hb_buffer_close
	movq	-48(%rbp), %rbx
LBB0_31:
	movq	%rbx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HB_DVD_READ_BUFFER_SIZE,4,2    ## @HB_DVD_READ_BUFFER_SIZE
	.comm	_TS_HAS_PCR,4,2                 ## @TS_HAS_PCR
	.comm	_AUDIO_BUF,8,3                  ## @AUDIO_BUF
	.comm	_VIDEO_BUF,8,3                  ## @VIDEO_BUF
	.comm	_OTHER_BUF,8,3                  ## @OTHER_BUF
	.comm	_AV_NOPTS_VALUE,4,2             ## @AV_NOPTS_VALUE
	.no_dead_strip	_hb_ps_stream_decode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hb_ps_stream_decode
_hb_ps_stream_decode:                   ; @hb_ps_stream_decode
	.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	x20, x0
Lloh0:
	adrp	x8, _HB_DVD_READ_BUFFER_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HB_DVD_READ_BUFFER_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_hb_buffer_init
	mov	x19, x0
	str	x0, [sp]
	str	xzr, [x0]
	mov	x0, x20
	mov	x1, x19
	bl	_hb_ps_read_packet
	cbz	w0, LBB0_26
; %bb.1:
	mov	w22, #1
Lloh3:
	adrp	x23, _TS_HAS_PCR@GOTPAGE
Lloh4:
	ldr	x23, [x23, _TS_HAS_PCR@GOTPAGEOFF]
Lloh5:
	adrp	x24, _AUDIO_BUF@GOTPAGE
Lloh6:
	ldr	x24, [x24, _AUDIO_BUF@GOTPAGEOFF]
Lloh7:
	adrp	x25, _VIDEO_BUF@GOTPAGE
Lloh8:
	ldr	x25, [x25, _VIDEO_BUF@GOTPAGEOFF]
Lloh9:
	adrp	x26, _OTHER_BUF@GOTPAGE
Lloh10:
	ldr	x26, [x26, _OTHER_BUF@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20, #28]
	add	w8, w8, #1
	str	w8, [x20, #28]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	xzr, [x19]
	mov	x0, x20
	mov	x1, x19
	bl	_hb_ps_read_packet
	cbz	w0, LBB0_26
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x2, x1, [x19]
	add	x3, sp, #8
	mov	x0, x20
	bl	_hb_parse_ps
	cbz	w0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [sp, #8]
	cmp	w1, #186
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	ldr	w8, [sp, #40]
	stp	w22, w8, [x20, #8]
	b	LBB0_3
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20, #8]
	cbz	w8, LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w1, #187
	b.eq	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w1, #189
	b.ne	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [sp, #36]
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_3
	b	LBB0_8
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [sp, #32]
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_index_of_ps_stream
	mov	x21, x0
	tbnz	w0, #31, LBB0_3
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, #16]
	ldr	w8, [x8, w21, uxtw #2]
	cmp	w8, #128
	csel	x9, x25, x26, eq
	cmp	w8, #129
	csel	x8, x24, x9, eq
	ldr	x8, [x8]
	str	x8, [x19, #16]
	ldr	w9, [x20, #4]
	cbz	w9, LBB0_22
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_4 Depth=1
	ldp	x2, x1, [x19]
	mov	x0, x20
	bl	_isIframe
	ldr	x8, [x19, #16]
	cbz	w0, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x9, x8
	b	LBB0_21
LBB0_18:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x25]
LBB0_19:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.20:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20, #4]
	add	w10, w8, #1
	str	w10, [x20, #4]
	cmp	w8, #599
	b.lt	LBB0_3
LBB0_21:                                ;   in Loop: Header=BB0_4 Depth=1
	str	wzr, [x20, #4]
	mov	x8, x9
LBB0_22:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20, #24]
	add	w8, w8, #1
	str	w8, [x20, #24]
LBB0_24:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, w21
	ldr	x9, [x20, #16]
	add	x0, x9, x8, lsl #2
	bl	_get_id
	str	w0, [x19, #36]
	ldr	w8, [x20, #12]
	str	w8, [x19, #32]
	ldr	d0, [sp, #24]
	str	d0, [x19, #24]
	ldr	x8, [sp, #16]
	ldp	x9, x0, [x19]
	add	x1, x8, x0
	sub	x2, x9, x8
	bl	_memmove
	ldr	x8, [sp, #16]
	ldr	x9, [x19]
	subs	x8, x9, x8
	str	x8, [x19]
	b.eq	LBB0_3
; %bb.25:
Lloh11:
	adrp	x8, _AV_NOPTS_VALUE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AV_NOPTS_VALUE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x20, #12]
	b	LBB0_27
LBB0_26:
	mov	x0, sp
	bl	_hb_buffer_close
	ldr	x19, [sp]
LBB0_27:
	mov	x0, x19
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_HB_DVD_READ_BUFFER_SIZE,4,2    ; @HB_DVD_READ_BUFFER_SIZE
	.comm	_TS_HAS_PCR,4,2                 ; @TS_HAS_PCR
	.comm	_AUDIO_BUF,8,3                  ; @AUDIO_BUF
	.comm	_VIDEO_BUF,8,3                  ; @VIDEO_BUF
	.comm	_OTHER_BUF,8,3                  ; @OTHER_BUF
	.comm	_AV_NOPTS_VALUE,4,2             ; @AV_NOPTS_VALUE
	.no_dead_strip	_hb_ps_stream_decode
.subsections_via_symbols
