	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_legacy_ring
_add_legacy_ring:                       ## @add_legacy_ring
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rsi), %rax
	movq	16(%rsi), %rcx
	cmpq	16(%rdi), %rcx
	jne	LBB0_2
## %bb.1:
	cmpq	(%rbx), %rax
	je	LBB0_3
LBB0_2:
	movq	%rcx, 16(%rbx)
	movq	%rax, (%rbx)
	movq	$0, 8(%rbx)
LBB0_3:
	movq	%rbx, %rdi
	callq	_legacy_ring_idx
	movl	%eax, %r15d
	xorl	%edi, %edi
	cmpl	$-1, %eax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	16(%rbx), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	xorl	%edi, %edi
	cmpl	%eax, %r15d
	setge	%dil
	callq	_GEM_BUG_ON
	movq	16(%rbx), %rax
	movq	(%rax), %rax
	movslq	%r15d, %rcx
	movq	%r14, (%rax,%rcx,8)
	incq	8(%rbx)
	movl	%r15d, 8(%r14)
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_add_legacy_ring
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_legacy_ring
_add_legacy_ring:                       ; @add_legacy_ring
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x1, #16]
	ldr	x10, [x0, #16]
	ldr	x9, [x1]
	cmp	x8, x10
	b.ne	LBB0_2
; %bb.1:
	ldr	x10, [x20]
	cmp	x9, x10
	b.eq	LBB0_3
LBB0_2:
	stp	xzr, x8, [x20, #8]
	str	x9, [x20]
LBB0_3:
	mov	x0, x20
	bl	_legacy_ring_idx
	mov	x21, x0
	cmn	w0, #1
	cset	w0, eq
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.4:
	ldr	x8, [x20, #16]
	ldr	x0, [x8]
	bl	_ARRAY_SIZE
	cmp	w21, w0
	cset	w0, ge
	bl	_GEM_BUG_ON
	ldp	x9, x8, [x20, #8]
	ldr	x8, [x8]
	str	x19, [x8, w21, sxtw #3]
	add	x8, x9, #1
	str	x8, [x20, #8]
	str	w21, [x19, #8]
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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_add_legacy_ring
.subsections_via_symbols
