	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function brcmf_chip_socram_ramsize
_brcmf_chip_socram_ramsize:             ## @brcmf_chip_socram_ramsize
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movl	$0, (%rsi)
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	$0, (%rdx)
	xorl	%edi, %edi
	cmpl	$4, 8(%r12)
	setl	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_17
## %bb.1:
	leaq	8(%r12), %rbx
	movq	%rbx, %rdi
	callq	_brcmf_chip_iscoreup
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_brcmf_chip_resetcore
LBB0_3:
	callq	_SOCRAMREGOFFS
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_brcmf_chip_core_read32
	movq	_SRCI_SRNB_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%edx, %r14d
	andl	%eax, %r14d
	movq	_SRCI_SRNB_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	sarl	%cl, %r14d
	movl	8(%r12), %esi
	cmpl	$8, %esi
	jl	LBB0_5
## %bb.4:
	cmpl	$12, %esi
	je	LBB0_5
## %bb.7:
	movq	_SRCI_SRNB_MASK_EXT@GOTPCREL(%rip), %rdi
	orl	(%rdi), %edx
	andl	%eax, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %edx
	cmpl	$23, %esi
	cmovael	%edx, %r14d
	testl	%r14d, %r14d
	jle	LBB0_12
## %bb.8:
	xorl	%ebx, %ebx
	leaq	-44(%rbp), %r13
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	incl	%ebx
	cmpl	%ebx, %r14d
	je	LBB0_12
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	movq	%r13, %rdx
	callq	_brcmf_chip_socram_banksize
	movl	-44(%rbp), %ecx
	addl	%ecx, (%r15)
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	%ecx, (%rax)
	jmp	LBB0_11
LBB0_5:
	movq	_SRCI_SRBSZ_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	%eax, %esi
	movq	_SRCI_LSS_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_SRCI_LSS_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setne	%cl
	subl	%ecx, %r14d
	movq	_SR_BSZ_BASE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	addl	%esi, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r14d
	movl	%esi, -44(%rbp)
	movl	%r14d, (%r15)
	testl	%eax, %eax
	je	LBB0_12
## %bb.6:
	addl	(%rdx), %eax
	decb	%al
	movl	$1, %edx
	movl	%eax, %ecx
	shll	%cl, %edx
	addl	%r14d, %edx
	movl	%edx, (%r15)
LBB0_12:
	movq	(%r12), %rax
	movl	(%rax), %ecx
	cmpl	$128, %ecx
	je	LBB0_13
## %bb.14:
	cmpl	$129, %ecx
	jne	LBB0_17
## %bb.15:
	movl	$32768, %ecx                    ## imm = 0x8000
	cmpl	$1, 4(%rax)
	jle	LBB0_16
	jmp	LBB0_17
LBB0_13:
	movl	$65536, %ecx                    ## imm = 0x10000
LBB0_16:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, (%rax)
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SRCI_SRNB_MASK,4,2             ## @SRCI_SRNB_MASK
	.comm	_SRCI_SRNB_SHIFT,4,2            ## @SRCI_SRNB_SHIFT
	.comm	_SRCI_SRBSZ_MASK,4,2            ## @SRCI_SRBSZ_MASK
	.comm	_SRCI_LSS_MASK,4,2              ## @SRCI_LSS_MASK
	.comm	_SRCI_LSS_SHIFT,4,2             ## @SRCI_LSS_SHIFT
	.comm	_SR_BSZ_BASE,4,2                ## @SR_BSZ_BASE
	.comm	_SRCI_SRNB_MASK_EXT,4,2         ## @SRCI_SRNB_MASK_EXT
	.no_dead_strip	_brcmf_chip_socram_ramsize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function brcmf_chip_socram_ramsize
_brcmf_chip_socram_ramsize:             ; @brcmf_chip_socram_ramsize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	str	wzr, [x1]
	str	wzr, [x2]
	mov	x22, x0
	ldr	w8, [x22, #8]!
	cmp	w8, #4
	cset	w0, lt
	bl	_WARN_ON
	cbnz	x0, LBB0_18
; %bb.1:
	mov	x0, x22
	bl	_brcmf_chip_iscoreup
	cbnz	w0, LBB0_3
; %bb.2:
	mov	x0, x22
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_brcmf_chip_resetcore
LBB0_3:
	bl	_SOCRAMREGOFFS
	mov	x1, x0
	mov	x0, x20
	bl	_brcmf_chip_core_read32
Lloh0:
	adrp	x8, _SRCI_SRNB_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SRCI_SRNB_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	and	w8, w9, w0
Lloh3:
	adrp	x10, _SRCI_SRNB_SHIFT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _SRCI_SRNB_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	asr	w8, w8, w10
	ldr	w11, [x20, #8]
	cmp	w11, #8
	b.lt	LBB0_10
; %bb.4:
	cmp	w11, #12
	b.eq	LBB0_10
; %bb.5:
Lloh6:
	adrp	x12, _SRCI_SRNB_MASK_EXT@GOTPAGE
Lloh7:
	ldr	x12, [x12, _SRCI_SRNB_MASK_EXT@GOTPAGEOFF]
Lloh8:
	ldr	w12, [x12]
	orr	w9, w12, w9
	and	w9, w9, w0
	asr	w9, w9, w10
	cmp	w11, #22
	csel	w23, w9, w8, hi
	cmp	w23, #1
	b.lt	LBB0_12
; %bb.6:
	mov	w22, #0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	w22, w22, #1
	cmp	w23, w22
	b.eq	LBB0_12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x22
	bl	_brcmf_chip_socram_banksize
	ldr	w8, [sp, #12]
	ldr	w9, [x21]
	add	w9, w9, w8
	str	w9, [x21]
	cbz	w0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w9, [x19]
	add	w8, w9, w8
	str	w8, [x19]
	b	LBB0_7
LBB0_10:
Lloh9:
	adrp	x9, _SRCI_SRBSZ_MASK@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SRCI_SRBSZ_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	and	w11, w9, w0
	str	w11, [sp, #12]
Lloh12:
	adrp	x9, _SRCI_LSS_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SRCI_LSS_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _SRCI_LSS_SHIFT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _SRCI_LSS_SHIFT@GOTPAGEOFF]
	and	w9, w9, w0
Lloh17:
	ldr	w10, [x10]
	asr	w9, w9, w10
	cmp	w9, #0
	cset	w10, ne
	sub	w8, w8, w10
Lloh18:
	adrp	x10, _SR_BSZ_BASE@GOTPAGE
Lloh19:
	ldr	x10, [x10, _SR_BSZ_BASE@GOTPAGEOFF]
	ldr	w12, [x10]
	add	w11, w12, w11
	lsl	w8, w8, w11
	str	w8, [x21]
	cbz	w9, LBB0_12
; %bb.11:
	ldr	w10, [x10]
	add	w9, w9, w10
	sub	w9, w9, #1
	mov	w10, #1
	lsl	w9, w10, w9
	add	w8, w9, w8
	str	w8, [x21]
LBB0_12:
	ldr	x8, [x20]
	ldr	w9, [x8]
	cmp	w9, #128
	b.eq	LBB0_16
; %bb.13:
	cmp	w9, #129
	b.ne	LBB0_18
; %bb.14:
	ldr	w8, [x8, #4]
	cmp	w8, #1
	b.gt	LBB0_18
; %bb.15:
	mov	w8, #32768
	b	LBB0_17
LBB0_16:
	mov	w8, #65536
LBB0_17:
	str	w8, [x19]
LBB0_18:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_SRCI_SRNB_MASK,4,2             ; @SRCI_SRNB_MASK
	.comm	_SRCI_SRNB_SHIFT,4,2            ; @SRCI_SRNB_SHIFT
	.comm	_SRCI_SRBSZ_MASK,4,2            ; @SRCI_SRBSZ_MASK
	.comm	_SRCI_LSS_MASK,4,2              ; @SRCI_LSS_MASK
	.comm	_SRCI_LSS_SHIFT,4,2             ; @SRCI_LSS_SHIFT
	.comm	_SR_BSZ_BASE,4,2                ; @SR_BSZ_BASE
	.comm	_SRCI_SRNB_MASK_EXT,4,2         ; @SRCI_SRNB_MASK_EXT
	.no_dead_strip	_brcmf_chip_socram_ramsize
.subsections_via_symbols
