	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_dsaf_sbm_init
_hns_dsaf_sbm_init:                     ## @hns_dsaf_sbm_init
	.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, %r14
	movl	8(%rdi), %edi
	callq	_AE_IS_VER1
	movq	%r14, %rdi
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	callq	_hns_dsaf_sbm_bp_wl_cfg
	movq	_DSAF_SRAM_INIT_OVER_M@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	callq	_hns_dsafv2_sbm_bp_wl_cfg
	movq	_DSAFV2_SRAM_INIT_OVER_M@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %r15
	movq	%r14, %rdi
	callq	_hns_dsaf_sbm_cfg
	movq	%r14, %rdi
	callq	_hns_dsaf_sbm_cfg_mib_en
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r12d
	movl	(%r14), %edx
	movl	4(%r14), %edi
	movslq	%eax, %rcx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_11
LBB0_5:
	movq	%r14, %rdi
	callq	_hns_dsaf_sbm_link_sram_init_en
	xorl	%ebx, %ebx
	movq	_DSAF_SRAM_INIT_OVER_S@GOTPCREL(%rip), %r13
	movq	_DSAF_CFG_READ_CNT@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$200, %edi
	movl	$210, %esi
	callq	_usleep_range
	movq	_DSAF_SRAM_INIT_OVER_0_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r13), %rcx
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_dsaf_get_dev_field
	incq	%rbx
	movzbl	(%r13), %ecx
	movq	%r15, %rdx
	sarq	%cl, %rdx
	cmpq	%rdx, %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpq	(%r12), %rbx
	jl	LBB0_6
LBB0_8:
	cmpq	%rdx, %rax
	je	LBB0_10
## %bb.9:
	movl	(%r14), %edx
	movl	4(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r12d, %r12d
	movq	%rax, %rcx
	movq	%rbx, %r8
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_11
LBB0_10:
	movq	%r14, %rdi
	callq	_hns_dsaf_rocee_bp_en
	xorl	%r12d, %r12d
LBB0_11:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DSAF_SRAM_INIT_OVER_M,8,3      ## @DSAF_SRAM_INIT_OVER_M
	.comm	_DSAFV2_SRAM_INIT_OVER_M,8,3    ## @DSAFV2_SRAM_INIT_OVER_M
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hns_dsaf_sbm_cfg_mib_en fail,%s, ret=%d\n"

	.comm	_DSAF_SRAM_INIT_OVER_0_REG,4,2  ## @DSAF_SRAM_INIT_OVER_0_REG
	.comm	_DSAF_SRAM_INIT_OVER_S,8,3      ## @DSAF_SRAM_INIT_OVER_S
	.comm	_DSAF_CFG_READ_CNT,8,3          ## @DSAF_CFG_READ_CNT
L_.str.1:                               ## @.str.1
	.asciz	"hns_dsaf_sbm_init fail %s, flag=%d, cnt=%d\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_hns_dsaf_sbm_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_dsaf_sbm_init
_hns_dsaf_sbm_init:                     ; @hns_dsaf_sbm_init
	.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, x0
	ldr	w0, [x0, #8]
	bl	_AE_IS_VER1
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_hns_dsaf_sbm_bp_wl_cfg
Lloh0:
	adrp	x8, _DSAF_SRAM_INIT_OVER_M@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DSAF_SRAM_INIT_OVER_M@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_hns_dsafv2_sbm_bp_wl_cfg
Lloh2:
	adrp	x8, _DSAFV2_SRAM_INIT_OVER_M@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DSAFV2_SRAM_INIT_OVER_M@GOTPAGEOFF]
LBB0_3:
	ldr	x20, [x8]
	mov	x0, x19
	bl	_hns_dsaf_sbm_cfg
	mov	x0, x19
	bl	_hns_dsaf_sbm_cfg_mib_en
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
	ldp	w2, w0, [x19]
	sxtw	x3, w21
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_10
LBB0_5:
	mov	x0, x19
	bl	_hns_dsaf_sbm_link_sram_init_en
	mov	x21, #0
Lloh6:
	adrp	x22, _DSAF_SRAM_INIT_OVER_0_REG@GOTPAGE
Lloh7:
	ldr	x22, [x22, _DSAF_SRAM_INIT_OVER_0_REG@GOTPAGEOFF]
Lloh8:
	adrp	x23, _DSAF_SRAM_INIT_OVER_S@GOTPAGE
Lloh9:
	ldr	x23, [x23, _DSAF_SRAM_INIT_OVER_S@GOTPAGEOFF]
Lloh10:
	adrp	x24, _DSAF_CFG_READ_CNT@GOTPAGE
Lloh11:
	ldr	x24, [x24, _DSAF_CFG_READ_CNT@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #200
	mov	w1, #210
	bl	_usleep_range
	ldr	w1, [x22]
	ldr	x3, [x23]
	mov	x0, x19
	mov	x2, x20
	bl	_dsaf_get_dev_field
	add	x21, x21, #1
	ldr	x8, [x23]
	asr	x8, x20, x8
	ldr	x9, [x24]
	cmp	x0, x8
	ccmp	x21, x9, #0, ne
	b.lt	LBB0_6
; %bb.7:
	mov	x3, x0
	cmp	x0, x8
	b.eq	LBB0_9
; %bb.8:
	ldp	w2, w0, [x19]
	str	x21, [sp]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_9:
	mov	x0, x19
	bl	_hns_dsaf_rocee_bp_en
	mov	w21, #0
LBB0_10:
	mov	x0, x21
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DSAF_SRAM_INIT_OVER_M,8,3      ; @DSAF_SRAM_INIT_OVER_M
	.comm	_DSAFV2_SRAM_INIT_OVER_M,8,3    ; @DSAFV2_SRAM_INIT_OVER_M
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hns_dsaf_sbm_cfg_mib_en fail,%s, ret=%d\n"

	.comm	_DSAF_SRAM_INIT_OVER_0_REG,4,2  ; @DSAF_SRAM_INIT_OVER_0_REG
	.comm	_DSAF_SRAM_INIT_OVER_S,8,3      ; @DSAF_SRAM_INIT_OVER_S
	.comm	_DSAF_CFG_READ_CNT,8,3          ; @DSAF_CFG_READ_CNT
l_.str.1:                               ; @.str.1
	.asciz	"hns_dsaf_sbm_init fail %s, flag=%d, cnt=%d\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_hns_dsaf_sbm_init
.subsections_via_symbols
