	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hinic_init_hwdev               ## -- Begin function hinic_init_hwdev
	.p2align	4, 0x90
_hinic_init_hwdev:                      ## @hinic_init_hwdev
	.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, %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movl	$4, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_hinic_init_hwif
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	jmp	LBB0_28
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_28
LBB0_4:
	movq	%r14, %rdi
	callq	_HINIC_IS_PF
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	%r14, %rdi
	callq	_HINIC_IS_PPF
	testl	%eax, %eax
	je	LBB0_6
LBB0_7:
	movl	(%r15), %edx
	movq	%r12, %rdi
	movl	$16, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.10:
	movq	%rax, %r15
	movq	%r14, 8(%rax)
	movq	%rax, %rdi
	callq	_init_msix
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	jmp	LBB0_27
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_12:
	movq	%r15, %rdi
	callq	_wait_for_outbound_state
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_warn
	movq	_HINIC_OUTBOUND_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_hinic_outbound_state_set
LBB0_14:
	movq	%r14, %rdi
	callq	_HINIC_HWIF_NUM_AEQS
	movq	_HINIC_DEFAULT_AEQ_LEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_HINIC_EQ_PAGE_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movl	4(%r15), %r9d
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_hinic_aeqs_init
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	movl	%eax, %ebx
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	jmp	LBB0_26
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_27
LBB0_16:
	movq	%r15, %rdi
	callq	_init_pfhwdev
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movl	%eax, %ebx
	leaq	L_.str.5(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_err
	jmp	LBB0_25
LBB0_18:
	movq	%r15, %rdi
	callq	_get_dev_cap
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:
	movl	%eax, %ebx
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_24
LBB0_20:
	movq	%r15, %rdi
	callq	_init_fw_ctxt
	testl	%eax, %eax
	je	LBB0_22
## %bb.21:
	movl	%eax, %ebx
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_24
LBB0_22:
	movq	_HINIC_RES_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_set_resources_state
	testl	%eax, %eax
	je	LBB0_29
## %bb.23:
	movl	%eax, %ebx
	leaq	L_.str.8(%rip), %rsi
LBB0_24:
	movq	%r12, %rdi
	callq	_dev_err
	movq	%r15, %rdi
	callq	_free_pfhwdev
LBB0_25:
	movq	%r15, %rdi
	callq	_hinic_aeqs_free
LBB0_26:
	movq	%r15, %rdi
	callq	_disable_msix
LBB0_27:
	movq	%r14, %rdi
	callq	_hinic_free_hwif
LBB0_28:
	movl	%ebx, %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_29:
	movq	%r15, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to init HW interface\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unsupported PCI Function type\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.2:                               ## @.str.2
	.asciz	"Failed to init msix\n"

L_.str.3:                               ## @.str.3
	.asciz	"outbound - disabled, try again\n"

	.comm	_HINIC_OUTBOUND_ENABLE,4,2      ## @HINIC_OUTBOUND_ENABLE
	.comm	_HINIC_DEFAULT_AEQ_LEN,4,2      ## @HINIC_DEFAULT_AEQ_LEN
	.comm	_HINIC_EQ_PAGE_SIZE,4,2         ## @HINIC_EQ_PAGE_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"Failed to init async event queues\n"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to init PF HW device\n"

L_.str.6:                               ## @.str.6
	.asciz	"Failed to get device capabilities\n"

L_.str.7:                               ## @.str.7
	.asciz	"Failed to init function table\n"

	.comm	_HINIC_RES_ACTIVE,4,2           ## @HINIC_RES_ACTIVE
L_.str.8:                               ## @.str.8
	.asciz	"Failed to set resources state\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hinic_init_hwdev               ; -- Begin function hinic_init_hwdev
	.p2align	2
_hinic_init_hwdev:                      ; @hinic_init_hwdev
	.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	x20, x0
Lloh0:
	adrp	x21, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	w1, #4
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	x1, x20
	bl	_hinic_init_hwif
	cbz	w0, LBB0_4
; %bb.2:
	mov	x22, x0
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_28
LBB0_3:
Lloh4:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_28
LBB0_4:
	mov	x0, x19
	bl	_HINIC_IS_PF
	cbnz	w0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_HINIC_IS_PPF
	cbz	w0, LBB0_14
LBB0_6:
	ldr	w2, [x21]
	mov	x0, x20
	mov	w1, #16
	bl	_devm_kzalloc
	cbz	x0, LBB0_9
; %bb.7:
	mov	x21, x0
	str	x19, [x0, #8]
	bl	_init_msix
	cbz	w0, LBB0_10
; %bb.8:
	mov	x22, x0
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_27
LBB0_9:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_15
LBB0_10:
	mov	x0, x21
	bl	_wait_for_outbound_state
	cbz	w0, LBB0_12
; %bb.11:
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_warn
Lloh13:
	adrp	x8, _HINIC_OUTBOUND_ENABLE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HINIC_OUTBOUND_ENABLE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hinic_outbound_state_set
LBB0_12:
	mov	x0, x19
	bl	_HINIC_HWIF_NUM_AEQS
	mov	x2, x0
Lloh16:
	adrp	x8, _HINIC_DEFAULT_AEQ_LEN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HINIC_DEFAULT_AEQ_LEN@GOTPAGEOFF]
Lloh18:
	ldr	w3, [x8]
Lloh19:
	adrp	x8, _HINIC_EQ_PAGE_SIZE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HINIC_EQ_PAGE_SIZE@GOTPAGEOFF]
Lloh21:
	ldr	w4, [x8]
	ldr	w5, [x21, #4]
	mov	x0, x21
	mov	x1, x19
	bl	_hinic_aeqs_init
	cbz	w0, LBB0_16
; %bb.13:
	mov	x22, x0
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_26
LBB0_14:
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh26:
	adrp	x8, _EFAULT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_15:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_27
LBB0_16:
	mov	x0, x21
	bl	_init_pfhwdev
	cbz	w0, LBB0_18
; %bb.17:
	mov	x22, x0
Lloh28:
	adrp	x1, l_.str.5@PAGE
Lloh29:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_25
LBB0_18:
	mov	x0, x21
	bl	_get_dev_cap
	cbz	w0, LBB0_20
; %bb.19:
	mov	x22, x0
Lloh30:
	adrp	x1, l_.str.6@PAGE
Lloh31:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_24
LBB0_20:
	mov	x0, x21
	bl	_init_fw_ctxt
	cbz	w0, LBB0_22
; %bb.21:
	mov	x22, x0
Lloh32:
	adrp	x1, l_.str.7@PAGE
Lloh33:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_24
LBB0_22:
Lloh34:
	adrp	x8, _HINIC_RES_ACTIVE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _HINIC_RES_ACTIVE@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_set_resources_state
	cbz	w0, LBB0_29
; %bb.23:
	mov	x22, x0
Lloh37:
	adrp	x1, l_.str.8@PAGE
Lloh38:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_24:
	mov	x0, x20
	bl	_dev_err
	mov	x0, x21
	bl	_free_pfhwdev
LBB0_25:
	mov	x0, x21
	bl	_hinic_aeqs_free
LBB0_26:
	mov	x0, x21
	bl	_disable_msix
LBB0_27:
	mov	x0, x19
	bl	_hinic_free_hwif
LBB0_28:
	mov	x0, x22
	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
	b	_ERR_PTR
LBB0_29:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to init HW interface\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unsupported PCI Function type\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.2:                               ; @.str.2
	.asciz	"Failed to init msix\n"

l_.str.3:                               ; @.str.3
	.asciz	"outbound - disabled, try again\n"

	.comm	_HINIC_OUTBOUND_ENABLE,4,2      ; @HINIC_OUTBOUND_ENABLE
	.comm	_HINIC_DEFAULT_AEQ_LEN,4,2      ; @HINIC_DEFAULT_AEQ_LEN
	.comm	_HINIC_EQ_PAGE_SIZE,4,2         ; @HINIC_EQ_PAGE_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"Failed to init async event queues\n"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to init PF HW device\n"

l_.str.6:                               ; @.str.6
	.asciz	"Failed to get device capabilities\n"

l_.str.7:                               ; @.str.7
	.asciz	"Failed to init function table\n"

	.comm	_HINIC_RES_ACTIVE,4,2           ; @HINIC_RES_ACTIVE
l_.str.8:                               ; @.str.8
	.asciz	"Failed to set resources state\n"

.subsections_via_symbols
