	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_csr1212_parse_csr              ## -- Begin function csr1212_parse_csr
	.p2align	4, 0x90
_csr1212_parse_csr:                     ## @csr1212_parse_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	%rdi, %r15
	movl	$1, %edi
	testq	%r15, %r15
	je	LBB0_3
## %bb.1:
	movq	32(%r15), %rax
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	xorl	%edi, %edi
	cmpl	$0, (%rax)
	sete	%dil
LBB0_3:
	callq	_BUG_ON
	movq	%r15, %rdi
	callq	_csr1212_parse_bus_info_block
	movq	_CSR1212_SUCCESS@GOTPCREL(%rip), %r14
	cmpl	(%r14), %eax
	jne	LBB0_11
## %bb.4:
	movl	$4, (%r15)
	movq	8(%r15), %rsi
	movq	24(%r15), %rax
	movq	%rsi, 8(%rax)
	movq	%rsi, (%rax)
	movq	_CSR1212_CONFIG_ROM_SPACE_BASE@GOTPCREL(%rip), %rax
	movzwl	(%rax), %eax
	addq	16(%r15), %rax
	movq	%rax, 40(%rsi)
	movq	$0, (%rsi)
	movq	%rsi, 32(%rsi)
	movq	%rsi, 24(%rsi)
	movq	%r15, %rdi
	callq	_csr1212_read_keyval
	cmpl	(%r14), %eax
	jne	LBB0_11
## %bb.5:
	movq	8(%r15), %rcx
	movq	16(%rcx), %rbx
	testq	%rbx, %rbx
	je	LBB0_11
## %bb.6:
	movq	_CSR1212_KV_ID_EXTENDED_ROM@GOTPCREL(%rip), %r12
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_11
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rsi
	movq	8(%rsi), %rcx
	cmpq	(%r12), %rcx
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpq	$0, (%rsi)
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rdi
	callq	_csr1212_read_keyval
	cmpl	(%r14), %eax
	je	LBB0_10
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CSR1212_SUCCESS,4,2            ## @CSR1212_SUCCESS
	.comm	_CSR1212_CONFIG_ROM_SPACE_BASE,4,2 ## @CSR1212_CONFIG_ROM_SPACE_BASE
	.comm	_CSR1212_KV_ID_EXTENDED_ROM,8,3 ## @CSR1212_KV_ID_EXTENDED_ROM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_csr1212_parse_csr              ; -- Begin function csr1212_parse_csr
	.p2align	2
_csr1212_parse_csr:                     ; @csr1212_parse_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	x19, x0
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w8, [x8]
	cmp	w8, #0
	cset	w0, eq
	b	LBB0_4
LBB0_3:
	mov	w0, #1
LBB0_4:
	bl	_BUG_ON
	mov	x0, x19
	bl	_csr1212_parse_bus_info_block
Lloh0:
	adrp	x20, _CSR1212_SUCCESS@GOTPAGE
Lloh1:
	ldr	x20, [x20, _CSR1212_SUCCESS@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_12
; %bb.5:
	mov	w8, #4
	str	w8, [x19]
	ldp	x9, x8, [x19, #16]
	ldr	x1, [x19, #8]
	stp	x1, x1, [x8]
Lloh2:
	adrp	x8, _CSR1212_CONFIG_ROM_SPACE_BASE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CSR1212_CONFIG_ROM_SPACE_BASE@GOTPAGEOFF]
	ldrh	w8, [x8]
	add	x8, x9, x8
	stp	x1, x8, [x1, #32]
	str	xzr, [x1]
	str	x1, [x1, #24]
	mov	x0, x19
	bl	_csr1212_read_keyval
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_12
; %bb.6:
	ldr	x8, [x19, #8]
	ldr	x21, [x8, #16]
	cbz	x21, LBB0_12
; %bb.7:
Lloh4:
	adrp	x22, _CSR1212_KV_ID_EXTENDED_ROM@GOTPAGE
Lloh5:
	ldr	x22, [x22, _CSR1212_KV_ID_EXTENDED_ROM@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x21, [x21, #8]
	cbz	x21, LBB0_12
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x21]
	ldr	x8, [x1, #8]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x1]
	cbnz	x8, LBB0_8
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x19
	bl	_csr1212_read_keyval
	ldr	w8, [x20]
	cmp	w0, w8
	b.eq	LBB0_8
LBB0_12:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CSR1212_SUCCESS,4,2            ; @CSR1212_SUCCESS
	.comm	_CSR1212_CONFIG_ROM_SPACE_BASE,4,2 ; @CSR1212_CONFIG_ROM_SPACE_BASE
	.comm	_CSR1212_KV_ID_EXTENDED_ROM,8,3 ; @CSR1212_KV_ID_EXTENDED_ROM
.subsections_via_symbols
