	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_bd_read                     ## -- Begin function hb_bd_read
	.p2align	4, 0x90
_hb_bd_read:                            ## @hb_bd_read
	.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	$808, %rsp                      ## imm = 0x328
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-832(%rbp), %r13
	leaq	LJTI0_0(%rip), %r14
	xorl	%eax, %eax
	movq	%rax, -824(%rbp)                ## 8-byte Spill
	xorl	%r15d, %r15d
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
                                        ##       Child Loop BB0_5 Depth 3
	cmpl	$1001, %r15d                    ## imm = 0x3E9
	movl	$1000, %eax                     ## imm = 0x3E8
	cmovgel	%r15d, %eax
	movl	%eax, -836(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_5 Depth 3
	movq	%r15, -848(%rbp)                ## 8-byte Spill
	movl	16(%rbx), %edi
	leaq	-816(%rbp), %rsi
	callq	_next_packet
	movl	%eax, %r15d
	movl	16(%rbx), %edi
	movq	%r13, %rsi
	callq	_bd_get_event
	xorl	%r12d, %r12d
	jmp	LBB0_5
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=3
	movl	-828(%rbp), %edx
	movl	$2, %edi
	leaq	L_.str(%rip), %rsi
	callq	_hb_deep_log
	movl	$1, %r12d
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=3
	movl	16(%rbx), %edi
	movq	%r13, %rsi
	callq	_bd_get_event
LBB0_5:                                 ##   Parent Loop BB0_1 Depth=1
                                        ##     Parent Loop BB0_2 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	testq	%rax, %rax
	je	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=3
	movl	-832(%rbp), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_4
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=3
	movslq	(%r14,%rax,4), %rax
	addq	%r14, %rax
	jmpq	*%rax
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=3
	movl	16(%rbx), %edi
	callq	_bd_read_skip_still
	jmp	LBB0_4
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=3
	leaq	L_.str.1(%rip), %rdi
	callq	_hb_log
	testl	%r15d, %r15d
	jg	LBB0_4
	jmp	LBB0_22
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=3
	movl	-828(%rbp), %eax
	cmpl	4(%rbx), %eax
	jle	LBB0_4
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=3
	movl	%eax, 8(%rbx)
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=2
	testl	%r15d, %r15d
	js	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=2
	movq	-848(%rbp), %r15                ## 8-byte Reload
	jne	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=2
	leal	1(%r15), %eax
	cmpl	-836(%rbp), %r15d               ## 4-byte Folded Reload
	movl	%eax, %r15d
	jne	LBB0_2
	jmp	LBB0_22
LBB0_15:                                ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.2(%rip), %rdi
	callq	_hb_error
	movl	16(%rbx), %edi
	callq	_bd_tell
	movl	16(%rbx), %edi
	leaq	192(%rax), %rsi
	callq	_bd_seek
	movq	-824(%rbp), %rcx                ## 8-byte Reload
	leal	1(%rcx), %eax
	cmpl	$10, %ecx
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -824(%rbp)                ## 8-byte Spill
	movq	-848(%rbp), %r15                ## 8-byte Reload
	jl	LBB0_1
	jmp	LBB0_25
LBB0_16:                                ##   in Loop: Header=BB0_1 Depth=1
	testl	%r15d, %r15d
	jle	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.4(%rip), %rdi
	callq	_hb_error
	xorl	%r15d, %r15d
LBB0_18:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	8(%rbx), %eax
	xorl	%ecx, %ecx
	movq	%rcx, -824(%rbp)                ## 8-byte Spill
	movl	$0, %edx
	cmpl	%eax, 4(%rbx)
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, 4(%rbx)
	movl	%eax, %edx
LBB0_20:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rbx), %edi
	leaq	-800(%rbp), %rsi
	movl	%r12d, %ecx
	callq	_hb_ts_decode_pkt
	testq	%rax, %rax
	je	LBB0_1
	jmp	LBB0_23
LBB0_25:
	leaq	L_.str.3(%rip), %rdi
	callq	_hb_error
	movl	12(%rbx), %edi
	movq	_HB_ERROR_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_hb_set_work_error
LBB0_22:
	xorl	%eax, %eax
LBB0_23:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_26
## %bb.24:
	addq	$808, %rsp                      ## imm = 0x328
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
LJTI0_0:
	.long	L0_0_set_8
	.long	L0_0_set_3
	.long	L0_0_set_9
	.long	L0_0_set_10
	.end_data_region
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bd: Play item %u"

L_.str.1:                               ## @.str.1
	.asciz	"bd: End of title"

L_.str.2:                               ## @.str.2
	.asciz	"bd: Read Error"

L_.str.3:                               ## @.str.3
	.asciz	"bd: Error, too many consecutive read errors"

	.comm	_HB_ERROR_READ,4,2              ## @HB_ERROR_READ
L_.str.4:                               ## @.str.4
	.asciz	"bd: Read Error, skipping bad data."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_bd_read                     ; -- Begin function hb_bd_read
	.p2align	2
_hb_bd_read:                            ; @hb_bd_read
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #800
	mov	x19, x0
	mov	w21, #0
	mov	w28, #0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x9, sp, #16
	stur	x8, [x29, #-96]
	add	x8, x9, #16
	str	x8, [sp]                        ; 8-byte Folded Spill
	mov	w27, #1000
Lloh3:
	adrp	x22, lJTI0_0@PAGE
Lloh4:
	add	x22, x22, lJTI0_0@PAGEOFF
Lloh5:
	adrp	x23, l_.str@PAGE
Lloh6:
	add	x23, x23, l_.str@PAGEOFF
Lloh7:
	adrp	x24, l_.str.1@PAGE
Lloh8:
	add	x24, x24, l_.str.1@PAGEOFF
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
                                        ;       Child Loop BB0_8 Depth 3
	cmp	w28, #1000
	csel	w20, w28, w27, gt
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_8 Depth 3
	ldr	w0, [x19, #16]
	add	x1, sp, #16
	bl	_next_packet
	mov	x26, x0
	ldr	w0, [x19, #16]
	add	x1, sp, #8
	bl	_bd_get_event
	mov	w25, #0
	cbnz	x0, LBB0_8
LBB0_3:                                 ;   in Loop: Header=BB0_2 Depth=2
	tbnz	w26, #31, LBB0_14
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=2
	cbnz	w26, LBB0_15
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=2
	add	w8, w28, #1
	cmp	w28, w20
	mov	x28, x8
	b.ne	LBB0_2
	b	LBB0_22
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=3
	ldr	w2, [sp, #12]
	mov	w0, #2
	mov	x1, x23
	bl	_hb_deep_log
	mov	w25, #1
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=3
	ldr	w0, [x19, #16]
	add	x1, sp, #8
	bl	_bd_get_event
	cbz	x0, LBB0_3
LBB0_8:                                 ;   Parent Loop BB0_1 Depth=1
                                        ;     Parent Loop BB0_2 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w8, [sp, #8]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=3
	adr	x9, LBB0_6
	ldrb	w10, [x22, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=3
	ldr	w0, [x19, #16]
	bl	_bd_read_skip_still
	b	LBB0_7
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=3
	mov	x0, x24
	bl	_hb_log
	cmp	w26, #1
	b.ge	LBB0_7
	b	LBB0_22
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=3
	ldr	w8, [sp, #12]
	ldr	w9, [x19, #4]
	cmp	w8, w9
	b.le	LBB0_7
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=3
	str	w8, [x19, #8]
	b	LBB0_7
LBB0_14:                                ;   in Loop: Header=BB0_1 Depth=1
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_hb_error
	ldr	w0, [x19, #16]
	bl	_bd_tell
	ldr	w8, [x19, #16]
	add	x1, x0, #192
	mov	x0, x8
	bl	_bd_seek
	add	w8, w21, #1
	cmp	w21, #10
	mov	x21, x8
	b.lt	LBB0_1
	b	LBB0_21
LBB0_15:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w28, #1
	b.lt	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_1 Depth=1
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_hb_error
	mov	w28, #0
LBB0_17:                                ;   in Loop: Header=BB0_1 Depth=1
	ldp	w8, w2, [x19, #4]
	cmp	w8, w2
	b.ne	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_1 Depth=1
	mov	w2, #0
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_1 Depth=1
	str	w2, [x19, #4]
LBB0_20:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x19]
	ldr	x1, [sp]                        ; 8-byte Folded Reload
	mov	x3, x25
	bl	_hb_ts_decode_pkt
	mov	w21, #0
	cbz	x0, LBB0_1
	b	LBB0_23
LBB0_21:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_hb_error
	ldr	w0, [x19, #12]
Lloh15:
	adrp	x8, _HB_ERROR_READ@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HB_ERROR_READ@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_hb_set_work_error
LBB0_22:
	mov	x0, #0
LBB0_23:
	ldur	x8, [x29, #-96]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_25
; %bb.24:
	add	sp, sp, #800
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_25:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_10-LBB0_6)>>2
	.byte	(LBB0_6-LBB0_6)>>2
	.byte	(LBB0_11-LBB0_6)>>2
	.byte	(LBB0_12-LBB0_6)>>2
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bd: Play item %u"

l_.str.1:                               ; @.str.1
	.asciz	"bd: End of title"

l_.str.2:                               ; @.str.2
	.asciz	"bd: Read Error"

l_.str.3:                               ; @.str.3
	.asciz	"bd: Error, too many consecutive read errors"

	.comm	_HB_ERROR_READ,4,2              ; @HB_ERROR_READ
l_.str.4:                               ; @.str.4
	.asciz	"bd: Read Error, skipping bad data."

.subsections_via_symbols
