	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function falcon_reset_sram
_falcon_reset_sram:                     ## @falcon_reset_sram
	.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	%rdi, %r12
	movq	_FR_AB_GPIO_CTL@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	-44(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_ef4_reado
	movl	-44(%rbp), %edi
	movq	_FRF_AB_GPIO1_OEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_EF4_SET_OWORD_FIELD
	movl	-44(%rbp), %edi
	movq	_FRF_AB_GPIO1_OUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_EF4_SET_OWORD_FIELD
	movl	(%r14), %edx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ef4_writeo
	movq	_FRF_AZ_SRM_INIT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_FRF_AZ_SRM_NB_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %edx
	xorl	%r8d, %r8d
	callq	_EF4_POPULATE_OWORD_2
	movq	_FR_AZ_SRM_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	callq	_ef4_writeo
	movq	_hw@GOTPCREL(%rip), %r13
	leaq	L_.str(%rip), %r15
	movq	_HZ@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movl	(%r12), %edx
	movq	%r12, %rdi
	movq	%r15, %rcx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_netif_dbg
	movslq	(%r14), %rax
	imulq	$1374389535, %rax, %rdi         ## imm = 0x51EB851F
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$36, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_schedule_timeout_uninterruptible
	movq	_FR_AZ_SRM_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	leaq	-48(%rbp), %rsi
	callq	_ef4_reado
	movl	-48(%rbp), %edi
	movq	_FRF_AZ_SRM_INIT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_EF4_OWORD_FIELD
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	incl	%ebx
	cmpl	$20, %ebx
	jne	LBB0_1
## %bb.4:
	movl	(%r13), %esi
	movl	(%r12), %edx
	leaq	L_.str.2(%rip), %rcx
	movq	%r12, %rdi
	callq	_netif_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_2:
	movl	(%r13), %esi
	movl	(%r12), %edx
	leaq	L_.str.1(%rip), %rcx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_netif_dbg
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FR_AB_GPIO_CTL,4,2             ## @FR_AB_GPIO_CTL
	.comm	_FRF_AB_GPIO1_OEN,4,2           ## @FRF_AB_GPIO1_OEN
	.comm	_FRF_AB_GPIO1_OUT,4,2           ## @FRF_AB_GPIO1_OUT
	.comm	_FRF_AZ_SRM_INIT_EN,4,2         ## @FRF_AZ_SRM_INIT_EN
	.comm	_FRF_AZ_SRM_NB_SZ,4,2           ## @FRF_AZ_SRM_NB_SZ
	.comm	_FR_AZ_SRM_CFG,4,2              ## @FR_AZ_SRM_CFG
	.comm	_hw,4,2                         ## @hw
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"waiting for SRAM reset (attempt %d)...\n"

	.comm	_HZ,4,2                         ## @HZ
L_.str.1:                               ## @.str.1
	.asciz	"SRAM reset complete\n"

L_.str.2:                               ## @.str.2
	.asciz	"timed out waiting for SRAM reset\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_falcon_reset_sram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function falcon_reset_sram
_falcon_reset_sram:                     ; @falcon_reset_sram
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x20, _FR_AB_GPIO_CTL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _FR_AB_GPIO_CTL@GOTPAGEOFF]
	ldr	w2, [x20]
	add	x1, sp, #8
	bl	_ef4_reado
	ldr	w0, [sp, #8]
Lloh2:
	adrp	x8, _FRF_AB_GPIO1_OEN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FRF_AB_GPIO1_OEN@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_EF4_SET_OWORD_FIELD
	ldr	w0, [sp, #8]
Lloh5:
	adrp	x8, _FRF_AB_GPIO1_OUT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FRF_AB_GPIO1_OUT@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_EF4_SET_OWORD_FIELD
	ldr	w2, [x20]
	add	x1, sp, #8
	mov	x0, x19
	bl	_ef4_writeo
Lloh8:
	adrp	x21, _FRF_AZ_SRM_INIT_EN@GOTPAGE
Lloh9:
	ldr	x21, [x21, _FRF_AZ_SRM_INIT_EN@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh10:
	adrp	x8, _FRF_AZ_SRM_NB_SZ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FRF_AZ_SRM_NB_SZ@GOTPAGEOFF]
Lloh12:
	ldr	w3, [x8]
	mov	w2, #1
	mov	w4, #0
	bl	_EF4_POPULATE_OWORD_2
Lloh13:
	adrp	x22, _FR_AZ_SRM_CFG@GOTPAGE
Lloh14:
	ldr	x22, [x22, _FR_AZ_SRM_CFG@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x1, sp, #12
	mov	x0, x19
	bl	_ef4_writeo
	mov	w24, #0
Lloh15:
	adrp	x23, _hw@GOTPAGE
Lloh16:
	ldr	x23, [x23, _hw@GOTPAGEOFF]
Lloh17:
	adrp	x25, _HZ@GOTPAGE
Lloh18:
	ldr	x25, [x25, _HZ@GOTPAGEOFF]
	mov	w26, #34079
	movk	w26, #20971, lsl #16
Lloh19:
	adrp	x20, l_.str@PAGE
Lloh20:
	add	x20, x20, l_.str@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	ldr	w2, [x19]
	str	x24, [sp]
	mov	x0, x19
	mov	x3, x20
	bl	_netif_dbg
	ldrsw	x8, [x25]
	mul	x8, x8, x26
	lsr	x9, x8, #63
	asr	x8, x8, #36
	add	w0, w8, w9
	bl	_schedule_timeout_uninterruptible
	ldr	w2, [x22]
	add	x1, sp, #12
	mov	x0, x19
	bl	_ef4_reado
	ldr	w0, [sp, #12]
	ldr	w1, [x21]
	bl	_EF4_OWORD_FIELD
	cbz	w0, LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w24, w24, #1
	cmp	w24, #20
	b.ne	LBB0_1
; %bb.3:
	ldr	w1, [x23]
	ldr	w2, [x19]
Lloh21:
	adrp	x3, l_.str.2@PAGE
Lloh22:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_netif_err
Lloh23:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_4:
	ldr	w1, [x23]
	ldr	w2, [x19]
Lloh26:
	adrp	x3, l_.str.1@PAGE
Lloh27:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_netif_dbg
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_FR_AB_GPIO_CTL,4,2             ; @FR_AB_GPIO_CTL
	.comm	_FRF_AB_GPIO1_OEN,4,2           ; @FRF_AB_GPIO1_OEN
	.comm	_FRF_AB_GPIO1_OUT,4,2           ; @FRF_AB_GPIO1_OUT
	.comm	_FRF_AZ_SRM_INIT_EN,4,2         ; @FRF_AZ_SRM_INIT_EN
	.comm	_FRF_AZ_SRM_NB_SZ,4,2           ; @FRF_AZ_SRM_NB_SZ
	.comm	_FR_AZ_SRM_CFG,4,2              ; @FR_AZ_SRM_CFG
	.comm	_hw,4,2                         ; @hw
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"waiting for SRAM reset (attempt %d)...\n"

	.comm	_HZ,4,2                         ; @HZ
l_.str.1:                               ; @.str.1
	.asciz	"SRAM reset complete\n"

l_.str.2:                               ; @.str.2
	.asciz	"timed out waiting for SRAM reset\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_falcon_reset_sram
.subsections_via_symbols
