	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_fw_ctxt
_init_fw_ctxt:                          ## @init_fw_ctxt
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	movq	(%rbx), %r14
	movq	%rbx, %rdi
	callq	_HINIC_IS_PF
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_HINIC_IS_PPF
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movq	%rbx, %rdi
	callq	_HINIC_HWIF_FUNC_IDX
	movl	%eax, -36(%rbp)
	movq	_HINIC_RX_BUF_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	_HINIC_PORT_CMD_FWCTXT_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	leaq	-28(%rbp), %r9
	movq	%r15, %rdi
	movl	$16, %ecx
	movq	%rdx, %r8
	callq	_hinic_port_msg_cmd
	movq	-48(%rbp), %rdx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.4:
	cmpl	$16, -28(%rbp)
	jne	LBB0_6
## %bb.5:
	xorl	%ebx, %ebx
	testq	%rdx, %rdx
	je	LBB0_8
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_2:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_7:
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported PCI Function type\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_HINIC_RX_BUF_SZ,4,2            ## @HINIC_RX_BUF_SZ
	.comm	_HINIC_PORT_CMD_FWCTXT_INIT,4,2 ## @HINIC_PORT_CMD_FWCTXT_INIT
L_.str.1:                               ## @.str.1
	.asciz	"Failed to init FW ctxt, ret = %d\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.no_dead_strip	_init_fw_ctxt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_fw_ctxt
_init_fw_ctxt:                          ; @init_fw_ctxt
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x0
	ldr	x21, [x0]
	ldr	x19, [x21]
	mov	x0, x21
	bl	_HINIC_IS_PF
	cbnz	w0, LBB0_2
; %bb.1:
	mov	x0, x21
	bl	_HINIC_IS_PPF
	cbz	w0, LBB0_5
LBB0_2:
	mov	x0, x21
	bl	_HINIC_HWIF_FUNC_IDX
Lloh0:
	adrp	x8, _HINIC_RX_BUF_SZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HINIC_RX_BUF_SZ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	stp	w8, w0, [sp, #24]
Lloh3:
	adrp	x8, _HINIC_PORT_CMD_FWCTXT_INIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HINIC_PORT_CMD_FWCTXT_INIT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #16
	add	x4, sp, #16
	add	x5, sp, #12
	mov	x0, x20
	mov	w3, #16
	bl	_hinic_port_msg_cmd
	ldr	w9, [sp, #12]
	ldr	x8, [sp, #16]
	cmp	w0, #0
	ccmp	w9, #16, #0, eq
	ccmp	x8, #0, #0, eq
	b.eq	LBB0_4
; %bb.3:
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh8:
	adrp	x8, _EFAULT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	mov	w0, #0
	b	LBB0_7
LBB0_5:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported PCI Function type\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_HINIC_RX_BUF_SZ,4,2            ; @HINIC_RX_BUF_SZ
	.comm	_HINIC_PORT_CMD_FWCTXT_INIT,4,2 ; @HINIC_PORT_CMD_FWCTXT_INIT
l_.str.1:                               ; @.str.1
	.asciz	"Failed to init FW ctxt, ret = %d\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.no_dead_strip	_init_fw_ctxt
.subsections_via_symbols
