	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_stream_open                 ## -- Begin function hb_stream_open
	.p2align	4, 0x90
_hb_stream_open:                        ## @hb_stream_open
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movl	%ecx, %ebx
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_hb_fopen
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rax, %r13
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	$40, %edi
	movl	$1, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %rbx
	movq	_HBTF_NO_IDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	jne	LBB0_9
## %bb.8:
	movl	$1, (%rbx)
LBB0_9:
	movq	%r15, 32(%rbx)
	movq	%r13, 16(%rbx)
	movq	%r12, 24(%rbx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 4(%rbx)
	movq	%r14, %rdi
	callq	_strdup
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_16
## %bb.10:
	movq	%rbx, %rdi
	callq	_hb_stream_get_type
	testq	%rax, %rax
	je	LBB0_14
## %bb.11:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_13
## %bb.12:
	movq	%rbx, %rdi
	callq	_prune_streams
LBB0_13:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_hb_stream_seek
	jmp	LBB0_20
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_hb_log
	jmp	LBB0_20
LBB0_3:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_4
LBB0_6:
	movq	%r13, %rdi
	callq	_fclose
	leaq	L_.str.3(%rip), %rdi
LBB0_4:
	xorl	%ebx, %ebx
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_hb_log
	jmp	LBB0_20
LBB0_14:
	movq	16(%rbx), %rdi
	callq	_fclose
	movq	$0, 16(%rbx)
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_ffmpeg_open
	testq	%rax, %rax
	jne	LBB0_20
## %bb.15:
	movq	16(%rbx), %r13
	testq	%r13, %r13
	je	LBB0_17
LBB0_16:
	movq	%r13, %rdi
	callq	_fclose
LBB0_17:
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.18:
	callq	_free
LBB0_19:
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_hb_log
	movq	%rbx, %rdi
	callq	_free
	xorl	%ebx, %ebx
LBB0_20:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hb_stream_open: title is null"

L_.str.1:                               ## @.str.1
	.asciz	"rb"

L_.str.2:                               ## @.str.2
	.asciz	"hb_stream_open: open %s failed"

L_.str.3:                               ## @.str.3
	.asciz	"hb_stream_open: can't allocate space for %s stream state"

	.comm	_HBTF_NO_IDR,4,2                ## @HBTF_NO_IDR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_stream_open                 ; -- Begin function hb_stream_open
	.p2align	2
_hb_stream_open:                        ; @hb_stream_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	x2, LBB0_10
; %bb.1:
	mov	x21, x3
	mov	x22, x2
	mov	x20, x1
	mov	x24, x0
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_hb_fopen
	cbz	x0, LBB0_11
; %bb.2:
	mov	x23, x0
	mov	w0, #40
	mov	w1, #1
	bl	_calloc
	mov	x19, x0
	cbz	x0, LBB0_12
; %bb.3:
	ldr	w8, [x22]
Lloh2:
	adrp	x9, _HBTF_NO_IDR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _HBTF_NO_IDR@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_5
; %bb.4:
	mov	w8, #1
	str	w8, [x19]
LBB0_5:
	stp	x22, x24, [x19, #24]
	str	x23, [x19, #16]
	str	w21, [x19, #4]
	mov	x0, x20
	bl	_strdup
	str	x0, [x19, #8]
	cbz	x0, LBB0_15
; %bb.6:
	mov	x0, x19
	bl	_hb_stream_get_type
	cbz	x0, LBB0_13
; %bb.7:
	cbnz	w21, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_prune_streams
LBB0_9:
	mov	x0, x19
	mov	w1, #0
	bl	_hb_stream_seek
	b	LBB0_20
LBB0_10:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_hb_log
	b	LBB0_19
LBB0_11:
	str	x20, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_hb_log
	b	LBB0_19
LBB0_12:
	mov	x0, x23
	bl	_fclose
	str	x20, [sp]
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_hb_log
	b	LBB0_20
LBB0_13:
	ldr	x0, [x19, #16]
	bl	_fclose
	str	xzr, [x19, #16]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_ffmpeg_open
	cbnz	x0, LBB0_20
; %bb.14:
	ldr	x23, [x19, #16]
	cbz	x23, LBB0_16
LBB0_15:
	mov	x0, x23
	bl	_fclose
LBB0_16:
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_18
; %bb.17:
	bl	_free
LBB0_18:
	str	x20, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_hb_log
	mov	x0, x19
	bl	_free
LBB0_19:
	mov	x19, #0
LBB0_20:
	mov	x0, x19
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hb_stream_open: title is null"

l_.str.1:                               ; @.str.1
	.asciz	"rb"

l_.str.2:                               ; @.str.2
	.asciz	"hb_stream_open: open %s failed"

l_.str.3:                               ; @.str.3
	.asciz	"hb_stream_open: can't allocate space for %s stream state"

	.comm	_HBTF_NO_IDR,4,2                ; @HBTF_NO_IDR
.subsections_via_symbols
