	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_dsaf_init
_hns_dsaf_init:                         ## @hns_dsaf_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_hns_dsaf_dev_priv
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_HNS_DSAF_IS_DEBUG
	xorl	%r15d, %r15d
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	movl	16(%rbx), %edi
	callq	_AE_IS_VER1
	movq	_DSAF_TCAM_SUM@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	_DSAFV2_MAC_FUZZY_TCAM_NUM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	jmp	LBB0_4
LBB0_3:
	xorl	%eax, %eax
LBB0_4:
	subq	%rax, %rcx
	movq	%rcx, 8(%rbx)
	movq	%rbx, %rdi
	callq	_spin_lock_init
	movq	%rbx, %rdi
	callq	_hns_dsaf_init_hw
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_6
LBB0_5:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	(%r12), %rdi
	movl	$4, %esi
	callq	_array_size
	movl	%eax, %edi
	callq	_vzalloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movq	(%r12), %rcx
	testq	%rcx, %rcx
	jle	LBB0_11
## %bb.8:
	cmpq	$8, %rcx
	jb	LBB0_9
## %bb.12:
	movq	_DSAF_INVALID_ENTRY_IDX@GOTPCREL(%rip), %r8
	leaq	4(%r8), %rdx
	cmpq	%rdx, %rax
	jae	LBB0_15
## %bb.13:
	leaq	(%rax,%rcx,4), %rdx
	cmpq	_DSAF_INVALID_ENTRY_IDX@GOTPCREL(%rip), %rdx
	jbe	LBB0_15
LBB0_9:
	xorl	%edx, %edx
LBB0_22:
	movq	%rdx, %r8
	notq	%r8
	addq	%rcx, %r8
	movq	%rcx, %rdi
	andq	$3, %rdi
	je	LBB0_25
## %bb.23:
	movq	_DSAF_INVALID_ENTRY_IDX@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %esi
	movl	%esi, (%rax,%rdx,4)
	incq	%rdx
	decq	%rdi
	jne	LBB0_24
LBB0_25:
	xorl	%r15d, %r15d
	cmpq	$3, %r8
	jb	LBB0_5
## %bb.26:
	movq	_DSAF_INVALID_ENTRY_IDX@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_27:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %edi
	movl	%edi, (%rax,%rdx,4)
	movl	(%rsi), %edi
	movl	%edi, 4(%rax,%rdx,4)
	movl	(%rsi), %edi
	movl	%edi, 8(%rax,%rdx,4)
	movl	(%rsi), %edi
	movl	%edi, 12(%rax,%rdx,4)
	addq	$4, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_27
	jmp	LBB0_5
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	movq	%rbx, %rdi
	callq	_hns_dsaf_remove_hw
	jmp	LBB0_5
LBB0_11:
	xorl	%r15d, %r15d
	jmp	LBB0_5
LBB0_15:
	movq	%rcx, %rdx
	andq	$-8, %rdx
	leaq	-8(%rdx), %rdi
	movq	%rdi, %rsi
	shrq	$3, %rsi
	incq	%rsi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.16:
	movq	%rsi, %rdi
	andq	$-2, %rdi
	movd	(%r8), %xmm0                    ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%rax,%rbx,4)
	movdqu	%xmm0, 16(%rax,%rbx,4)
	movdqu	%xmm0, 32(%rax,%rbx,4)
	movdqu	%xmm0, 48(%rax,%rbx,4)
	addq	$16, %rbx
	addq	$-2, %rdi
	jne	LBB0_17
	jmp	LBB0_19
LBB0_18:
	xorl	%ebx, %ebx
LBB0_19:
	testb	$1, %sil
	je	LBB0_21
## %bb.20:
	movd	(%r8), %xmm0                    ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movdqu	%xmm0, (%rax,%rbx,4)
	movdqu	%xmm0, 16(%rax,%rbx,4)
LBB0_21:
	xorl	%r15d, %r15d
	cmpq	%rdx, %rcx
	je	LBB0_5
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_DSAF_TCAM_SUM,8,3              ## @DSAF_TCAM_SUM
	.comm	_DSAFV2_MAC_FUZZY_TCAM_NUM,8,3  ## @DSAFV2_MAC_FUZZY_TCAM_NUM
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DSAF_INVALID_ENTRY_IDX,4,2     ## @DSAF_INVALID_ENTRY_IDX
	.no_dead_strip	_hns_dsaf_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_init
_hns_dsaf_init:                         ; @hns_dsaf_init
	.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
	bl	_hns_dsaf_dev_priv
	mov	x20, x0
	mov	x0, x19
	bl	_HNS_DSAF_IS_DEBUG
	cbz	x0, LBB0_2
LBB0_1:
	mov	w21, #0
	b	LBB0_3
LBB0_2:
	ldr	w0, [x19, #16]
	bl	_AE_IS_VER1
Lloh0:
	adrp	x22, _DSAF_TCAM_SUM@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DSAF_TCAM_SUM@GOTPAGEOFF]
Lloh2:
	adrp	x8, _DSAFV2_MAC_FUZZY_TCAM_NUM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DSAFV2_MAC_FUZZY_TCAM_NUM@GOTPAGEOFF]
	ldr	x9, [x22]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, #0
	csel	x8, x8, xzr, eq
	sub	x8, x9, x8
	str	x8, [x19, #8]
	mov	x0, x19
	bl	_spin_lock_init
	mov	x0, x19
	bl	_hns_dsaf_init_hw
	mov	x21, x0
	cbz	w0, LBB0_4
LBB0_3:
	mov	x0, x21
	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
LBB0_4:
	ldr	x0, [x22]
	mov	w1, #4
	bl	_array_size
	bl	_vzalloc
	str	x0, [x20]
	cbz	x0, LBB0_11
; %bb.5:
	ldr	x9, [x22]
	cmp	x9, #1
	b.lt	LBB0_1
; %bb.6:
Lloh5:
	adrp	x8, _DSAF_INVALID_ENTRY_IDX@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DSAF_INVALID_ENTRY_IDX@GOTPAGEOFF]
	cmp	x9, #16
	b.lo	LBB0_12
; %bb.7:
	add	x10, x0, x9, lsl #2
	add	x11, x8, #4
	cmp	x0, x11
	ccmp	x10, x8, #0, lo
	b.hi	LBB0_12
; %bb.8:
	and	x10, x9, #0xfffffffffffffff0
	ld1r.4s	{ v0 }, [x8]
	add	x11, x0, #32
	mov	x12, x10
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x11, #-32]
	stp	q0, q0, [x11], #64
	subs	x12, x12, #16
	b.ne	LBB0_9
; %bb.10:
	cmp	x9, x10
	b.eq	LBB0_1
	b	LBB0_13
LBB0_11:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w21, w8
	mov	x0, x19
	bl	_hns_dsaf_remove_hw
	b	LBB0_3
LBB0_12:
	mov	x10, #0
LBB0_13:
	sub	x9, x9, x10
	add	x10, x0, x10, lsl #2
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x8]
	str	w11, [x10], #4
	subs	x9, x9, #1
	b.ne	LBB0_14
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_DSAF_TCAM_SUM,8,3              ; @DSAF_TCAM_SUM
	.comm	_DSAFV2_MAC_FUZZY_TCAM_NUM,8,3  ; @DSAFV2_MAC_FUZZY_TCAM_NUM
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DSAF_INVALID_ENTRY_IDX,4,2     ; @DSAF_INVALID_ENTRY_IDX
	.no_dead_strip	_hns_dsaf_init
.subsections_via_symbols
