	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_setup_hca
_hns_roce_setup_hca:                    ## @hns_roce_setup_hca
	.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	%rdi, %r12
	movq	24(%rdi), %r15
	addq	$20, %rdi
	callq	_spin_lock_init
	leaq	16(%r12), %rdi
	callq	_spin_lock_init
	movq	_HNS_ROCE_CAP_FLAG_RECORD_DB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r12)
	je	LBB0_2
## %bb.1:
	leaq	12(%r12), %rdi
	callq	_INIT_LIST_HEAD
	leaq	8(%r12), %rdi
	callq	_mutex_init
LBB0_2:
	movq	%r12, %rdi
	callq	_hns_roce_init_uar_table
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_23
LBB0_4:
	movq	%r12, %rdi
	movq	%r12, %rsi
	callq	_hns_roce_uar_alloc
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_22
LBB0_6:
	movq	%r12, %rdi
	callq	_hns_roce_init_pd_table
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_21
LBB0_8:
	movq	%r12, %rdi
	callq	_hns_roce_init_mr_table
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r14d
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_20
LBB0_10:
	movq	%r12, %rdi
	callq	_hns_roce_init_cq_table
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %r14d
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	jmp	LBB0_19
LBB0_12:
	movq	%r12, %rdi
	callq	_hns_roce_init_qp_table
	testl	%eax, %eax
	je	LBB0_14
## %bb.13:
	movl	%eax, %r14d
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
LBB0_18:
	movq	%r12, %rdi
	callq	_hns_roce_cleanup_cq_table
LBB0_19:
	movq	%r12, %rdi
	callq	_hns_roce_cleanup_mr_table
LBB0_20:
	movq	%r12, %rdi
	callq	_hns_roce_cleanup_pd_table
LBB0_21:
	movq	%r12, %rdi
	movq	%r12, %rsi
	callq	_hns_roce_uar_free
LBB0_22:
	movq	%r12, %rdi
	callq	_hns_roce_cleanup_uar_table
	movl	%r14d, %ebx
LBB0_23:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_HNS_ROCE_CAP_FLAG_SRQ@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	xorl	%ebx, %ebx
	testl	%eax, 4(%r12)
	je	LBB0_23
## %bb.15:
	movq	%r12, %rdi
	callq	_hns_roce_init_srq_table
	testl	%eax, %eax
	je	LBB0_23
## %bb.16:
	movl	%eax, %r14d
	leaq	L_.str.6(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movl	(%r13), %eax
	testl	%eax, 4(%r12)
	je	LBB0_18
## %bb.17:
	movq	%r12, %rdi
	callq	_hns_roce_cleanup_qp_table
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_HNS_ROCE_CAP_FLAG_RECORD_DB,4,2 ## @HNS_ROCE_CAP_FLAG_RECORD_DB
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to initialize uar table. aborting\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate priv_uar.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to init protected domain table.\n"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to init memory region table.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Failed to init completion queue table.\n"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to init queue pair table.\n"

	.comm	_HNS_ROCE_CAP_FLAG_SRQ,4,2      ## @HNS_ROCE_CAP_FLAG_SRQ
L_.str.6:                               ## @.str.6
	.asciz	"Failed to init share receive queue table.\n"

	.no_dead_strip	_hns_roce_setup_hca
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_setup_hca
_hns_roce_setup_hca:                    ; @hns_roce_setup_hca
	.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
	ldr	x21, [x0, #24]
	add	x0, x0, #20
	bl	_spin_lock_init
	add	x0, x19, #16
	bl	_spin_lock_init
	ldr	w8, [x19, #4]
Lloh0:
	adrp	x9, _HNS_ROCE_CAP_FLAG_RECORD_DB@GOTPAGE
Lloh1:
	ldr	x9, [x9, _HNS_ROCE_CAP_FLAG_RECORD_DB@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	add	x0, x19, #12
	bl	_INIT_LIST_HEAD
	add	x0, x19, #8
	bl	_mutex_init
LBB0_2:
	mov	x0, x19
	bl	_hns_roce_init_uar_table
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_19
LBB0_4:
	mov	x0, x19
	mov	x1, x19
	bl	_hns_roce_uar_alloc
	cbz	w0, LBB0_6
; %bb.5:
	mov	x20, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_18
LBB0_6:
	mov	x0, x19
	bl	_hns_roce_init_pd_table
	cbz	w0, LBB0_8
; %bb.7:
	mov	x20, x0
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_17
LBB0_8:
	mov	x0, x19
	bl	_hns_roce_init_mr_table
	cbz	w0, LBB0_10
; %bb.9:
	mov	x20, x0
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_16
LBB0_10:
	mov	x0, x19
	bl	_hns_roce_init_cq_table
	cbz	w0, LBB0_12
; %bb.11:
	mov	x20, x0
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_15
LBB0_12:
	mov	x0, x19
	bl	_hns_roce_init_qp_table
	cbz	w0, LBB0_20
; %bb.13:
	mov	x20, x0
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	bl	_dev_err
LBB0_14:
	mov	x0, x19
	bl	_hns_roce_cleanup_cq_table
LBB0_15:
	mov	x0, x19
	bl	_hns_roce_cleanup_mr_table
LBB0_16:
	mov	x0, x19
	bl	_hns_roce_cleanup_pd_table
LBB0_17:
	mov	x0, x19
	mov	x1, x19
	bl	_hns_roce_uar_free
LBB0_18:
	mov	x0, x19
	bl	_hns_roce_cleanup_uar_table
LBB0_19:
	mov	x0, x20
	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_20:
	ldr	w8, [x19, #4]
Lloh15:
	adrp	x22, _HNS_ROCE_CAP_FLAG_SRQ@GOTPAGE
Lloh16:
	ldr	x22, [x22, _HNS_ROCE_CAP_FLAG_SRQ@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_24
; %bb.21:
	mov	x0, x19
	bl	_hns_roce_init_srq_table
	mov	x20, x0
	cbz	w0, LBB0_19
; %bb.22:
Lloh17:
	adrp	x1, l_.str.6@PAGE
Lloh18:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	ldr	w8, [x19, #4]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.23:
	mov	x0, x19
	bl	_hns_roce_cleanup_qp_table
	b	LBB0_14
LBB0_24:
	mov	w20, #0
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_HNS_ROCE_CAP_FLAG_RECORD_DB,4,2 ; @HNS_ROCE_CAP_FLAG_RECORD_DB
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to initialize uar table. aborting\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate priv_uar.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to init protected domain table.\n"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to init memory region table.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Failed to init completion queue table.\n"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to init queue pair table.\n"

	.comm	_HNS_ROCE_CAP_FLAG_SRQ,4,2      ; @HNS_ROCE_CAP_FLAG_SRQ
l_.str.6:                               ; @.str.6
	.asciz	"Failed to init share receive queue table.\n"

	.no_dead_strip	_hns_roce_setup_hca
.subsections_via_symbols
