	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_stream_rotate_idx_mdls    ## -- Begin function cx18_stream_rotate_idx_mdls
	.p2align	4, 0x90
_cx18_stream_rotate_idx_mdls:           ## @cx18_stream_rotate_idx_mdls
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r12
	movq	_CX18_ENC_STREAM_TYPE_IDX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %rbx
	leaq	(%r12,%rbx,4), %r15
	movq	%r15, %rdi
	callq	_cx18_stream_enabled
	testl	%eax, %eax
	je	LBB0_4
## %bb.1:
	movq	%r15, %rdi
	callq	_atomic_read
	movl	%eax, %r14d
	leaq	(%r12,%rbx,4), %rdi
	addq	$8, %rdi
	callq	_atomic_read
	addl	%r14d, %eax
	cltq
	movq	_CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jle	LBB0_4
## %bb.2:
	leaq	(%r12,%rbx,4), %r14
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_atomic_read
	cmpl	$2, %eax
	jl	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_cx18_dequeue
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%r15, %rdi
	movq	%rax, %rsi
	movq	%r15, %rdx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cx18_enqueue                   ## TAILCALL
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CX18_ENC_STREAM_TYPE_IDX,8,3   ## @CX18_ENC_STREAM_TYPE_IDX
	.comm	_CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN,8,3 ## @CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_stream_rotate_idx_mdls    ; -- Begin function cx18_stream_rotate_idx_mdls
	.p2align	2
_cx18_stream_rotate_idx_mdls:           ; @cx18_stream_rotate_idx_mdls
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x21, [x0]
Lloh0:
	adrp	x8, _CX18_ENC_STREAM_TYPE_IDX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CX18_ENC_STREAM_TYPE_IDX@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
	mov	w8, #12
	madd	x19, x22, x8, x21
	mov	x0, x19
	bl	_cx18_stream_enabled
	cbz	w0, LBB0_5
; %bb.1:
	mov	x0, x19
	bl	_atomic_read
	mov	x20, x0
	mov	w8, #12
	madd	x8, x22, x8, x21
	add	x0, x8, #8
	bl	_atomic_read
	add	w8, w0, w20
Lloh3:
	adrp	x9, _CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, w8, sxtw
	b.le	LBB0_5
; %bb.2:
	mov	w8, #12
	madd	x8, x22, x8, x21
	add	x20, x8, #4
	mov	x0, x20
	bl	_atomic_read
	cmp	w0, #2
	b.lt	LBB0_5
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	bl	_cx18_dequeue
	cbz	x0, LBB0_5
; %bb.4:
	mov	x1, x0
	mov	x0, x19
	mov	x2, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_cx18_enqueue
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CX18_ENC_STREAM_TYPE_IDX,8,3   ; @CX18_ENC_STREAM_TYPE_IDX
	.comm	_CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN,8,3 ; @CX18_ENC_STREAM_TYPE_IDX_FW_MDL_MIN
.subsections_via_symbols
