	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function csr1212_append_new_cache
_csr1212_append_new_cache:              ## @csr1212_append_new_cache
	.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	%rsi, %r14
	movq	%rdi, %r12
	movl	$1, %edi
	testq	%r12, %r12
	je	LBB0_5
## %bb.1:
	movq	24(%r12), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.3:
	cmpq	$0, 8(%rax)
	je	LBB0_5
## %bb.4:
	xorl	%edi, %edi
	cmpl	$0, (%r12)
	setle	%dil
LBB0_5:
	callq	_BUG_ON
	movslq	(%r12), %rsi
	leaq	(%rsi,%r14), %rax
	decq	%rax
	movl	%esi, %ecx
	negl	%ecx
	movslq	%ecx, %rbx
	andq	%rax, %rbx
	movq	24(%r12), %rax
	movl	16(%r12), %edx
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	*(%rax)
	movq	%rax, %r14
	movq	_CSR1212_INVALID_ADDR_SPACE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	je	LBB0_6
## %bb.7:
	movq	_CSR1212_REGISTER_SPACE_BASE@GOTPCREL(%rip), %r13
	movq	%r14, %rdi
	subq	(%r13), %rdi
	jl	LBB0_8
## %bb.9:
	movq	%rbx, %rsi
	callq	_csr1212_rom_cache_malloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.10:
	movq	%rax, %r15
	movq	_CSR1212_KV_TYPE_LEAF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CSR1212_KV_ID_EXTENDED_ROM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_csr1212_new_keyval
	movq	%rax, 24(%r15)
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movl	32(%r12), %edi
	movq	%rax, %rsi
	callq	_csr1212_attach_keyval_to_directory
	movq	_CSR1212_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.14:
	movq	(%r13), %rcx
	subq	%rcx, %r14
	movq	24(%r15), %rcx
	movq	%r14, 8(%rcx)
	movl	$-1, (%rcx)
	movl	16(%r15), %edx
	movl	%edx, 4(%rcx)
	movq	8(%r12), %rcx
	movq	%rcx, 8(%r15)
	movq	%r15, (%rcx)
	movq	%r15, 8(%r12)
	jmp	LBB0_15
LBB0_8:
	movq	24(%r12), %rax
	movl	16(%r12), %esi
	movq	%r14, %rdi
	callq	*8(%rax)
	jmp	LBB0_6
LBB0_13:
	movq	24(%r15), %rdi
	callq	_csr1212_release_keyval
LBB0_11:
	movq	24(%r12), %rax
	movl	16(%r12), %esi
	movq	%r14, %rdi
	callq	*8(%rax)
	movq	%r15, %rdi
	callq	_CSR1212_FREE
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CSR1212_INVALID_ADDR_SPACE,8,3 ## @CSR1212_INVALID_ADDR_SPACE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CSR1212_REGISTER_SPACE_BASE,8,3 ## @CSR1212_REGISTER_SPACE_BASE
	.comm	_CSR1212_KV_TYPE_LEAF,4,2       ## @CSR1212_KV_TYPE_LEAF
	.comm	_CSR1212_KV_ID_EXTENDED_ROM,4,2 ## @CSR1212_KV_ID_EXTENDED_ROM
	.comm	_CSR1212_SUCCESS,8,3            ## @CSR1212_SUCCESS
	.no_dead_strip	_csr1212_append_new_cache
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function csr1212_append_new_cache
_csr1212_append_new_cache:              ; @csr1212_append_new_cache
	.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	x20, x1
	mov	x19, x0
	cbz	x0, LBB0_5
; %bb.1:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_5
; %bb.2:
	ldr	x9, [x8]
	cbz	x9, LBB0_5
; %bb.3:
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	w8, [x19]
	cmp	w8, #1
	cset	w0, lt
	b	LBB0_6
LBB0_5:
	mov	w0, #1
LBB0_6:
	bl	_BUG_ON
	ldrsw	x1, [x19]
	add	x8, x1, x20
	sub	x8, x8, #1
	neg	w9, w1
	sxtw	x9, w9
	and	x21, x8, x9
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
	ldr	w2, [x19, #16]
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	blr	x8
Lloh0:
	adrp	x8, _CSR1212_INVALID_ADDR_SPACE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CSR1212_INVALID_ADDR_SPACE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_15
; %bb.7:
	mov	x20, x0
Lloh3:
	adrp	x22, _CSR1212_REGISTER_SPACE_BASE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _CSR1212_REGISTER_SPACE_BASE@GOTPAGEOFF]
	ldr	x8, [x22]
	subs	x0, x0, x8
	b.lt	LBB0_12
; %bb.8:
	mov	x1, x21
	bl	_csr1212_rom_cache_malloc
	cbz	x0, LBB0_12
; %bb.9:
	mov	x21, x0
Lloh5:
	adrp	x8, _CSR1212_KV_TYPE_LEAF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CSR1212_KV_TYPE_LEAF@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x8, _CSR1212_KV_ID_EXTENDED_ROM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CSR1212_KV_ID_EXTENDED_ROM@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	bl	_csr1212_new_keyval
	str	x0, [x21, #24]
	cbz	x0, LBB0_14
; %bb.10:
	mov	x1, x0
	ldr	w0, [x19, #32]
	bl	_csr1212_attach_keyval_to_directory
Lloh11:
	adrp	x8, _CSR1212_SUCCESS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CSR1212_SUCCESS@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_13
; %bb.11:
	ldr	x8, [x22]
	sub	x8, x20, x8
	ldr	x9, [x21, #24]
	str	x8, [x9, #8]
	mov	w8, #-1
	ldr	w10, [x21, #16]
	stp	w8, w10, [x9]
	ldr	x8, [x19, #8]
	str	x8, [x21, #8]
	str	x21, [x8]
	str	x21, [x19, #8]
	b	LBB0_16
LBB0_12:
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #8]
	ldr	w1, [x19, #16]
	mov	x0, x20
	blr	x8
	b	LBB0_15
LBB0_13:
	ldr	x0, [x21, #24]
	bl	_csr1212_release_keyval
LBB0_14:
	ldr	x8, [x19, #24]
	ldr	x8, [x8, #8]
	ldr	w1, [x19, #16]
	mov	x0, x20
	blr	x8
	mov	x0, x21
	bl	_CSR1212_FREE
LBB0_15:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
                                        ; kill: def $w0 killed $w0 killed $x0
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_CSR1212_INVALID_ADDR_SPACE,8,3 ; @CSR1212_INVALID_ADDR_SPACE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CSR1212_REGISTER_SPACE_BASE,8,3 ; @CSR1212_REGISTER_SPACE_BASE
	.comm	_CSR1212_KV_TYPE_LEAF,4,2       ; @CSR1212_KV_TYPE_LEAF
	.comm	_CSR1212_KV_ID_EXTENDED_ROM,4,2 ; @CSR1212_KV_ID_EXTENDED_ROM
	.comm	_CSR1212_SUCCESS,8,3            ; @CSR1212_SUCCESS
	.no_dead_strip	_csr1212_append_new_cache
.subsections_via_symbols
