	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SortedQueueBuffer
_SortedQueueBuffer:                     ## @SortedQueueBuffer
	.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
	movq	%rdi, %r15
	movq	(%rsi), %r14
	movl	8(%rdi), %edi
	callq	_hb_list_add
	movl	8(%r15), %edi
	callq	_hb_list_count
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpl	$2, %eax
	jl	LBB0_14
## %bb.1:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leal	-2(%rax), %r13d
	movq	_AV_NOPTS_VALUE@GOTPCREL(%rip), %r12
	movl	%r13d, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r15), %edi
	movl	%ebx, %esi
	callq	_hb_list_item
	cmpq	%r14, (%rax)
	jl	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	(%r12), %r14
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rbx), %eax
	testl	%ebx, %ebx
	movl	%eax, %ebx
	jg	LBB0_2
## %bb.5:
	cmpl	$1, -48(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_14
## %bb.6:
	movl	$-1, %ebx
	xorl	%r12d, %r12d
	jmp	LBB0_9
LBB0_7:
	cmpl	%r13d, %ebx
	jge	LBB0_14
## %bb.8:
	movl	8(%r15), %edi
	movl	%ebx, %esi
	callq	_hb_list_item
	movq	%rax, %r12
LBB0_9:
	incl	%ebx
	cmpl	-48(%rbp), %ebx                 ## 4-byte Folded Reload
	jl	LBB0_10
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	incl	%ebx
	movq	%rax, %r12
	cmpl	%ebx, -48(%rbp)                 ## 4-byte Folded Reload
	je	LBB0_14
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %r13
	movl	8(%r15), %edi
	movl	%ebx, %esi
	callq	_hb_list_item
	movq	(%rax), %r14
	movq	%r13, (%rax)
	movq	(%r15), %rcx
	movq	_SYNC_TYPE_VIDEO@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	testq	%r12, %r12
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	%r13, %rcx
	subq	(%r12), %rcx
	movq	%rcx, 8(%r12)
	movq	%r13, 16(%r12)
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ## @AV_NOPTS_VALUE
	.comm	_SYNC_TYPE_VIDEO,8,3            ## @SYNC_TYPE_VIDEO
	.no_dead_strip	_SortedQueueBuffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SortedQueueBuffer
_SortedQueueBuffer:                     ; @SortedQueueBuffer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x23, [x1]
	ldr	w0, [x0, #8]
	bl	_hb_list_add
	ldr	w0, [x19, #8]
	bl	_hb_list_count
	subs	w21, w0, #2
	b.lt	LBB0_13
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x24, _AV_NOPTS_VALUE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _AV_NOPTS_VALUE@GOTPAGEOFF]
	mov	x22, x21
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #8]
	mov	x1, x22
	bl	_hb_list_item
	ldr	x8, [x0]
	ldr	x9, [x24]
	cmp	x8, x23
	ccmp	x23, x9, #4, ge
	b.eq	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w8, w22, #1
	cmp	w22, #0
	mov	x22, x8
	b.gt	LBB0_2
; %bb.4:
	cmp	w20, #1
	b.le	LBB0_13
; %bb.5:
	mov	x21, #0
	mov	w22, #-1
	b	LBB0_8
LBB0_6:
	cmp	w22, w21
	b.ge	LBB0_13
; %bb.7:
	ldr	w0, [x19, #8]
	mov	x1, x22
	bl	_hb_list_item
	mov	x21, x0
LBB0_8:
	add	w22, w22, #1
	cmp	w22, w20
	b.ge	LBB0_13
; %bb.9:
Lloh2:
	adrp	x24, _SYNC_TYPE_VIDEO@GOTPAGE
Lloh3:
	ldr	x24, [x24, _SYNC_TYPE_VIDEO@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	w22, w22, #1
	mov	x21, x0
	mov	x23, x8
	cmp	w20, w22
	b.eq	LBB0_13
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #8]
	mov	x1, x22
	bl	_hb_list_item
	ldr	x8, [x0]
	str	x23, [x0]
	ldr	x9, [x19]
	ldr	x10, [x24]
	cmp	x9, x10
	ccmp	x21, #0, #4, eq
	b.eq	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x9, [x21]
	sub	x9, x23, x9
	stp	x9, x23, [x21, #8]
	b	LBB0_10
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_NOPTS_VALUE,8,3             ; @AV_NOPTS_VALUE
	.comm	_SYNC_TYPE_VIDEO,8,3            ; @SYNC_TYPE_VIDEO
	.no_dead_strip	_SortedQueueBuffer
.subsections_via_symbols
