	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mvneta_bm_port_init
_mvneta_bm_port_init:                   ## @mvneta_bm_port_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
	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), %r14
	cmpl	$0, 40(%rsi)
	je	LBB0_1
LBB0_2:
	leaq	L_.str(%rip), %rsi
	leaq	-56(%rbp), %rdx
	movq	%r14, %rdi
	callq	_of_property_read_u32
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	32(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_netdev_info
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	%r15, %rdi
	callq	_mvneta_bm_port_mbus_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
	jmp	LBB0_2
LBB0_4:
	movl	(%r15), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	24(%r15), %ebx
	movq	-56(%rbp), %r13
	movq	_MVNETA_BM_LONG@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	32(%r15), %rax
	movl	(%rax), %edi
	callq	_MVNETA_RX_PKT_SIZE
	movl	%ebx, %edi
	movq	%r13, %rsi
	movl	%r12d, %edx
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	movl	%eax, %r8d
	callq	_mvneta_bm_pool_use
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_5
## %bb.8:
	movb	(%r15), %cl
	movl	$1, %edx
	shll	%cl, %edx
	orl	%edx, (%rax)
	movl	4(%rax), %edx
	movl	8(%rax), %esi
	movq	%r15, %rdi
	callq	_mvneta_bm_pool_bufsize_set
	leaq	L_.str.3(%rip), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	callq	_of_property_read_u32
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	-56(%rbp), %rsi
	movq	%rsi, -48(%rbp)
	jmp	LBB0_11
LBB0_5:
	movq	32(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_netdev_info
	jmp	LBB0_6
LBB0_9:
	movq	-48(%rbp), %rsi
LBB0_11:
	movl	(%r15), %ecx
	movl	24(%r15), %edi
	movq	_MVNETA_BM_SHORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MVNETA_BM_SHORT_PKT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	callq	_mvneta_bm_pool_use
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	-48(%rbp), %rcx
	xorl	%ebx, %ebx
	cmpq	-56(%rbp), %rcx
	je	LBB0_15
## %bb.14:
	movb	(%r15), %cl
	movl	$1, %edx
	shll	%cl, %edx
	orl	%edx, (%rax)
	movl	4(%rax), %edx
	movl	8(%rax), %esi
	movq	%r15, %rdi
	callq	_mvneta_bm_pool_bufsize_set
	jmp	LBB0_15
LBB0_12:
	movq	32(%r15), %rdi
	leaq	L_.str.4(%rip), %rsi
	callq	_netdev_info
	movl	24(%r15), %edi
	movq	16(%r15), %rsi
	movb	(%r15), %cl
	movl	$1, %edx
	shll	%cl, %edx
	callq	_mvneta_bm_pool_destroy
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bm,pool-long"

L_.str.1:                               ## @.str.1
	.asciz	"missing long pool id\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MVNETA_BM_LONG,4,2             ## @MVNETA_BM_LONG
L_.str.2:                               ## @.str.2
	.asciz	"fail to obtain long pool for port\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"bm,pool-short"

	.comm	_MVNETA_BM_SHORT,4,2            ## @MVNETA_BM_SHORT
	.comm	_MVNETA_BM_SHORT_PKT_SIZE,4,2   ## @MVNETA_BM_SHORT_PKT_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"fail to obtain short pool for port\n"

	.no_dead_strip	_mvneta_bm_port_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mvneta_bm_port_init
_mvneta_bm_port_init:                   ; @mvneta_bm_port_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, x1
	ldr	x20, [x0]
	ldr	w8, [x1, #40]
	cbz	w8, LBB0_3
LBB0_1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #8
	mov	x0, x20
	bl	_of_property_read_u32
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x0, [x19, #32]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_netdev_info
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_3:
	mov	x0, x19
	bl	_mvneta_bm_port_mbus_init
	cbnz	w0, LBB0_16
	b	LBB0_1
LBB0_4:
	ldr	w21, [x19, #24]
	ldr	x22, [sp, #8]
Lloh6:
	adrp	x8, _MVNETA_BM_LONG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MVNETA_BM_LONG@GOTPAGEOFF]
Lloh8:
	ldr	w23, [x8]
	ldr	w24, [x19]
	ldr	x8, [x19, #32]
	ldr	w0, [x8]
	bl	_MVNETA_RX_PKT_SIZE
	mov	x4, x0
	mov	x0, x21
	mov	x1, x22
	mov	x2, x23
	mov	x3, x24
	bl	_mvneta_bm_pool_use
	str	x0, [x19, #16]
	cbz	x0, LBB0_7
; %bb.5:
	ldr	w8, [x19]
	mov	w9, #1
	lsl	w8, w9, w8
	ldp	w9, w2, [x0]
	orr	w8, w9, w8
	str	w8, [x0]
	ldr	w1, [x0, #8]
	mov	x0, x19
	bl	_mvneta_bm_pool_bufsize_set
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, sp
	mov	x0, x20
	bl	_of_property_read_u32
	cbz	x0, LBB0_8
; %bb.6:
	ldr	x1, [sp, #8]
	str	x1, [sp]
	b	LBB0_9
LBB0_7:
	ldr	x0, [x19, #32]
Lloh11:
	adrp	x1, l_.str.2@PAGE
Lloh12:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_netdev_info
	b	LBB0_14
LBB0_8:
	ldr	x1, [sp]
LBB0_9:
Lloh13:
	adrp	x8, _MVNETA_BM_SHORT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MVNETA_BM_SHORT@GOTPAGEOFF]
	ldr	w0, [x19, #24]
Lloh15:
	ldr	w2, [x8]
	ldr	w3, [x19]
Lloh16:
	adrp	x8, _MVNETA_BM_SHORT_PKT_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MVNETA_BM_SHORT_PKT_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	w4, [x8]
	bl	_mvneta_bm_pool_use
	str	x0, [x19, #8]
	cbz	x0, LBB0_13
; %bb.10:
	ldp	x8, x9, [sp]
	cmp	x8, x9
	b.eq	LBB0_12
; %bb.11:
	ldr	w8, [x19]
	mov	w9, #1
	lsl	w8, w9, w8
	ldp	w9, w2, [x0]
	orr	w8, w9, w8
	str	w8, [x0]
	ldr	w1, [x0, #8]
	mov	x0, x19
	bl	_mvneta_bm_pool_bufsize_set
LBB0_12:
	mov	w0, #0
	b	LBB0_16
LBB0_13:
	ldr	x0, [x19, #32]
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_netdev_info
	ldr	w0, [x19, #24]
	ldr	x1, [x19, #16]
	ldr	w8, [x19]
	mov	w9, #1
	lsl	w2, w9, w8
	bl	_mvneta_bm_pool_destroy
LBB0_14:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bm,pool-long"

l_.str.1:                               ; @.str.1
	.asciz	"missing long pool id\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MVNETA_BM_LONG,4,2             ; @MVNETA_BM_LONG
l_.str.2:                               ; @.str.2
	.asciz	"fail to obtain long pool for port\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"bm,pool-short"

	.comm	_MVNETA_BM_SHORT,4,2            ; @MVNETA_BM_SHORT
	.comm	_MVNETA_BM_SHORT_PKT_SIZE,4,2   ; @MVNETA_BM_SHORT_PKT_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"fail to obtain short pool for port\n"

	.no_dead_strip	_mvneta_bm_port_init
.subsections_via_symbols
