	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hinic_pf_to_mgmt_init          ## -- Begin function hinic_pf_to_mgmt_init
	.p2align	4, 0x90
_hinic_pf_to_mgmt_init:                 ## @hinic_pf_to_mgmt_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	%rsi, %r13
	movq	%rdi, %rbx
	callq	_mgmt_to_pfhwdev
	movq	%rax, %r15
	movq	(%r13), %r14
	movq	%r13, 24(%rbx)
	leaq	16(%rbx), %rdi
	movl	$1, %esi
	callq	_sema_init
	movq	$0, 8(%rbx)
	movq	%rbx, %rdi
	callq	_alloc_msg_buf
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movl	(%rbx), %edi
	movq	%r13, %rsi
	callq	_hinic_api_cmd_init
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	movq	%r14, %rdi
	callq	_dev_err
LBB0_6:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_HINIC_MSG_FROM_MGMT_CPU@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_mgmt_msg_aeqe_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	movq	%rbx, %rdx
	callq	_hinic_aeq_register_hw_cb
	xorl	%r12d, %r12d
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate msg buffers\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to initialize cmd chains\n"

	.comm	_HINIC_MSG_FROM_MGMT_CPU,4,2    ## @HINIC_MSG_FROM_MGMT_CPU
	.comm	_mgmt_msg_aeqe_handler,4,2      ## @mgmt_msg_aeqe_handler
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hinic_pf_to_mgmt_init          ; -- Begin function hinic_pf_to_mgmt_init
	.p2align	2
_hinic_pf_to_mgmt_init:                 ; @hinic_pf_to_mgmt_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x1
	mov	x19, x0
	bl	_mgmt_to_pfhwdev
	mov	x21, x0
	ldr	x20, [x22]
	str	x22, [x19, #24]
	add	x0, x19, #16
	mov	w1, #1
	bl	_sema_init
	str	xzr, [x19, #8]
	mov	x0, x19
	bl	_alloc_msg_buf
	cbz	w0, LBB0_2
; %bb.1:
	mov	x23, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	ldr	w0, [x19]
	mov	x1, x22
	bl	_hinic_api_cmd_init
	mov	x23, x0
	cbz	w0, LBB0_6
; %bb.3:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	mov	x0, x20
	bl	_dev_err
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
Lloh4:
	adrp	x8, _HINIC_MSG_FROM_MGMT_CPU@GOTPAGE
Lloh5:
	ldr	x8, [x8, _HINIC_MSG_FROM_MGMT_CPU@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _mgmt_msg_aeqe_handler@GOTPAGE
Lloh8:
	ldr	x8, [x8, _mgmt_msg_aeqe_handler@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x21
	mov	x2, x19
	bl	_hinic_aeq_register_hw_cb
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate msg buffers\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to initialize cmd chains\n"

	.comm	_HINIC_MSG_FROM_MGMT_CPU,4,2    ; @HINIC_MSG_FROM_MGMT_CPU
	.comm	_mgmt_msg_aeqe_handler,4,2      ; @mgmt_msg_aeqe_handler
.subsections_via_symbols
