	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function mkv_reader_open
LCPI0_0:
	.long	26                              ## 0x1a
	.long	69                              ## 0x45
	.long	223                             ## 0xdf
	.long	163                             ## 0xa3
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_mkv_reader_open
	.p2align	4, 0x90
_mkv_reader_open:                       ## @mkv_reader_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	leaq	-64(%rbp), %rsi
	movl	$4, %edx
	callq	_PEEK_BYTES
	cmpl	$4, %eax
	jl	LBB0_5
## %bb.1:
	movdqa	-64(%rbp), %xmm0
	pcmpeqd	LCPI0_0(%rip), %xmm0
	movmskps	%xmm0, %eax
	xorl	$15, %eax
	testb	$1, %al
	jne	LBB0_5
## %bb.2:
	movl	%eax, %ecx
	andb	$2, %cl
	shrb	%cl
	jne	LBB0_5
## %bb.3:
	movl	%eax, %ecx
	andb	$4, %cl
	shrb	$2, %cl
	jne	LBB0_5
## %bb.4:
	shrb	$3, %al
	jne	LBB0_5
## %bb.6:
	movl	$56, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r15
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movq	24(%r14), %rax
	movq	%r15, 16(%rax)
	movl	48(%r15), %eax
	movl	%eax, 36(%r14)
	movq	_mkv_elements_list@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r15)
	movl	$-1, %edi
	callq	_INT64_C
	movq	_MKV_ELEMENT_ID_UNKNOWN@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mkv_read_element
	movq	%rax, %rbx
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_25
## %bb.9:
	cmpl	$0, 40(%r15)
	je	LBB0_10
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	$-1, %edi
	callq	_INT64_C
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mkv_read_element
	cmpq	(%r12), %rax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	$0, 32(%r15)
	je	LBB0_11
LBB0_13:
	cmpl	$0, 32(%r14)
	je	LBB0_23
## %bb.14:
	movq	24(%r14), %rax
	movq	_mkv_reader_close@GOTPCREL(%rip), %rcx
	movq	%rcx, 8(%rax)
	movq	_mkv_reader_read@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rax)
	movq	_mkv_reader_seek@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	movslq	(%r15), %rax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$38, %rax
	addl	%ecx, %eax
	imull	4(%r15), %eax
	movl	%eax, (%r14)
	movq	%r14, %rdi
	callq	_STREAM_SEEKABLE
	testl	%eax, %eax
	je	LBB0_15
## %bb.16:
	movq	24(%r15), %rax
	testq	%rax, %rax
	je	LBB0_19
## %bb.17:
	cmpq	8(%r14), %rax
	jge	LBB0_19
## %bb.18:
	movq	_VC_CONTAINER_CAPS_CAN_SEEK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r14)
LBB0_19:
	movq	16(%r15), %rsi
	testq	%rsi, %rsi
	je	LBB0_22
## %bb.20:
	movq	%r14, %rdi
	callq	_SEEK
	cmpq	(%r12), %rax
	jne	LBB0_22
## %bb.21:
	movl	$-1, %edi
	callq	_INT64_C
	movq	_MKV_ELEMENT_ID_SEGMENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mkv_read_element
LBB0_22:
	movq	8(%r15), %rax
	movq	8(%rax), %rsi
	movq	%r14, %rdi
	callq	_SEEK
	movq	%rax, %rbx
	jmp	LBB0_26
LBB0_5:
	movq	_VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	jmp	LBB0_26
LBB0_7:
	movq	_VC_CONTAINER_ERROR_OUT_OF_MEMORY@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_LOG_DEBUG
	jmp	LBB0_26
LBB0_10:
	movq	_VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_23:
	movq	_VC_CONTAINER_ERROR_NO_TRACK_AVAILABLE@GOTPCREL(%rip), %rax
LBB0_24:
	movq	(%rax), %rbx
LBB0_25:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_LOG_DEBUG
	movq	%r14, %rdi
	callq	_mkv_reader_close
LBB0_26:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	(%r12), %rbx
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_VC_CONTAINER_ERROR_FORMAT_INVALID,8,3 ## @VC_CONTAINER_ERROR_FORMAT_INVALID
	.comm	_VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED,8,3 ## @VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED
	.comm	_VC_CONTAINER_ERROR_OUT_OF_MEMORY,8,3 ## @VC_CONTAINER_ERROR_OUT_OF_MEMORY
	.comm	_mkv_elements_list,4,2          ## @mkv_elements_list
	.comm	_MKV_ELEMENT_ID_UNKNOWN,4,2     ## @MKV_ELEMENT_ID_UNKNOWN
	.comm	_VC_CONTAINER_SUCCESS,8,3       ## @VC_CONTAINER_SUCCESS
	.comm	_VC_CONTAINER_ERROR_NO_TRACK_AVAILABLE,8,3 ## @VC_CONTAINER_ERROR_NO_TRACK_AVAILABLE
	.comm	_mkv_reader_read,4,2            ## @mkv_reader_read
	.comm	_mkv_reader_seek,4,2            ## @mkv_reader_seek
	.comm	_VC_CONTAINER_CAPS_CAN_SEEK,4,2 ## @VC_CONTAINER_CAPS_CAN_SEEK
	.comm	_MKV_ELEMENT_ID_SEGMENT,4,2     ## @MKV_ELEMENT_ID_SEGMENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mkv: error opening stream (%i)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mkv_reader_open                ; -- Begin function mkv_reader_open
	.p2align	2
_mkv_reader_open:                       ; @mkv_reader_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	add	x1, sp, #8
	mov	w2, #4
	bl	_PEEK_BYTES
	ldr	w8, [sp, #8]
	cmp	w0, #4
	ccmp	w8, #26, #0, ge
	b.ne	LBB0_18
; %bb.1:
	ldr	w8, [sp, #12]
	cmp	w8, #69
	b.ne	LBB0_18
; %bb.2:
	ldr	w8, [sp, #16]
	cmp	w8, #223
	b.ne	LBB0_18
; %bb.3:
	ldr	w8, [sp, #20]
	cmp	w8, #163
	b.ne	LBB0_18
; %bb.4:
	mov	w0, #56
	bl	_malloc
	cbz	x0, LBB0_19
; %bb.5:
	mov	x20, x0
	mov	w1, #0
	mov	w2, #56
	bl	_memset
	ldr	x8, [x19, #24]
	str	x20, [x8, #16]
	ldr	w8, [x20, #48]
	str	w8, [x19, #36]
Lloh3:
	adrp	x8, _mkv_elements_list@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mkv_elements_list@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x20, #44]
	mov	w0, #-1
	bl	_INT64_C
	mov	x1, x0
Lloh6:
	adrp	x23, _MKV_ELEMENT_ID_UNKNOWN@GOTPAGE
Lloh7:
	ldr	x23, [x23, _MKV_ELEMENT_ID_UNKNOWN@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	x0, x19
	bl	_mkv_read_element
	mov	x21, x0
Lloh8:
	adrp	x22, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh9:
	ldr	x22, [x22, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_23
; %bb.6:
	ldr	w8, [x20, #40]
	cbz	w8, LBB0_20
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #-1
	bl	_INT64_C
	mov	x1, x0
	ldr	w2, [x23]
	mov	x0, x19
	bl	_mkv_read_element
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_7
LBB0_9:
	ldr	w8, [x19, #32]
	cbz	w8, LBB0_21
; %bb.10:
	ldr	x8, [x19, #24]
Lloh10:
	adrp	x9, _mkv_reader_close@GOTPAGE
Lloh11:
	ldr	x9, [x9, _mkv_reader_close@GOTPAGEOFF]
	str	x9, [x8, #8]
Lloh12:
	adrp	x9, _mkv_reader_read@GOTPAGE
Lloh13:
	ldr	x9, [x9, _mkv_reader_read@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _mkv_reader_seek@GOTPAGE
Lloh16:
	ldr	x10, [x10, _mkv_reader_seek@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	stp	w10, w9, [x8]
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	ldp	w9, w10, [x20]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	mul	x8, x9, x8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w8, w8, w9
	mul	w8, w8, w10
	str	w8, [x19]
	mov	x0, x19
	bl	_STREAM_SEEKABLE
	cbz	w0, LBB0_26
; %bb.11:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_14
; %bb.12:
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.ge	LBB0_14
; %bb.13:
Lloh18:
	adrp	x8, _VC_CONTAINER_CAPS_CAN_SEEK@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VC_CONTAINER_CAPS_CAN_SEEK@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	orr	w8, w9, w8
	str	w8, [x19, #16]
LBB0_14:
	ldr	x1, [x20, #16]
	cbz	x1, LBB0_17
; %bb.15:
	mov	x0, x19
	bl	_SEEK
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_17
; %bb.16:
	mov	w0, #-1
	bl	_INT64_C
	mov	x1, x0
Lloh21:
	adrp	x8, _MKV_ELEMENT_ID_SEGMENT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MKV_ELEMENT_ID_SEGMENT@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_mkv_read_element
LBB0_17:
	ldr	x8, [x20, #8]
	ldr	x1, [x8, #8]
	mov	x0, x19
	bl	_SEEK
	mov	x21, x0
	b	LBB0_24
LBB0_18:
Lloh24:
	adrp	x8, _VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED@GOTPAGEOFF]
Lloh26:
	ldr	x21, [x8]
	b	LBB0_24
LBB0_19:
Lloh27:
	adrp	x8, _VC_CONTAINER_ERROR_OUT_OF_MEMORY@GOTPAGE
Lloh28:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_OUT_OF_MEMORY@GOTPAGEOFF]
Lloh29:
	ldr	x21, [x8]
Lloh30:
	adrp	x1, l_.str@PAGE
Lloh31:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_LOG_DEBUG
	b	LBB0_24
LBB0_20:
Lloh32:
	adrp	x8, _VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED@GOTPAGE
Lloh33:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED@GOTPAGEOFF]
	b	LBB0_22
LBB0_21:
Lloh34:
	adrp	x8, _VC_CONTAINER_ERROR_NO_TRACK_AVAILABLE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _VC_CONTAINER_ERROR_NO_TRACK_AVAILABLE@GOTPAGEOFF]
LBB0_22:
	ldr	x21, [x8]
LBB0_23:
Lloh36:
	adrp	x1, l_.str@PAGE
Lloh37:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_LOG_DEBUG
	mov	x0, x19
	bl	_mkv_reader_close
LBB0_24:
	ldr	x8, [sp, #24]
Lloh38:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh39:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.25:
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
LBB0_26:
	ldr	x21, [x22]
	b	LBB0_24
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_VC_CONTAINER_ERROR_FORMAT_INVALID,8,3 ; @VC_CONTAINER_ERROR_FORMAT_INVALID
	.comm	_VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED,8,3 ; @VC_CONTAINER_ERROR_FORMAT_NOT_SUPPORTED
	.comm	_VC_CONTAINER_ERROR_OUT_OF_MEMORY,8,3 ; @VC_CONTAINER_ERROR_OUT_OF_MEMORY
	.comm	_mkv_elements_list,4,2          ; @mkv_elements_list
	.comm	_MKV_ELEMENT_ID_UNKNOWN,4,2     ; @MKV_ELEMENT_ID_UNKNOWN
	.comm	_VC_CONTAINER_SUCCESS,8,3       ; @VC_CONTAINER_SUCCESS
	.comm	_VC_CONTAINER_ERROR_NO_TRACK_AVAILABLE,8,3 ; @VC_CONTAINER_ERROR_NO_TRACK_AVAILABLE
	.comm	_mkv_reader_read,4,2            ; @mkv_reader_read
	.comm	_mkv_reader_seek,4,2            ; @mkv_reader_seek
	.comm	_VC_CONTAINER_CAPS_CAN_SEEK,4,2 ; @VC_CONTAINER_CAPS_CAN_SEEK
	.comm	_MKV_ELEMENT_ID_SEGMENT,4,2     ; @MKV_ELEMENT_ID_SEGMENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mkv: error opening stream (%i)"

.subsections_via_symbols
