	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_csr1212_create_csr             ## -- Begin function csr1212_create_csr
	.p2align	4, 0x90
_csr1212_create_csr:                    ## @csr1212_create_csr
	.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	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r15
	movl	$64, %edi
	callq	_CSR1212_MALLOC
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movq	%rax, %rbx
	movq	_CSR1212_CONFIG_ROM_SPACE_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CSR1212_CONFIG_ROM_SPACE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_csr1212_rom_cache_malloc
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	_CSR1212_KV_ID_VENDOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_csr1212_new_directory
	movl	%eax, 56(%rbx)
	movq	16(%rbx), %rdi
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	48(%rdi), %eax
	movl	%eax, 52(%rbx)
	movq	%r12, (%rbx)
	movq	%r12, 8(%rbx)
	movq	%r15, 40(%rbx)
	movq	%r14, 32(%rbx)
	movq	%rdi, 24(%rbx)
	jmp	LBB0_8
LBB0_5:
	callq	_CSR1212_FREE
LBB0_6:
	movq	%rbx, %rdi
	callq	_CSR1212_FREE
LBB0_7:
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CSR1212_CONFIG_ROM_SPACE_OFFSET,4,2 ## @CSR1212_CONFIG_ROM_SPACE_OFFSET
	.comm	_CSR1212_CONFIG_ROM_SPACE_SIZE,4,2 ## @CSR1212_CONFIG_ROM_SPACE_SIZE
	.comm	_CSR1212_KV_ID_VENDOR,4,2       ## @CSR1212_KV_ID_VENDOR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_csr1212_create_csr             ; -- Begin function csr1212_create_csr
	.p2align	2
_csr1212_create_csr:                    ; @csr1212_create_csr
	.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, x2
	mov	x22, x1
	mov	x21, x0
	mov	w0, #64
	bl	_CSR1212_MALLOC
	mov	x19, x0
	cbz	x0, LBB0_6
; %bb.1:
Lloh0:
	adrp	x8, _CSR1212_CONFIG_ROM_SPACE_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CSR1212_CONFIG_ROM_SPACE_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _CSR1212_CONFIG_ROM_SPACE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CSR1212_CONFIG_ROM_SPACE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_csr1212_rom_cache_malloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_5
; %bb.2:
Lloh6:
	adrp	x8, _CSR1212_KV_ID_VENDOR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CSR1212_KV_ID_VENDOR@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_csr1212_new_directory
	mov	x8, x0
	str	w0, [x19, #56]
	ldr	x0, [x19, #16]
	cbz	w8, LBB0_4
; %bb.3:
	ldr	w8, [x0, #48]
	str	w8, [x19, #52]
	stp	x22, x22, [x19]
	stp	x20, x21, [x19, #32]
	str	x0, [x19, #24]
	b	LBB0_6
LBB0_4:
	bl	_CSR1212_FREE
LBB0_5:
	mov	x0, x19
	bl	_CSR1212_FREE
	mov	x19, #0
LBB0_6:
	mov	x0, 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
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_CSR1212_CONFIG_ROM_SPACE_OFFSET,4,2 ; @CSR1212_CONFIG_ROM_SPACE_OFFSET
	.comm	_CSR1212_CONFIG_ROM_SPACE_SIZE,4,2 ; @CSR1212_CONFIG_ROM_SPACE_SIZE
	.comm	_CSR1212_KV_ID_VENDOR,4,2       ; @CSR1212_KV_ID_VENDOR
.subsections_via_symbols
