	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mkv_read_element_segment
_mkv_read_element_segment:              ## @mkv_read_element_segment
	.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	%rdx, %r15
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	(%rax), %rbx
	movq	_VC_CONTAINER_SUCCESS@GOTPCREL(%rip), %r13
	movq	(%r13), %r12
	callq	_STREAM_POSITION
	movl	$0, 24(%rbx)
	movq	%r14, %rdi
	callq	_STREAM_POSITION
	movq	32(%rbx), %rcx
	movq	%rax, 32(%rcx)
	movq	%r15, 24(%rcx)
	movq	_MKV_ELEMENT_ID_SEGMENT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rcx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rcx)
	movl	$1000000, (%rbx)                ## imm = 0xF4240
	movq	$0, 8(%rbx)
	movq	%r14, %rdi
	callq	_STREAM_POSITION
	movq	%r12, %rdx
	movq	%rax, 56(%rbx)
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, 48(%rbx)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	incl	16(%rbx)
	cmpq	(%r13), %r12
	jne	LBB0_13
## %bb.1:
	movq	%r13, %rbx
	movq	%r14, %r15
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %r14
	testq	%rax, %rax
	js	LBB0_5
## %bb.2:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, %r14
	movq	_MKV_ELEMENT_MIN_HEADER_SIZE@GOTPCREL(%rip), %rax
	cmpq	%rcx, (%rax)
	jg	LBB0_13
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	-72(%rbp), %rsi
	movq	-64(%rbp), %rdx
	movq	%rdi, %r14
	movq	%r12, %rcx
	callq	_mkv_read_element_data
	movq	%rax, %rdx
	testq	%r15, %r15
	js	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %r15
	movq	%r14, %rdi
	movq	%rdx, %r14
	callq	_STREAM_POSITION
	movq	%r14, %rdx
	addq	%r12, %r13
	subq	%rax, %r13
	movq	%r13, %r14
	cmpq	(%rbx), %rdx
	je	LBB0_3
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %r15
	movq	%r12, %r14
	cmpq	(%rbx), %rdx
	jne	LBB0_13
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	js	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_MKV_ELEMENT_MIN_HEADER_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jl	LBB0_13
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	_mkv_elements_list@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -72(%rbp)
	movq	%r15, %rdi
	callq	_STREAM_POSITION
	movq	%rax, %r13
	leaq	-88(%rbp), %rdx
	leaq	-64(%rbp), %rcx
	leaq	-72(%rbp), %r9
	movq	%r15, %rdi
	movq	%r14, %r12
	movq	%r14, %rsi
	movq	-80(%rbp), %r8                  ## 8-byte Reload
	callq	_mkv_read_element_header
	movq	%rax, %r14
	cmpq	(%rbx), %rax
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-88(%rbp), %rax
	movq	_MKV_ELEMENT_ID_CLUSTER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.7:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	40(%r15), %eax
	movl	%eax, 44(%r15)
	movl	$1, 24(%r15)
	movq	%rcx, %rbx
	callq	_STREAM_POSITION
	movq	32(%r15), %rcx
	movq	%rax, 72(%rcx)
	movq	-64(%rbp), %rax
	movq	%rax, 64(%rcx)
	movq	(%rbx), %rax
	movq	%rax, 56(%rcx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rcx)
LBB0_8:
	movq	%r14, %rdx
LBB0_13:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	decl	16(%rax)
	movq	%rdx, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ## @VC_CONTAINER_SUCCESS
	.comm	_MKV_ELEMENT_ID_SEGMENT,8,3     ## @MKV_ELEMENT_ID_SEGMENT
	.comm	_MKV_ELEMENT_MIN_HEADER_SIZE,8,3 ## @MKV_ELEMENT_MIN_HEADER_SIZE
	.comm	_mkv_elements_list,8,3          ## @mkv_elements_list
	.comm	_MKV_ELEMENT_ID_CLUSTER,8,3     ## @MKV_ELEMENT_ID_CLUSTER
	.no_dead_strip	_mkv_read_element_segment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mkv_read_element_segment
_mkv_read_element_segment:              ; @mkv_read_element_segment
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x25, [x8]
Lloh0:
	adrp	x26, _VC_CONTAINER_SUCCESS@GOTPAGE
Lloh1:
	ldr	x26, [x26, _VC_CONTAINER_SUCCESS@GOTPAGEOFF]
	ldr	x22, [x26]
	bl	_STREAM_POSITION
	str	wzr, [x25, #24]
	mov	x0, x19
	bl	_STREAM_POSITION
	ldr	x8, [x25, #32]
	str	x0, [x8, #32]
Lloh2:
	adrp	x9, _MKV_ELEMENT_ID_SEGMENT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MKV_ELEMENT_ID_SEGMENT@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	stp	x9, x20, [x8, #16]
	stp	xzr, xzr, [x8]
	mov	w8, #16960
	movk	w8, #15, lsl #16
	str	w8, [x25]
	str	xzr, [x25, #8]
	mov	x0, x19
	bl	_STREAM_POSITION
	stp	x20, x0, [x25, #48]
	ldr	w8, [x25, #16]
	add	w8, w8, #1
	str	w8, [x25, #16]
	ldr	x8, [x26]
	cmp	x22, x8
	b.ne	LBB0_11
; %bb.1:
Lloh5:
	adrp	x27, _MKV_ELEMENT_MIN_HEADER_SIZE@GOTPAGE
Lloh6:
	ldr	x27, [x27, _MKV_ELEMENT_MIN_HEADER_SIZE@GOTPAGEOFF]
	mov	x23, x20
	tbnz	x20, #63, LBB0_8
; %bb.2:
	ldr	x8, [x27]
	mov	x23, x20
	cmp	x8, x20
	b.gt	LBB0_11
	b	LBB0_8
LBB0_3:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x1, [sp, #24]
	ldr	x2, [sp, #8]
	mov	x0, x19
	mov	x3, x23
	bl	_mkv_read_element_data
	mov	x22, x0
	tbnz	x20, #63, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x19
	bl	_STREAM_POSITION
	add	x8, x24, x23
	sub	x23, x8, x0
LBB0_5:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x26]
	cmp	x22, x8
	b.ne	LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_8 Depth=1
	tbnz	x20, #63, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x27]
	cmp	x23, x8
	b.lt	LBB0_11
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
Lloh7:
	adrp	x8, _mkv_elements_list@GOTPAGE
Lloh8:
	ldr	x8, [x8, _mkv_elements_list@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	mov	x0, x19
	bl	_STREAM_POSITION
	mov	x24, x0
	add	x2, sp, #16
	add	x3, sp, #8
	add	x5, sp, #24
	mov	x0, x19
	mov	x1, x23
	mov	x4, x21
	bl	_mkv_read_element_header
	mov	x22, x0
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [sp, #16]
Lloh10:
	adrp	x28, _MKV_ELEMENT_ID_CLUSTER@GOTPAGE
Lloh11:
	ldr	x28, [x28, _MKV_ELEMENT_ID_CLUSTER@GOTPAGEOFF]
	ldr	x9, [x28]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.10:
	ldr	w8, [x25, #40]
	str	w8, [x25, #44]
	mov	w8, #1
	str	w8, [x25, #24]
	mov	x0, x19
	bl	_STREAM_POSITION
	ldr	x8, [x25, #32]
	ldr	x9, [sp, #8]
	ldr	x10, [x28]
	stp	x9, x0, [x8, #64]
	stp	xzr, x10, [x8, #48]
	str	xzr, [x8, #40]
LBB0_11:
	ldr	w8, [x25, #16]
	sub	w8, w8, #1
	str	w8, [x25, #16]
	mov	x0, x22
	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
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_VC_CONTAINER_SUCCESS,8,3       ; @VC_CONTAINER_SUCCESS
	.comm	_MKV_ELEMENT_ID_SEGMENT,8,3     ; @MKV_ELEMENT_ID_SEGMENT
	.comm	_MKV_ELEMENT_MIN_HEADER_SIZE,8,3 ; @MKV_ELEMENT_MIN_HEADER_SIZE
	.comm	_mkv_elements_list,8,3          ; @mkv_elements_list
	.comm	_MKV_ELEMENT_ID_CLUSTER,8,3     ; @MKV_ELEMENT_ID_CLUSTER
	.no_dead_strip	_mkv_read_element_segment
.subsections_via_symbols
